tegra: dc :hdmi: Add CEA 861.3 support
Arun Swain [Tue, 15 Sep 2015 03:47:17 +0000 (20:47 -0700)]
Add support for reading CEA 861.3 HDR related
info from edid.

Due to lack of floating point support, it is
expected that user space to actually makes sense
of the numbers by following the specs. Kernel
just reads the values as it is from the edid.

Bug 200122117

Change-Id: I91bfe3b92cd8937cb862e8a38f790b89903d90f4
Reviewed-on: http://git-master/r/802449
(cherry picked from commit 39c2e727a24b929fff96df05ef5e032105df44c2)
Signed-off-by: Arun Swain <arswain@nvidia.com>
Reviewed-on: http://git-master/r/821184
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mitch Luban <mluban@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/video/tegra/dc/edid.c
drivers/video/tegra/dc/edid.h

index 2ab67fb..c0ffb3f 100644 (file)
@@ -45,6 +45,13 @@ struct tegra_edid_pvt {
        u16                     max_tmds_char_rate_hllc_mhz;
        u16                     colorimetry;
        u16                     min_vrr_fps;
+       bool                    hdr_present;
+       u8                      hdr_pckt_len;
+       u8                      hdr_eotf;
+       u8                      hdr_static_metadata;
+       u16                     hdr_desired_max_luma;
+       u16                     hdr_desired_max_frame_avg_luma;
+       u16                     hdr_desired_min_luma;
        /* Note: dc_edid must remain the last member */
        struct tegra_dc_edid            dc_edid;
 };
@@ -424,6 +431,23 @@ static int tegra_edid_parse_ext_block(const u8 *raw, int idx,
                        case CEA_DATA_BLOCK_EXT_CDB:
                                edid->colorimetry = ptr[2];
                                break;
+                       case CEA_DATA_BLOCK_EXT_HDR:
+                               edid->hdr_pckt_len = ptr[0] & 0x0f;
+                               edid->hdr_present = true;
+                               edid->hdr_eotf = ptr[2];
+                               edid->hdr_static_metadata = ptr[3];
+                               if (edid->hdr_pckt_len > 5) {
+                                       edid->hdr_desired_max_luma = ptr[4];
+                                       edid->hdr_desired_max_frame_avg_luma =
+                                                                       ptr[5];
+                                       edid->hdr_desired_min_luma = ptr[6];
+                               } else if (edid->hdr_pckt_len > 4) {
+                                       edid->hdr_desired_max_luma = ptr[4];
+                                       edid->hdr_desired_max_frame_avg_luma =
+                                                                       ptr[5];
+                               } else
+                                       edid->hdr_desired_max_luma = ptr[4];
+                               break;
                        };
 
                        len++;
index 4c01496..7daedac 100644 (file)
@@ -54,7 +54,8 @@ enum {
        CEA_DATA_BLOCK_EXT_VESA_VTBE = 3, /* VESA video timing block ext */
        CEA_DATA_BLOCK_EXT_HDMI_VDB = 4, /* rsvd for HDMI video data block */
        CEA_DATA_BLOCK_EXT_CDB = 5, /* colorimetry data block */
-       /* 6-12 rsvd for other video related blocks */
+       CEA_DATA_BLOCK_EXT_HDR = 6, /* HDR data block */
+       /* 7-12 rsvd for other video related blocks */
        CEA_DATA_BLOCK_EXT_VFPDB = 13, /* video format preference data block */
        CEA_DATA_BLOCK_EXT_Y420VDB = 14, /* YCbCr 4:2:0 video data block */
        CEA_DATA_BLOCK_EXT_Y420CMDB = 15, /* YCbCr 4:2:0 cap map data block */