lcd: update optical info struct name
authorEvoke Zhang <evoke.zhang@amlogic.com>
Tue, 26 Jun 2018 02:16:55 +0000 (10:16 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 22 Aug 2018 10:28:41 +0000 (03:28 -0700)
PD#171986: lcd: update optical info struct name

Change-Id: I17b4381b7011a48491d3e127ceba8b08b7dcd197
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
drivers/amlogic/media/vout/lcd/lcd_common.c
drivers/amlogic/media/vout/lcd/lcd_common.h
drivers/amlogic/media/vout/lcd/lcd_debug.c
drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c
drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c
drivers/amlogic/media/vout/lcd/lcd_vout.c
include/linux/amlogic/media/vout/lcd/lcd_vout.h

index e988251..38873b4 100644 (file)
@@ -679,28 +679,28 @@ int lcd_power_load_from_unifykey(struct lcd_config_s *pconf,
        return 0;
 }
 
-void lcd_hdr_vinfo_update(void)
+void lcd_optical_vinfo_update(void)
 {
        struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver();
        struct lcd_config_s *pconf;
-       struct master_display_info_s *hdr_vinfo;
+       struct master_display_info_s *disp_vinfo;
 
        pconf = lcd_drv->lcd_config;
-       hdr_vinfo = &lcd_drv->lcd_info->master_display_info;
-       hdr_vinfo->present_flag = pconf->hdr_info.hdr_support;
-       hdr_vinfo->features = pconf->hdr_info.features;
-       hdr_vinfo->primaries[0][0] = pconf->hdr_info.primaries_g_x;
-       hdr_vinfo->primaries[0][1] = pconf->hdr_info.primaries_g_y;
-       hdr_vinfo->primaries[1][0] = pconf->hdr_info.primaries_b_x;
-       hdr_vinfo->primaries[1][1] = pconf->hdr_info.primaries_b_y;
-       hdr_vinfo->primaries[2][0] = pconf->hdr_info.primaries_r_x;
-       hdr_vinfo->primaries[2][1] = pconf->hdr_info.primaries_r_y;
-       hdr_vinfo->white_point[0] = pconf->hdr_info.white_point_x;
-       hdr_vinfo->white_point[1] = pconf->hdr_info.white_point_y;
-       hdr_vinfo->luminance[0] = pconf->hdr_info.luma_max;
-       hdr_vinfo->luminance[1] = pconf->hdr_info.luma_min;
-
-       lcd_drv->lcd_info->hdr_info.lumi_max = pconf->hdr_info.luma_max;
+       disp_vinfo = &lcd_drv->lcd_info->master_display_info;
+       disp_vinfo->present_flag = 1; /* valid parameters */
+       disp_vinfo->features = pconf->optical_info.features;
+       disp_vinfo->primaries[0][0] = pconf->optical_info.primaries_g_x;
+       disp_vinfo->primaries[0][1] = pconf->optical_info.primaries_g_y;
+       disp_vinfo->primaries[1][0] = pconf->optical_info.primaries_b_x;
+       disp_vinfo->primaries[1][1] = pconf->optical_info.primaries_b_y;
+       disp_vinfo->primaries[2][0] = pconf->optical_info.primaries_r_x;
+       disp_vinfo->primaries[2][1] = pconf->optical_info.primaries_r_y;
+       disp_vinfo->white_point[0] = pconf->optical_info.white_point_x;
+       disp_vinfo->white_point[1] = pconf->optical_info.white_point_y;
+       disp_vinfo->luminance[0] = pconf->optical_info.luma_max;
+       disp_vinfo->luminance[1] = pconf->optical_info.luma_min;
+
+       lcd_drv->lcd_info->hdr_info.lumi_max = pconf->optical_info.luma_max;
 }
 
 void lcd_timing_init_config(struct lcd_config_s *pconf)
index 9eda786..32c2224 100644 (file)
@@ -91,7 +91,7 @@ extern int lcd_power_load_from_dts(struct lcd_config_s *pconf,
 extern int lcd_power_load_from_unifykey(struct lcd_config_s *pconf,
                unsigned char *buf, int key_len, int len);
 
-extern void lcd_hdr_vinfo_update(void);
+extern void lcd_optical_vinfo_update(void);
 extern void lcd_timing_init_config(struct lcd_config_s *pconf);
 extern int lcd_vmode_change(struct lcd_config_s *pconf);
 extern void lcd_venc_change(struct lcd_config_s *pconf);
index d488117..2711e3f 100644 (file)
@@ -935,7 +935,7 @@ static int lcd_reg_print(char *buf, int offset)
        return len;
 }
 
-static int lcd_hdr_info_print(char *buf, int offset)
+static int lcd_optical_info_print(char *buf, int offset)
 {
        struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver();
        struct lcd_config_s *pconf;
@@ -944,7 +944,7 @@ static int lcd_hdr_info_print(char *buf, int offset)
        pconf = lcd_drv->lcd_config;
        n = lcd_debug_info_len(len + offset);
        len += snprintf((buf+len), n,
-               "\nlcd hdr info:\n"
+               "\nlcd optical info:\n"
                "hdr_support          %d\n"
                "features             %d\n"
                "primaries_r_x        %d\n"
@@ -957,12 +957,18 @@ static int lcd_hdr_info_print(char *buf, int offset)
                "white_point_y        %d\n"
                "luma_max             %d\n"
                "luma_min             %d\n\n",
-               pconf->hdr_info.hdr_support, pconf->hdr_info.features,
-               pconf->hdr_info.primaries_r_x, pconf->hdr_info.primaries_r_y,
-               pconf->hdr_info.primaries_g_x, pconf->hdr_info.primaries_g_y,
-               pconf->hdr_info.primaries_b_x, pconf->hdr_info.primaries_b_y,
-               pconf->hdr_info.white_point_x, pconf->hdr_info.white_point_y,
-               pconf->hdr_info.luma_max, pconf->hdr_info.luma_min);
+               pconf->optical_info.hdr_support,
+               pconf->optical_info.features,
+               pconf->optical_info.primaries_r_x,
+               pconf->optical_info.primaries_r_y,
+               pconf->optical_info.primaries_g_x,
+               pconf->optical_info.primaries_g_y,
+               pconf->optical_info.primaries_b_x,
+               pconf->optical_info.primaries_b_y,
+               pconf->optical_info.white_point_x,
+               pconf->optical_info.white_point_y,
+               pconf->optical_info.luma_max,
+               pconf->optical_info.luma_min);
 
        return len;
 }
