• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef DISPLAY_TEST_H
17 #define DISPLAY_TEST_H
18 #include "display_gfx.h"
19 #include "display_gralloc.h"
20 #include "display_layer.h"
21 #include "display_type.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* layer width */
28 #define LAYER_WIDTH            480
29 /* layer height */
30 #define LAYER_HEIGHT           960
31 #define PIXEL_BYTE             2
32 #define MAX_GLOBLE_ALPHA       255
33 #define IMG_KEEP_TIME          2
34 
35 #define SAMPLE_IMAGE_WIDTH     300
36 #define SAMPLE_IMAGE_HEIGHT    150
37 #define SAMPLE_RECT_WIDTH      600
38 #define SAMPLE_RECT_HEIGHT     300
39 #define HIFB_RED_1555          0xFC00
40 #define COLOR_RGB_BLUE         0x0000FF
41 #define MEM_POOL_COUNT         64
42 #define BUFFER_BLOCK_COUNT     20
43 #define LAYER_BPP              16
44 #define VO_FRAME_RATE          50
45 #define LINE_WIDTH             2
46 #define BITS_PER_BYTE          8
47 /* porch */
48 #define PORCH_HBP              30
49 #define PORCH_HFP              10
50 #define PORCH_HS               10
51 #define PORCH_VBP              10
52 #define PORCH_VFP              4
53 #define PORCH_VS               2
54 
55 /* device division */
56 #define DEVICE_DIV             3
57 /* premult division */
58 #define PRE_DIV                1
59 /* LCD division coefficient */
60 #define LCD_DIV_COE            0x182ed6
61 
62 #ifdef __LITEOS__
63 #define PIC_RES_PATH           "/user/data/gfx_test.bmp"
64 #else
65 #define PIC_RES_PATH           "/storage/data/gfx_test.bmp"
66 #endif
67 
68 typedef struct {
69     LayerFuncs *layerFuncs;
70     GrallocFuncs *grallocFuncs;
71     GfxFuncs *gfxFuncs;
72     DisplayInfo displayInfo;
73     uint32_t devId;
74     uint32_t layerId;
75     LayerBuffer buffer;
76 } DisplayTest;
77 
78 int32_t DisplayInit(void);
79 int32_t DisplayUninit(void);
80 int32_t InitDisplayTest(void);
81 int32_t DeinitDisplayTest(void);
82 int32_t GetDisplayInfoTest(void);
83 int32_t CreateLayerTest(void);
84 int32_t CloseLayerTest(void);
85 int32_t SetLayerVisibleTest(void);
86 int32_t SetLayerDirtyRegionTest(void);
87 int32_t GetLayerBufferTest(void);
88 int32_t FlushTest(void);
89 int32_t InitGfxTest(void);
90 int32_t DeinitGfxTest(void);
91 int32_t BlitTest(void);
92 int32_t FillRectTest(void);
93 int32_t AllocMemTest1(void);
94 int32_t MmapCacheTest(void);
95 int32_t FlushMCacheTest(void);
96 int32_t FreeMemTest(void);
97 int32_t AllocMemTest2(void);
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 #endif // DISPLAY_TEST_H
103