summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-28 08:41:57 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-28 08:41:56 -0800
commit958e36a73f7fe46ee28a749cd9b56ddf5dbf56cd (patch)
tree66156c934cdbf30127c094d7d8c0451d8d64a1aa
parentd7b12827abd0f48a423b80ff78d061da326cd949 (diff)
parent19a9088e54e8799d66a6fc4a757a85e8c102a9df (diff)
Merge "msm: mdss: expose HDR information to panel sys node"
-rw-r--r--drivers/video/fbdev/msm/mdss_fb.c5
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_tx.c26
-rw-r--r--drivers/video/fbdev/msm/mdss_panel.h2
3 files changed, 31 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c
index cb0fcbafb8b4..a183fd7cd247 100644
--- a/drivers/video/fbdev/msm/mdss_fb.c
+++ b/drivers/video/fbdev/msm/mdss_fb.c
@@ -589,8 +589,8 @@ static ssize_t mdss_fb_get_panel_info(struct device *dev,
"primary_panel=%d\nis_pluggable=%d\ndisplay_id=%s\n"
"is_cec_supported=%d\nis_pingpong_split=%d\n"
"dfps_porch_mode=%d\npu_roi_cnt=%d\ndual_dsi=%d\n"
- "is_hdr_enabled=%d\n"
- "peak_brightness=%d\nblackness_level=%d\n"
+ "is_hdr_enabled=%d\npeak_brightness=%d\n"
+ "blackness_level=%d\naverage_brightness=%d\n"
"white_chromaticity_x=%d\nwhite_chromaticity_y=%d\n"
"red_chromaticity_x=%d\nred_chromaticity_y=%d\n"
"green_chromaticity_x=%d\ngreen_chromaticity_y=%d\n"
@@ -612,6 +612,7 @@ static ssize_t mdss_fb_get_panel_info(struct device *dev,
is_panel_split(mfd), pinfo->hdr_properties.hdr_enabled,
pinfo->hdr_properties.peak_brightness,
pinfo->hdr_properties.blackness_level,
+ pinfo->hdr_properties.avg_brightness,
pinfo->hdr_properties.display_primaries[0],
pinfo->hdr_properties.display_primaries[1],
pinfo->hdr_properties.display_primaries[2],
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
index 04c7ec326a47..abc56f5f352d 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
@@ -2332,6 +2332,31 @@ static void hdmi_tx_update_deep_color(struct hdmi_tx_ctrl *hdmi_ctrl)
}
}
+static void hdmi_tx_update_hdr_info(struct hdmi_tx_ctrl *hdmi_ctrl)
+{
+ struct mdss_panel_info *pinfo = &hdmi_ctrl->panel_data.panel_info;
+ struct mdss_panel_hdr_properties *hdr_prop = &pinfo->hdr_properties;
+ struct hdmi_edid_hdr_data *hdr_data = NULL;
+
+ /* CEA-861.3 4.2 */
+ hdr_prop->hdr_enabled = hdmi_tx_is_hdr_supported(hdmi_ctrl);
+ /* no display primaries in EDID, so skip it */
+ memset(hdr_prop->display_primaries, 0,
+ sizeof(hdr_prop->display_primaries));
+
+ hdmi_edid_get_hdr_data(hdmi_tx_get_fd(HDMI_TX_FEAT_EDID), &hdr_data);
+
+ if (hdr_prop->hdr_enabled) {
+ hdr_prop->peak_brightness = hdr_data->max_luminance * 10000;
+ if (hdr_data->avg_luminance != 0)
+ hdr_prop->avg_brightness = 50 *
+ (BIT(0) << (int)(hdr_data->avg_luminance / 32));
+ hdr_prop->blackness_level = (hdr_data->min_luminance *
+ hdr_data->min_luminance *
+ hdr_data->max_luminance * 100) / 65025;
+ }
+}
+
static void hdmi_tx_hpd_int_work(struct work_struct *work)
{
struct hdmi_tx_ctrl *hdmi_ctrl = NULL;
@@ -2360,6 +2385,7 @@ static void hdmi_tx_hpd_int_work(struct work_struct *work)
if (!retry && rc)
pr_warn_ratelimited("%s: EDID read failed\n", __func__);
hdmi_tx_update_deep_color(hdmi_ctrl);
+ hdmi_tx_update_hdr_info(hdmi_ctrl);
hdmi_tx_send_cable_notification(hdmi_ctrl, true);
} else {
diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h
index 39380c63e6c6..3fc5b2226b3e 100644
--- a/drivers/video/fbdev/msm/mdss_panel.h
+++ b/drivers/video/fbdev/msm/mdss_panel.h
@@ -754,6 +754,8 @@ struct mdss_panel_hdr_properties {
/* peak brightness supported by panel */
u32 peak_brightness;
+ /* average brightness supported by panel */
+ u32 avg_brightness;
/* Blackness level supported by panel */
u32 blackness_level;
};