@@ -1352,7 +1358,7 @@ static ssize_t lcd_debug_store(struct class *class,
                lcd_reg_print(print_buf, 0);
                lcd_debug_info_print(print_buf);
                memset(print_buf, 0, PR_BUF_MAX);
-               lcd_hdr_info_print(print_buf, 0);
+               lcd_optical_info_print(print_buf, 0);
                lcd_debug_info_print(print_buf);
                kfree(print_buf);
                break;
@@ -1368,7 +1374,7 @@ static ssize_t lcd_debug_store(struct class *class,
                        LCDERR("%s: buf malloc error\n", __func__);
                        return -EINVAL;
                }
-               lcd_hdr_info_print(print_buf, 0);
+               lcd_optical_info_print(print_buf, 0);
                lcd_debug_info_print(print_buf);
                kfree(print_buf);
                break;
@@ -2255,7 +2261,7 @@ static ssize_t lcd_debug_dump_show(struct class *class,
                lcd_reg_print(print_buf, 0);
                break;
        case LCD_DEBUG_DUMP_HDR:
-               lcd_hdr_info_print(print_buf, 0);
+               lcd_optical_info_print(print_buf, 0);
                break;
        default:
                sprintf(print_buf, "%s: invalid command\n", __func__);
index b2e2cbc..0b54e2d 100644 (file)
@@ -456,7 +456,7 @@ static void lcd_tablet_vinfo_update(void)
                        break;
                }
 
-               lcd_hdr_vinfo_update();
+               lcd_optical_vinfo_update();
        }
 }
 
index a357a30..4b9e40d 100644 (file)
@@ -260,7 +260,7 @@ static void lcd_vmode_vinfo_update(enum vmode_e mode)
                break;
        }
 
