From 2f815283c7407af289432810ff3c89278dffca11 Mon Sep 17 00:00:00 2001 From: "Arun Kumar K.R" Date: Tue, 17 Jan 2017 19:33:59 -0800 Subject: msm: mdss: Add HDR Metadata Interface Define an interface to help user-space to pass the HDR stream information to the driver which will be used in configuring HDMI and DP interfaces. Use the new interface in HDMI and make necessary changes while reading the info. CRs-Fixed: 2004813 Change-Id: I3447c7b2ad5c4ca072becbeb2201e27c4f57c1dd Signed-off-by: Arun Kumar K.R --- include/uapi/linux/msm_mdp_ext.h | 94 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) (limited to 'include') diff --git a/include/uapi/linux/msm_mdp_ext.h b/include/uapi/linux/msm_mdp_ext.h index 3bd8bea8ae0d..ee68675bfe13 100644 --- a/include/uapi/linux/msm_mdp_ext.h +++ b/include/uapi/linux/msm_mdp_ext.h @@ -179,6 +179,77 @@ VALIDATE/COMMIT FLAG CONFIGURATION #define OUT_LAYER_COLOR_SPACE +/* From CEA.861.3 */ +#define MDP_HDR_EOTF_SMTPE_ST2084 0x2 +#define MDP_HDR_EOTF_HLG 0x3 + +/* From Vesa DPv1.4 - Pixel Encoding - Table 2-120 */ +#define MDP_PIXEL_ENCODING_RGB 0x0 +#define MDP_PIXEL_ENCODING_YCBCR_444 0x1 +#define MDP_PIXEL_ENCODING_YCBCR_422 0x2 +#define MDP_PIXEL_ENCODING_YCBCR_420 0x3 +#define MDP_PIXEL_ENCODING_Y_ONLY 0x4 +#define MDP_PIXEL_ENCODING_RAW 0x5 + +/* From Vesa DPv1.4 - Colorimetry Formats - Table 2-120 */ +/* RGB - used with MDP_DP_PIXEL_ENCODING_RGB */ +#define MDP_COLORIMETRY_RGB_SRGB 0x0 +#define MDP_COLORIMETRY_RGB_WIDE_FIXED_POINT 0x1 +#define MDP_COLORIMETRY_RGB_WIDE_FLOAT_POINT 0x2 +#define MDP_COLORIMETRY_RGB_ADOBE 0x3 +#define MDP_COLORIMETRY_RGB_DPI_P3 0x4 +#define MDP_COLORIMETRY_RGB_CUSTOM 0x5 +#define MDP_COLORIMETRY_RGB_ITU_R_BT_2020 0x6 + +/* YUV - used with MDP_DP_PIXEL_ENCODING_YCBCR(444 or 422 or 420) */ +#define MDP_COLORIMETRY_YCBCR_ITU_R_BT_601 0x0 +#define MDP_COLORIMETRY_YCBCR_ITU_R_BT_709 0x1 +#define MDP_COLORIMETRY_YCBCR_XV_YCC_601 0x2 +#define MDP_COLORIMETRY_YCBCR_XV_YCC_709 0x3 +#define MDP_COLORIMETRY_YCBCR_S_YCC_601 0x4 +#define MDP_COLORIMETRY_YCBCR_ADOBE_YCC_601 0x5 +#define MDP_COLORIMETRY_YCBCR_ITU_R_BT_2020_YCBCR_CONST 0x6 +#define MDP_COLORIMETRY_YCBCR_ITU_R_BT_2020_YCBCR 0x7 + +/* Dynamic Range - Table 2-120 */ +/* Full range */ +#define MDP_DYNAMIC_RANGE_VESA 0x0 +/* Limited range */ +#define MDP_DYNAMIC_RANGE_CEA 0x1 + +/* Bits per component(bpc) for Pixel encoding format RGB from Table 2-120 */ +#define MDP_RGB_6_BPC 0x0 +#define MDP_RGB_8_BPC 0x1 +#define MDP_RGB_10_BPC 0x2 +#define MDP_RGB_12_BPC 0x3 +#define MDP_RGB_16_BPC 0x4 + +/* + * Bits per component(bpc) for Pixel encoding format YCbCr444, YCbCr422, + * YCbCr420 and Y only + * from Table 2-120 + */ +#define MDP_YUV_8_BPC 0x1 +#define MDP_YUV_10_BPC 0x2 +#define MDP_YUV_12_BPC 0x3 +#define MDP_YUV_16_BPC 0x4 + +/* Bits per component(bpc) for Pixel encoding format RAW from Table 2-120 */ +#define MDP_RAW_6_BPC 0x1 +#define MDP_RAW_7_BPC 0x2 +#define MDP_RAW_8_BPC 0x3 +#define MDP_RAW_10_BPC 0x4 +#define MDP_RAW_12_BPC 0x5 +#define MDP_RAW_14_BPC 0x6 +#define MDP_RAW16_BPC 0x7 + +/* Content Type - Table 2-120 */ +#define MDP_CONTENT_TYPE_NOT_DEFINED 0x0 +#define MDP_CONTENT_TYPE_GRAPHICS 0x1 +#define MDP_CONTENT_TYPE_PHOTO 0x2 +#define MDP_CONTENT_TYPE_VIDEO 0x3 +#define MDP_CONTENT_TYPE_GAME 0x4 + /********************************************************************** Configuration structures All parameters are input to driver unless mentioned output parameter @@ -709,4 +780,27 @@ struct mdp_set_cfg { uint32_t len; uint64_t __user payload; }; + +#define HDR_PRIMARIES_COUNT 3 + +#define MDP_HDR_STREAM + +struct mdp_hdr_stream { + uint32_t eotf; + uint32_t display_primaries_x[HDR_PRIMARIES_COUNT]; + uint32_t display_primaries_y[HDR_PRIMARIES_COUNT]; + uint32_t white_point_x; + uint32_t white_point_y; + uint32_t max_luminance; + uint32_t min_luminance; + uint32_t max_content_light_level; + uint32_t max_average_light_level; + /* DP related */ + uint32_t pixel_encoding; + uint32_t colorimetry; + uint32_t range; + uint32_t bits_per_component; + uint32_t content_type; + uint32_t reserved[5]; +}; #endif -- cgit v1.2.3