19762338dSopenharmony_ci/* 29762338dSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 39762338dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 49762338dSopenharmony_ci * you may not use this file except in compliance with the License. 59762338dSopenharmony_ci * You may obtain a copy of the License at 69762338dSopenharmony_ci * 79762338dSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 89762338dSopenharmony_ci * 99762338dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 109762338dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 119762338dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 129762338dSopenharmony_ci * See the License for the specific language governing permissions and 139762338dSopenharmony_ci * limitations under the License. 149762338dSopenharmony_ci */ 159762338dSopenharmony_ci 169762338dSopenharmony_ci#ifndef DISPLAY_TEST_H 179762338dSopenharmony_ci#define DISPLAY_TEST_H 189762338dSopenharmony_ci#include "display_gfx.h" 199762338dSopenharmony_ci#include "display_gralloc.h" 209762338dSopenharmony_ci#include "display_layer.h" 219762338dSopenharmony_ci#include "display_type.h" 229762338dSopenharmony_ci 239762338dSopenharmony_ci#ifdef __cplusplus 249762338dSopenharmony_ciextern "C" { 259762338dSopenharmony_ci#endif 269762338dSopenharmony_ci 279762338dSopenharmony_ci/* layer width */ 289762338dSopenharmony_ci#define LAYER_WIDTH 480 299762338dSopenharmony_ci/* layer height */ 309762338dSopenharmony_ci#define LAYER_HEIGHT 960 319762338dSopenharmony_ci#define PIXEL_BYTE 2 329762338dSopenharmony_ci#define MAX_GLOBLE_ALPHA 255 339762338dSopenharmony_ci#define IMG_KEEP_TIME 2 349762338dSopenharmony_ci 359762338dSopenharmony_ci#define SAMPLE_IMAGE_WIDTH 300 369762338dSopenharmony_ci#define SAMPLE_IMAGE_HEIGHT 150 379762338dSopenharmony_ci#define SAMPLE_RECT_WIDTH 600 389762338dSopenharmony_ci#define SAMPLE_RECT_HEIGHT 300 399762338dSopenharmony_ci#define HIFB_RED_1555 0xFC00 409762338dSopenharmony_ci#define COLOR_RGB_BLUE 0x0000FF 419762338dSopenharmony_ci#define MEM_POOL_COUNT 64 429762338dSopenharmony_ci#define BUFFER_BLOCK_COUNT 20 439762338dSopenharmony_ci#define LAYER_BPP 16 449762338dSopenharmony_ci#define VO_FRAME_RATE 50 459762338dSopenharmony_ci#define LINE_WIDTH 2 469762338dSopenharmony_ci#define BITS_PER_BYTE 8 479762338dSopenharmony_ci/* porch */ 489762338dSopenharmony_ci#define PORCH_HBP 30 499762338dSopenharmony_ci#define PORCH_HFP 10 509762338dSopenharmony_ci#define PORCH_HS 10 519762338dSopenharmony_ci#define PORCH_VBP 10 529762338dSopenharmony_ci#define PORCH_VFP 4 539762338dSopenharmony_ci#define PORCH_VS 2 549762338dSopenharmony_ci 559762338dSopenharmony_ci/* device division */ 569762338dSopenharmony_ci#define DEVICE_DIV 3 579762338dSopenharmony_ci/* premult division */ 589762338dSopenharmony_ci#define PRE_DIV 1 599762338dSopenharmony_ci/* LCD division coefficient */ 609762338dSopenharmony_ci#define LCD_DIV_COE 0x182ed6 619762338dSopenharmony_ci 629762338dSopenharmony_ci#ifdef __LITEOS__ 639762338dSopenharmony_ci#define PIC_RES_PATH "/user/data/gfx_test.bmp" 649762338dSopenharmony_ci#else 659762338dSopenharmony_ci#define PIC_RES_PATH "/storage/data/gfx_test.bmp" 669762338dSopenharmony_ci#endif 679762338dSopenharmony_ci 689762338dSopenharmony_citypedef struct { 699762338dSopenharmony_ci LayerFuncs *layerFuncs; 709762338dSopenharmony_ci GrallocFuncs *grallocFuncs; 719762338dSopenharmony_ci GfxFuncs *gfxFuncs; 729762338dSopenharmony_ci DisplayInfo displayInfo; 739762338dSopenharmony_ci uint32_t devId; 749762338dSopenharmony_ci uint32_t layerId; 759762338dSopenharmony_ci LayerBuffer buffer; 769762338dSopenharmony_ci} DisplayTest; 779762338dSopenharmony_ci 789762338dSopenharmony_ciint32_t DisplayInit(void); 799762338dSopenharmony_ciint32_t DisplayUninit(void); 809762338dSopenharmony_ciint32_t InitDisplayTest(void); 819762338dSopenharmony_ciint32_t DeinitDisplayTest(void); 829762338dSopenharmony_ciint32_t GetDisplayInfoTest(void); 839762338dSopenharmony_ciint32_t CreateLayerTest(void); 849762338dSopenharmony_ciint32_t CloseLayerTest(void); 859762338dSopenharmony_ciint32_t SetLayerVisibleTest(void); 869762338dSopenharmony_ciint32_t SetLayerDirtyRegionTest(void); 879762338dSopenharmony_ciint32_t GetLayerBufferTest(void); 889762338dSopenharmony_ciint32_t FlushTest(void); 899762338dSopenharmony_ciint32_t InitGfxTest(void); 909762338dSopenharmony_ciint32_t DeinitGfxTest(void); 919762338dSopenharmony_ciint32_t BlitTest(void); 929762338dSopenharmony_ciint32_t FillRectTest(void); 939762338dSopenharmony_ciint32_t AllocMemTest1(void); 949762338dSopenharmony_ciint32_t MmapCacheTest(void); 959762338dSopenharmony_ciint32_t FlushMCacheTest(void); 969762338dSopenharmony_ciint32_t FreeMemTest(void); 979762338dSopenharmony_ciint32_t AllocMemTest2(void); 989762338dSopenharmony_ci 999762338dSopenharmony_ci#ifdef __cplusplus 1009762338dSopenharmony_ci} 1019762338dSopenharmony_ci#endif 1029762338dSopenharmony_ci#endif // DISPLAY_TEST_H 103