]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/edid: check for HF-SCDB block
authorLee Shawn C <shawn.c.lee@intel.com>
Tue, 3 May 2022 09:23:47 +0000 (12:23 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 5 May 2022 17:16:35 +0000 (20:16 +0300)
Find HF-SCDB information in CEA extensions block. And retrieve
Max_TMDS_Character_Rate that support by sink device.

v2: HF-SCDB and HF-VSDBS carry the same SCDS data. Reuse
    drm_parse_hdmi_forum_vsdb() to parse this packet.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2bf7110cdb56d5dda311480787faf472c9802de4.1651569697.git.jani.nikula@intel.com
drivers/gpu/drm/drm_edid.c

index 1dea0e2f0cabb2b8b532be1fc418d62d259ebb7e..fe527a0c50bc57515a863f41ad090e27ac7e2ed8 100644 (file)
@@ -3471,6 +3471,7 @@ add_detailed_modes(struct drm_connector *connector, const struct edid *edid,
 #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
 #define EXT_VIDEO_DATA_BLOCK_420       0x0E
 #define EXT_VIDEO_CAP_BLOCK_Y420CMDB 0x0F
+#define EXT_VIDEO_HF_SCDB_DATA_BLOCK   0x79
 #define EDID_BASIC_AUDIO       (1 << 6)
 #define EDID_CEA_YCRCB444      (1 << 5)
 #define EDID_CEA_YCRCB422      (1 << 4)
@@ -4402,6 +4403,20 @@ static bool cea_db_is_vcdb(const u8 *db)
        return true;
 }
 
+static bool cea_db_is_hdmi_forum_scdb(const u8 *db)
+{
+       if (cea_db_tag(db) != USE_EXTENDED_TAG)
+               return false;
+
+       if (cea_db_payload_len(db) < 7)
+               return false;
+
+       if (cea_db_extended_tag(db) != EXT_VIDEO_HF_SCDB_DATA_BLOCK)
+               return false;
+
+       return true;
+}
+
 static bool cea_db_is_y420cmdb(const u8 *db)
 {
        if (cea_db_tag(db) != USE_EXTENDED_TAG)
@@ -5363,7 +5378,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 
                if (cea_db_is_hdmi_vsdb(db))
                        drm_parse_hdmi_vsdb_video(connector, db);
-               if (cea_db_is_hdmi_forum_vsdb(db))
+               if (cea_db_is_hdmi_forum_vsdb(db) ||
+                   cea_db_is_hdmi_forum_scdb(db))
                        drm_parse_hdmi_forum_vsdb(connector, db);
                if (cea_db_is_microsoft_vsdb(db))
                        drm_parse_microsoft_vsdb(connector, db);