From patchwork Tue May 31 10:34:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: William Tseng X-Patchwork-Id: 12865943 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 84556C433F5 for ; Tue, 31 May 2022 11:05:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC40710F6E2; Tue, 31 May 2022 11:05:19 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9441E10F797 for ; Tue, 31 May 2022 11:05:18 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="361595343" X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="361595343" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 04:05:16 -0700 X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="605619138" Received: from rrudnick-mobl.ger.corp.intel.com (HELO localhost) ([10.249.138.37]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 04:05:15 -0700 Resent-Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Resent-To: intel-gfx@lists.freedesktop.org Resent-From: Jani Nikula Resent-Date: Tue, 31 May 2022 14:05:12 +0300 Resent-Message-ID: <87v8tmq7x3.fsf@intel.com> Received: from linux.intel.com [10.54.29.200] by jnikula-mobl4.ger.corp.intel.com with IMAP (fetchmail-6.4.29) for (single-drop); Tue, 31 May 2022 13:35:08 +0300 (EEST) Received: from fmsmga008.fm.intel.com (fmsmga008.fm.intel.com [10.253.24.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 9B4A9580970; Tue, 31 May 2022 03:35:01 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="632981873" X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="632981873" Received: from fmsmga102.fm.intel.com ([10.1.193.69]) by fmsmga008-1.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 03:35:01 -0700 IronPort-SDR: fU10vS5eKDmNSDc/UFA9n/DCvflFecRsokm6jGEdICD7CTyce+MwnsLEhWVnUG5EWaVYrVoL1o Q2Jb1mp3vbAg== X-IPAS-Result: A0FyAADZ7pVimLHS/INaHgEBCxIMQIFEC4I9AYE8KlaEEj2JAIVogj6cUYFAMxQBAQEBAQEBAQEJLBMBAgQBAQMEikICJTQJDQEBAgQBAQEBAwIBAgEBAQEBAQMBAQECAgEBAQIBAQYCAQEBAQIQAQEBAQEBAQEJCwkHBgwFDhAFIoUvOQ2CNQUCAx8BBm5KCTUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBEAINUkcBIAIEAQEJFwQLAQ0BAQQKKQECAwECBgIIHAIeBAQCAgMBbAWCeIMZBZA2mxh6fzKBAYIIAQEGgl2DLIFcCSRtLIlHhCKBIRCBVUR6G4NogQVOhkeCZZZgOwMJBgcFMzUSgSFxAQgGBgcKBTIGAgwYFAQCExFTCxICEwwKHA4ORhkMDwMSAxEBBwILEggVLAgDAgMIAwIDIwsCAxgJBwoDHQgKHBIQFAIEEx8LCAMaHy0JAgQOA0MICwoDEQQDExgLFggQBAYDCS8NKAsDFA8BBgMGAgUFAQMgAxQDBScHAyEHCyYNDQQjHQMDBS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KlViBWQlH4z1rIpKbPWeJgtgMGUgDeLBh7InZ4Fh2a9Sk4/g7 HGwXF5F13L7hHvaOUOLbGxubPXkWpMXkJ4gFSMlN1vu1WIubIqi96QDcINxeqMonAB+8RJqZ 6IcVeO6I+pDdhrO+jQmXL/Atdw5WAv+0GpiIBGZSDQ4epdhQSnA9dnlYhbj+UEyM8aniScti +H9ilODHfLvUywnVZyMNaL+ljtdqFBEwIpPs130zs6/kakG2LBtMTD1h/k7Sy3nAUScnGPEv +p67PFxmAUgi4A8+tSPi7qJooukCOhiGVIcGHPUhVpXCcU41jXzqWOjeL/WFdw4aI8S0Pj/D Qmy56yhWMDrZH4Q7+JB/09DlMrSHefHqb5A1RhDF37WdVmtAb4ICiDYgJIe7fAQnuAF5Ffet qezFj9yZOjh1CTNTQN5GebZRr3rOQw8xGSPtqpdzLvSvXculFZ4bamiF0DQ130MddOZwas9x v09vMcQ50SklhM2P56biCFK+n6XL2ARO5jLRblEaLIHfjEDkwkYCbSFU3eeyMjWN71kbxd2S hfJ2vuqr+kMlyLqLitofVCQjLU1rcpV4nhikgRdT2llb/KY3JfbKjULr2RuJumUpz0au99O1 p9DbBYtfP/SpGsy2aCunQmEQml8OfFQwWSpo3NhqYETZxTAurDlRIH2BQpBEI31PY6Rkvi3M Yx0EFrYbAs= IronPort-HdrOrdr: A9a23:BIlOMaCTfhKbGZHlHelH55DYdb4zR+YMi2TDGXoBPiC9Ffbo6v xG/c5rryMc7Qx/ZJhOo6HnBEDrex7hHKBOkP8s1NuZLWzbUIXBFvAQ0WPNqweQbhEW3NQtpJ uJSsBFea/N5bITt7eP3ODAKadR/DDlytHSuQ6h9QYVcegwUdAf0+4RMG/yeSEXNWt77LUCZd OhD6F81l2dkBosH6CG7rhsZZm+mzTMrvyGEH077mYcmXGzZbzB0s+EL/H05H0jbw8= X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="272785649" X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="272785649" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from gabe.freedesktop.org ([131.252.210.177]) by mtab.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 03:35:00 -0700 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B98C2112281; Tue, 31 May 2022 10:34:28 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0B70112281 for ; Tue, 31 May 2022 10:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653993266; x=1685529266; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=3YpK8LtcPE0677n75/BRy4Ia8657/+94hBHBaUlN9TY=; b=LuB4oSFmuqpnv8qwCmU/5ycl2236Fc9jao4QIxwUhxBvAx69vx81mz+m jYwA4NKv2ha7WiL7qBzcNHLjzxQuIh13qnqwouO9WgJSHEsFt1i0TpAyh ItjJLfcRBZ9kDKBLASFbJyt5XEClv+kHdCt65vrCkpUNzjKgh3dC5S1Ml 4dCcHMdplWzs2k+inXdYC4wYnrV9FnXnmjzCMRvYwvLjD5XLZ1Anjx50L bb60/Fg7rWxSb/pqqRcuyaRpJFh/52opbnvT4pHvNIoGXHfdpnt85VfwF X7DVsHs2G+Ijc0qjk+B2EYOU796/eYHtCLIUJ2iSu0iHe/XdNuXXbQ96L g==; X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="335873662" X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="335873662" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 03:34:26 -0700 X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="605606218" Received: from tsengwil-desk1.itwn.intel.com (HELO gar) ([10.5.231.22]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 03:34:25 -0700 From: William Tseng To: dri-devel@lists.freedesktop.org Date: Tue, 31 May 2022 18:34:21 +0800 Message-Id: <20220531103421.11363-1-william.tseng@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list Subject: [Intel-gfx] [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D X-BeenThere: intel-gfx@lists.freedesktop.org List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wayne Lin , William Tseng Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D. As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic(). To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed. Cc: Ville Syrjälä Cc: Wayne Lin Cc: Lee Shawn C Signed-off-by: William Tseng --- drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic); +static bool is_hdmi2_sink(const struct drm_connector *connector) +{ + /* + * FIXME: sil-sii8620 doesn't have a connector around when + * we need one, so we have to be prepared for a NULL connector. + */ + if (!connector) + return true; + + return connector->display_info.hdmi.scdc.supported || + connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420; +} + static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) { + u8 vic = svd_to_vic(db[i]); + + if (!drm_valid_cea_vic(vic)) + continue; + + /* + * HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but + * HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we + * have to make sure we dont break HDMI 1.4 sinks. + */ + if (!is_hdmi2_sink(connector) && vic > 64) + continue; + /* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which @@ -5846,19 +5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode); -static bool is_hdmi2_sink(const struct drm_connector *connector) -{ - /* - * FIXME: sil-sii8620 doesn't have a connector around when - * we need one, so we have to be prepared for a NULL connector. - */ - if (!connector) - return true; - - return connector->display_info.hdmi.scdc.supported || - connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420; -} - static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {