From patchwork Sun Mar 13 13:47:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lee, Shawn C" X-Patchwork-Id: 12779263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75C36C433F5 for ; Sun, 13 Mar 2022 13:33:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E3F610E1B7; Sun, 13 Mar 2022 13:33:24 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D53510E1B7; Sun, 13 Mar 2022 13:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647178400; x=1678714400; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=KvMI83gqySb7VlbWAXFc/Dxw353ibpKGtC6Vg3lxMew=; b=SxH461XJQSp2PuBZimX4eIlQS7KyxAvvLcoaK/n41giLgZdDfrVQOxL/ l7jOCqE3AfMmC6s1F7SiOTjUui93Ol5YvCFvcsaaPvhymSWyB2GeGnMrA ToYzTYVe6BS0/AbDEqk3SrTFXVFnPySKrE0COsgmAk1XoTN4/IhmXQnCf kJ88uDy4D1Y901C80x6W+DRYWw3mpXVuRDZBmi7FNP/HbHeW6mgKFtqfw C9IE+jL5PKhLKku8j/1RecEpxrX22Oe/RtWAtgJFM35zCAV387uTGE2oj LZ8YWJqDNDIQpVKoHzsxfUYEhac2Ixmqvv9za49AvTP4zV0KR95bmLz4M w==; X-IronPort-AV: E=McAfee;i="6200,9189,10284"; a="255600702" X-IronPort-AV: E=Sophos;i="5.90,178,1643702400"; d="scan'208";a="255600702" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2022 06:33:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,178,1643702400"; d="scan'208";a="515101490" Received: from shawnle1-build-machine.itwn.intel.com ([10.5.253.78]) by orsmga006.jf.intel.com with ESMTP; 13 Mar 2022 06:33:18 -0700 From: Lee Shawn C To: dri-devel@lists.freedesktop.org Date: Sun, 13 Mar 2022 21:47:02 +0800 Message-Id: <20220313134702.24175-6-shawn.c.lee@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220313134702.24175-1-shawn.c.lee@intel.com> References: <20220313134702.24175-1-shawn.c.lee@intel.com> Subject: [Intel-gfx] [v7 5/5] drm/edid: check for HF-SCDB block X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jani.nikula@intel.com, intel-gfx@lists.freedesktop.org, Drew Davenport Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 Cc: Ville Syrjala Cc: Ankit Nautiyal Cc: Drew Davenport Cc: intel-gfx Signed-off-by: Lee Shawn C --- drivers/gpu/drm/drm_edid.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 5de85ba20bdf..351a729bddb6 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3350,6 +3350,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid, #define EXT_VIDEO_DATA_BLOCK_420 0x0E #define EXT_VIDEO_CAP_BLOCK_Y420CMDB 0x0F #define EXT_VIDEO_HF_EEODB_DATA_BLOCK 0x78 +#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) @@ -4287,6 +4288,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) @@ -5312,7 +5327,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);