From mboxrd@z Thu Jan 1 00:00:00 1970 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 CD6E0C433EF for ; Tue, 31 May 2022 15:00:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41A6910F384; Tue, 31 May 2022 15:00:11 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 689FC10F378 for ; Tue, 31 May 2022 15:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654009209; x=1685545209; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=zePdRt06r/YYFFQbRu6abQns04bDKxGMa7oVHG16MXo=; b=XD6El5ONrofHMpzmSEc5uvV020AOOTH+v89K8zl73E8kI+uedQF1zScj QWjZm6RQ+u3DYfVKLLntlVNoUdEijJ80rY/6bJb8xTdmLWZ/vb25KJpDS ecwf1XZijb0mPUG/dYQ9dZBhak4w98oL0JCo0rssSeSQAEfBmTg6Q9UVs /ERFa1ULBnfb2CpZ6ALlk56DZ0ZsaS4gDctAH/oGVLc4ZohDhg+dhvwBK 5ofbfu9Y2avE+8QJSUJJacgRBuyY0Y9X1zNzFZioRNrqKAj2jEh1bxuWF DxXjkLa9X6r+NuvlhIOijU7EDjSUkEYKMvIVZewMx1YRWvp0aaHM2cHmf w==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="272846470" X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="272846470" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 08:00:08 -0700 X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="755062538" Received: from ahajda-mobl.ger.corp.intel.com (HELO [10.213.13.84]) ([10.213.13.84]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 08:00:05 -0700 Message-ID: Date: Tue, 31 May 2022 17:00:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.9.1 Content-Language: en-US To: William Tseng , intel-gfx@lists.freedesktop.org References: <20220531101322.26757-1-william.tseng@intel.com> From: Andrzej Hajda Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 In-Reply-To: <20220531101322.26757-1-william.tseng@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D 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: Wayne Lin Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 31.05.2022 12:13, William Tseng wrote: > 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; It duplicates check from drm_display_mode_from_vic_index > + > + /* > + * 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; So maybe adding this check to drm_display_mode_from_vic_index would be enough? Regards Andrzej > + > /* > * 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) > {