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)
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);
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;
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"
"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;
}
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;
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;
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__);
break;
}
- lcd_hdr_vinfo_update();
+ lcd_optical_vinfo_update();
}
}
break;
}
- lcd_hdr_vinfo_update();
+ lcd_optical_vinfo_update();
}
/* ************************************************** *
.ss_level = 0,
.fr_adjust_type = 0,
},
- .hdr_info = {
+ .optical_info = {
.hdr_support = 0,
.features = 0,
.primaries_r_x = 0,
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);
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"
"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;
* 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;
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;
#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