]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
tegra: dc :hdmi: Add CEA 861.3 support
authorArun Swain <arswain@nvidia.com>
Tue, 15 Sep 2015 03:47:17 +0000 (20:47 -0700)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 23 Oct 2015 01:51:00 +0000 (18:51 -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 2ab67fbdc13fca503b5045304b30fed789020185..c0ffb3f3a0db1649943b78addcf7f0617a61c1c4 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 4c014969a38bb17a560013bff852f015f29426d8..7daedacdda101aef5368ef10c6cad4df82d73764 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 */