From 4554f63c5429a7274e02a7bb58720a56888b8997 Mon Sep 17 00:00:00 2001 From: Bencheng Jing Date: Fri, 22 Feb 2019 13:29:34 +0800 Subject: [PATCH] amvecm: add ioctrl interface for hdr type. [1/1] PD#TV-1592 Problem: no interface to get hdr type Solution: add ioctrl interface for hdr type Verify: tl1 Change-Id: Ib7781fa8c924cbd7721b592acb18d3b834a04f06 Signed-off-by: Bencheng Jing --- drivers/amlogic/media/enhancement/amvecm/amvecm.c | 8 +++++++- include/linux/amlogic/media/amvecm/amvecm.h | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/media/enhancement/amvecm/amvecm.c b/drivers/amlogic/media/enhancement/amvecm/amvecm.c index c95f1f9..03fbd73 100644 --- a/drivers/amlogic/media/enhancement/amvecm/amvecm.c +++ b/drivers/amlogic/media/enhancement/amvecm/amvecm.c @@ -182,7 +182,7 @@ unsigned int debug_game_mode_1; module_param(debug_game_mode_1, uint, 0664); MODULE_PARM_DESC(debug_game_mode_1, "\n debug_game_mode_1\n"); unsigned int pq_user_value; -unsigned int hdr_source_type = 0x1; +enum hdr_type_e hdr_source_type = HDRTYPE_SDR; #define SR0_OFFSET 0xc00 #define SR1_OFFSET 0xc80 @@ -1702,6 +1702,12 @@ static long amvecm_ioctl(struct file *file, pr_amvecm_dbg("lc load curve parm success\n"); } break; + case AMVECM_IOC_G_HDR_TYPE: + argp = (void __user *)arg; + if (copy_to_user(argp, + &hdr_source_type, sizeof(enum hdr_type_e))) + ret = -EFAULT; + break; default: ret = -EINVAL; break; diff --git a/include/linux/amlogic/media/amvecm/amvecm.h b/include/linux/amlogic/media/amvecm/amvecm.h index 118748d..1f8492b 100644 --- a/include/linux/amlogic/media/amvecm/amvecm.h +++ b/include/linux/amlogic/media/amvecm/amvecm.h @@ -211,6 +211,11 @@ enum pc_mode_e { #define AMVECM_IOC_G_PIC_MODE _IOR(_VE_CM, 0x59, struct am_vdj_mode_s) #define AMVECM_IOC_S_PIC_MODE _IOW(_VE_CM, 0x60, struct am_vdj_mode_s) + +/*HDR TYPE command list*/ +#define AMVECM_IOC_G_HDR_TYPE _IOR(_VE_CM, 0x61, enum hdr_type_e) + + /*Local contrast command list*/ #define AMVECM_IOC_S_LC_CURVE _IOW(_VE_CM, 0x62, struct ve_lc_curve_parm_s) @@ -264,6 +269,14 @@ enum vpp_matrix_csc_e { VPP_MATRIX_DEFAULT_CSCTYPE = 0xffff, }; +enum hdr_type_e { + HDRTYPE_NONE = 0, + HDRTYPE_SDR = 0x1, + HDRTYPE_HDR10 = 0x2, + HDRTYPE_HLG = 0x4, + HDRTYPE_MAX, +}; + enum vpp_transfer_characteristic_e { VPP_ST_NULL = 0, VPP_ST709 = 0x1, @@ -432,9 +445,10 @@ static inline uint32_t READ_VPP_REG_BITS(uint32_t reg, extern signed int vd1_brightness, vd1_contrast; extern bool gamma_en; -extern unsigned int hdr_source_type; + extern unsigned int atv_source_flg; +extern enum hdr_type_e hdr_source_type; #define CSC_FLAG_TOGGLE_FRAME 1 #define CSC_FLAG_CHECK_OUTPUT 2 -- 2.7.4