-       lcd_hdr_vinfo_update();
+       lcd_optical_vinfo_update();
 }
 
 /* ************************************************** *
index 9d95b9d..6ae3f95 100644 (file)
@@ -169,7 +169,7 @@ static struct lcd_config_s lcd_config_dft = {
                .ss_level = 0,
                .fr_adjust_type = 0,
        },
-       .hdr_info = {
+       .optical_info = {
                .hdr_support = 0,
                .features = 0,
                .primaries_r_x = 0,
@@ -666,8 +666,9 @@ static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        int ret = 0;
        void __user *argp;
        int mcd_nr;
-       struct lcd_hdr_info_s *hdr_info = &lcd_driver->lcd_config->hdr_info;
+       struct lcd_optical_info_s *opt_info;
 
+       opt_info = &lcd_driver->lcd_config->optical_info;
        mcd_nr = _IOC_NR(cmd);
        LCDPR("%s: cmd_dir = 0x%x, cmd_nr = 0x%x\n",
                __func__, _IOC_DIR(cmd), mcd_nr);
@@ -675,17 +676,19 @@ static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        argp = (void __user *)arg;
        switch (mcd_nr) {
        case LCD_IOC_NR_GET_HDR_INFO:
-               if (copy_to_user(argp, hdr_info, sizeof(struct lcd_hdr_info_s)))
+               if (copy_to_user(argp, opt_info,
+                       sizeof(struct lcd_optical_info_s))) {
                        ret = -EFAULT;
+               }
                break;
        case LCD_IOC_NR_SET_HDR_INFO:
-               if (copy_from_user(hdr_info, argp,
-                       sizeof(struct lcd_hdr_info_s))) {
+               if (copy_from_user(opt_info, argp,
+                       sizeof(struct lcd_optical_info_s))) {
                        ret = -EFAULT;
                } else {
-                       lcd_hdr_vinfo_update();
+                       lcd_optical_vinfo_update();
                        if (lcd_debug_print_flag) {
-                               LCDPR("set hdr_info:\n"
+                               LCDPR("set optical info:\n"
                                        "hdr_support          %d\n"
                                        "features             %d\n"
                                        "primaries_r_x        %d\n"
@@ -698,18 +701,18 @@ static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                                        "white_point_y        %d\n"
                                        "luma_max             %d\n"
                                        "luma_min             %d\n\n",
-                                       hdr_info->hdr_support,
-                                       hdr_info->features,
-                                       hdr_info->primaries_r_x,
-                                       hdr_info->primaries_r_y,
-                                       hdr_info->primaries_g_x,
-                                       hdr_info->primaries_g_y,
-                                       hdr_info->primaries_b_x,
-                                       hdr_info->primaries_b_y,
-                                       hdr_info->white_point_x,
-                                       hdr_info->white_point_y,
-                                       hdr_info->luma_max,
-                                       hdr_info->luma_min);
+                                       opt_info->hdr_support,
+                                       opt_info->features,
+                                       opt_info->primaries_r_x,
+                                       opt_info->primaries_r_y,
+                                       opt_info->primaries_g_x,
+                                       opt_info->primaries_g_y,
+                                       opt_info->primaries_b_x,
+                                       opt_info->primaries_b_y,
+                                       opt_info->white_point_x,
+                                       opt_info->white_point_y,
+                                       opt_info->luma_max,
+                                       opt_info->luma_min);
                        }
                }
                break;
index 7a75f18..9837b1e 100644 (file)
@@ -173,7 +173,7 @@ struct lcd_timing_s {
  * HDR info define
  * **********************************
  */
-struct lcd_hdr_info_s {
+struct lcd_optical_info_s {
        unsigned int hdr_support;
        unsigned int features;
        unsigned int primaries_r_x;
@@ -387,7 +387,7 @@ struct lcd_config_s {
        unsigned int extern_index;
        struct lcd_basic_s lcd_basic;
        struct lcd_timing_s lcd_timing;
-       struct lcd_hdr_info_s hdr_info;
+       struct lcd_optical_info_s optical_info;
        struct lcd_control_config_s lcd_control;
        struct lcd_power_ctrl_s *lcd_power;
        struct pinctrl *pin;
@@ -476,8 +476,8 @@ extern struct aml_lcd_drv_s *aml_lcd_get_driver(void);
 #define LCD_IOC_NR_SET_HDR_INFO    0x1
 
 #define LCD_IOC_CMD_GET_HDR_INFO   \
-       _IOR(LCD_IOC_TYPE, LCD_IOC_NR_GET_HDR_INFO, struct lcd_hdr_info_s)
+       _IOR(LCD_IOC_TYPE, LCD_IOC_NR_GET_HDR_INFO, struct lcd_optical_info_s)
 #define LCD_IOC_CMD_SET_HDR_INFO   \
-       _IOW(LCD_IOC_TYPE, LCD_IOC_NR_SET_HDR_INFO, struct lcd_hdr_info_s)
+       _IOW(LCD_IOC_TYPE, LCD_IOC_NR_SET_HDR_INFO, struct lcd_optical_info_s)
 
 #endif