1094332d3Sopenharmony_ci/*
2094332d3Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd.
3094332d3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4094332d3Sopenharmony_ci * you may not use this file except in compliance with the License.
5094332d3Sopenharmony_ci * You may obtain a copy of the License at
6094332d3Sopenharmony_ci *
7094332d3Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8094332d3Sopenharmony_ci *
9094332d3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10094332d3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11094332d3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12094332d3Sopenharmony_ci * See the License for the specific language governing permissions and
13094332d3Sopenharmony_ci * limitations under the License.
14094332d3Sopenharmony_ci */
15094332d3Sopenharmony_ci
16094332d3Sopenharmony_ci#ifndef DISPLAY_TEST_H
17094332d3Sopenharmony_ci#define DISPLAY_TEST_H
18094332d3Sopenharmony_ci#include "display_gfx.h"
19094332d3Sopenharmony_ci#include "display_gralloc.h"
20094332d3Sopenharmony_ci#include "display_layer.h"
21094332d3Sopenharmony_ci#include "display_type.h"
22094332d3Sopenharmony_ci
23094332d3Sopenharmony_ci#ifdef __cplusplus
24094332d3Sopenharmony_ciextern "C" {
25094332d3Sopenharmony_ci#endif
26094332d3Sopenharmony_ci
27094332d3Sopenharmony_ci/* layer width */
28094332d3Sopenharmony_ci#define LAYER_WIDTH            480
29094332d3Sopenharmony_ci/* layer height */
30094332d3Sopenharmony_ci#define LAYER_HEIGHT           960
31094332d3Sopenharmony_ci#define PIXEL_BYTE             2
32094332d3Sopenharmony_ci#define MAX_GLOBLE_ALPHA       255
33094332d3Sopenharmony_ci#define IMG_KEEP_TIME          2
34094332d3Sopenharmony_ci
35094332d3Sopenharmony_ci#define SAMPLE_IMAGE_WIDTH     300
36094332d3Sopenharmony_ci#define SAMPLE_IMAGE_HEIGHT    150
37094332d3Sopenharmony_ci#define SAMPLE_RECT_WIDTH      600
38094332d3Sopenharmony_ci#define SAMPLE_RECT_HEIGHT     300
39094332d3Sopenharmony_ci#define HIFB_RED_1555          0xFC00
40094332d3Sopenharmony_ci#define COLOR_RGB_BLUE         0x0000FF
41094332d3Sopenharmony_ci#define MEM_POOL_COUNT         64
42094332d3Sopenharmony_ci#define BUFFER_BLOCK_COUNT     20
43094332d3Sopenharmony_ci#define LAYER_BPP              16
44094332d3Sopenharmony_ci#define VO_FRAME_RATE          50
45094332d3Sopenharmony_ci#define LINE_WIDTH             2
46094332d3Sopenharmony_ci#define BITS_PER_BYTE          8
47094332d3Sopenharmony_ci/* porch */
48094332d3Sopenharmony_ci#define PORCH_HBP              30
49094332d3Sopenharmony_ci#define PORCH_HFP              10
50094332d3Sopenharmony_ci#define PORCH_HS               10
51094332d3Sopenharmony_ci#define PORCH_VBP              10
52094332d3Sopenharmony_ci#define PORCH_VFP              4
53094332d3Sopenharmony_ci#define PORCH_VS               2
54094332d3Sopenharmony_ci
55094332d3Sopenharmony_ci/* device division */
56094332d3Sopenharmony_ci#define DEVICE_DIV             3
57094332d3Sopenharmony_ci/* premult division */
58094332d3Sopenharmony_ci#define PRE_DIV                1
59094332d3Sopenharmony_ci/* LCD division coefficient */
60094332d3Sopenharmony_ci#define LCD_DIV_COE            0x182ed6
61094332d3Sopenharmony_ci
62094332d3Sopenharmony_ci#ifdef __LITEOS__
63094332d3Sopenharmony_ci#define PIC_RES_PATH           "/user/data/gfx_test.bmp"
64094332d3Sopenharmony_ci#else
65094332d3Sopenharmony_ci#define PIC_RES_PATH           "/storage/data/gfx_test.bmp"
66094332d3Sopenharmony_ci#endif
67094332d3Sopenharmony_ci
68094332d3Sopenharmony_citypedef struct {
69094332d3Sopenharmony_ci    LayerFuncs *layerFuncs;
70094332d3Sopenharmony_ci    GrallocFuncs *grallocFuncs;
71094332d3Sopenharmony_ci    GfxFuncs *gfxFuncs;
72094332d3Sopenharmony_ci    DisplayInfo displayInfo;
73094332d3Sopenharmony_ci    uint32_t devId;
74094332d3Sopenharmony_ci    uint32_t layerId;
75094332d3Sopenharmony_ci    LayerBuffer buffer;
76094332d3Sopenharmony_ci} DisplayTest;
77094332d3Sopenharmony_ci
78094332d3Sopenharmony_ciint32_t DisplayInit(void);
79094332d3Sopenharmony_ciint32_t DisplayUninit(void);
80094332d3Sopenharmony_ciint32_t InitDisplayTest(void);
81094332d3Sopenharmony_ciint32_t DeinitDisplayTest(void);
82094332d3Sopenharmony_ciint32_t GetDisplayInfoTest(void);
83094332d3Sopenharmony_ciint32_t CreateLayerTest(void);
84094332d3Sopenharmony_ciint32_t CloseLayerTest(void);
85094332d3Sopenharmony_ciint32_t SetLayerVisibleTest(void);
86094332d3Sopenharmony_ciint32_t SetLayerDirtyRegionTest(void);
87094332d3Sopenharmony_ciint32_t GetLayerBufferTest(void);
88094332d3Sopenharmony_ciint32_t FlushTest(void);
89094332d3Sopenharmony_ciint32_t InitGfxTest(void);
90094332d3Sopenharmony_ciint32_t DeinitGfxTest(void);
91094332d3Sopenharmony_ciint32_t BlitTest(void);
92094332d3Sopenharmony_ciint32_t FillRectTest(void);
93094332d3Sopenharmony_ciint32_t AllocMemTest1(void);
94094332d3Sopenharmony_ciint32_t MmapCacheTest(void);
95094332d3Sopenharmony_ciint32_t FlushMCacheTest(void);
96094332d3Sopenharmony_ciint32_t FreeMemTest(void);
97094332d3Sopenharmony_ciint32_t AllocMemTest2(void);
98094332d3Sopenharmony_ci
99094332d3Sopenharmony_ci#ifdef __cplusplus
100094332d3Sopenharmony_ci}
101094332d3Sopenharmony_ci#endif
102094332d3Sopenharmony_ci#endif // DISPLAY_TEST_H
103