* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef DISP_COMMON_H
#define DISP_COMMON_H
#include <stdint.h>
#include "hdf_log.h"
#ifdef HDF_LOG_TAG
#undef HDF_LOG_TAG
#endif
#define HDF_LOG_TAG HDF_DISP
#define CHECK_NULLPOINTER_RETURN_VALUE(pointer, ret) do { \
if ((pointer) == NULL) { \
HDF_LOGE("%s: pointer is null", __func__); \
return (ret); \
} \
} while (0)
#define CHECK_NULLPOINTER_RETURN(pointer) do { \
if ((pointer) == NULL) { \
HDF_LOGE("%s: pointer is null", __func__); \
return; \
} \
} while (0)
#define DISPLAY_CHK_RETURN(val, ret, ...) \
do { \
if (val) { \
__VA_ARGS__; \
return (ret); \
} \
} while (0)
#define DISPLAY_CHK_RETURN_NOT_VALUE(val, ...) \
do { \
if (val) { \
__VA_ARGS__; \
return; \
} \
} while (0)
enum LayerId {
GRA_LAYER_0,
GRA_LAYER_1,
GRA_LAYER_2,
GRA_LAYER_MAX,
OV_LAYER_0,
OV_LAYER_1,
OV_LAYER_2,
OV_LAYER_MAX
};
enum PowerMode {
DISP_ON,
DISP_OFF,
};
enum IntfSync {
OUTPUT_USER = 0,
OUTPUT_PAL,
OUTPUT_NTSC,
OUTPUT_1080P24,
OUTPUT_1080P25,
OUTPUT_1080P30,
OUTPUT_720P50,
OUTPUT_720P60,
OUTPUT_1080I50,
OUTPUT_1080I60,
OUTPUT_1080P50,
OUTPUT_1080P60,
OUTPUT_576P50,
OUTPUT_480P60,
OUTPUT_800X600_60,
OUTPUT_1024X768_60,
OUTPUT_1280X1024_60,
OUTPUT_1366X768_60,
OUTPUT_1440X900_60,
OUTPUT_1280X800_60,
OUTPUT_1600X1200_60,
OUTPUT_1680X1050_60,
OUTPUT_1920X1200_60,
OUTPUT_640X480_60,
OUTPUT_960H_PAL,
OUTPUT_960H_NTSC,
OUTPUT_1920X2160_30,
OUTPUT_2560X1440_30,
OUTPUT_2560X1440_60,
OUTPUT_2560X1600_60,
OUTPUT_3840X2160_24,
OUTPUT_3840X2160_25,
OUTPUT_3840X2160_30,
OUTPUT_3840X2160_50,
OUTPUT_3840X2160_60,
OUTPUT_4096X2160_24,
OUTPUT_4096X2160_25,
OUTPUT_4096X2160_30,
OUTPUT_4096X2160_50,
OUTPUT_4096X2160_60,
OUTPUT_320X240_60,
OUTPUT_320X240_50,
OUTPUT_240X320_50,
OUTPUT_240X320_60,
OUTPUT_800X600_50,
OUTPUT_720X1280_60,
OUTPUT_1080X1920_60,
OUTPUT_7680X4320_30,
};
struct DispInfo {
uint32_t width;
uint32_t hbp;
uint32_t hfp;
uint32_t hsw;
uint32_t height;
uint32_t vbp;
uint32_t vfp;
uint32_t vsw;
uint32_t frameRate;
uint32_t intfType;
enum IntfSync intfSync;
uint32_t minLevel;
uint32_t maxLevel;
uint32_t defLevel;
};
#endif