[PATCH v4] drm/edid: ignore the CEA modes not defined in CEA-861-D

Jani Nikula jani.nikula at linux.intel.com
Wed Jan 4 10:25:55 UTC 2023


On Tue, 06 Dec 2022, "Tseng, William" <william.tseng at intel.com> wrote:
> Hi Jani
>
> May I have your comment about this patch?
> BTW, this is the link to the binary EDID,  https://gitlab.freedesktop.org/drm/intel/-/issues/6153#note_1558419.
> Thank you.

I must admit I didn't initially understand what the root cause here was.

I was looking at this again in the context of other EDID parsing
changes, and took the liberty of fixing this in a slightly different,
and more compact, way [1].

Later in the same series, I also opt to send the actual VIC in the AVI
infoframe if the sink lists the VIC in the CTA VDB [2].

Testing of [1] would be appreciated, and if it isn't too much trouble,
also patches 1-5 in the series to see if [2] is a reasonable choice.

Thanks,
Jani.


[1] https://patchwork.freedesktop.org/patch/msgid/c3e78cc6d01ed237f71ad0038826b08d83d75eef.1672826282.git.jani.nikula@intel.com
[2] https://patchwork.freedesktop.org/patch/msgid/775124fd07a5b7892e869becc3dd8dadb328ae5f.1672826282.git.jani.nikula@intel.com


>
>
> Regards
> William
>
> -----Original Message-----
> From: Tseng, William 
> Sent: Tuesday, September 20, 2022 4:23 PM
> To: Jani Nikula <jani.nikula at linux.intel.com>; dri-devel at lists.freedesktop.org
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>; Wayne Lin <waynelin at amd.com>; Lee, Shawn C <shawn.c.lee at intel.com>
> Subject: RE: [PATCH v4] drm/edid: ignore the CEA modes not defined in CEA-861-D
>
> For EDID, please refer to the attachment on the link.
> https://gitlab.freedesktop.org/drm/intel/-/issues/6153#note_1558419
>
>
> Regards
> William
>
> -----Original Message-----
> From: Jani Nikula <jani.nikula at linux.intel.com>
> Sent: Tuesday, September 20, 2022 2:49 PM
> To: Tseng, William <william.tseng at intel.com>; dri-devel at lists.freedesktop.org
> Cc: Tseng, William <william.tseng at intel.com>; Ville Syrjälä <ville.syrjala at linux.intel.com>; Wayne Lin <waynelin at amd.com>; Lee, Shawn C <shawn.c.lee at intel.com>
> Subject: Re: [PATCH v4] drm/edid: ignore the CEA modes not defined in CEA-861-D
>
> On Tue, 20 Sep 2022, William Tseng <william.tseng at intel.com> 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 picture 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 picture 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, do not set the vic 0 so the corresponding mode may 
>> be accepted in drm_hdmi_avi_infoframe_from_display_mode() and be dispalyed.
>>
>> v1: initial version.
>> v2: change the logic in drm_hdmi_avi_infoframe_from_display_mode().
>> v3: fix typo.
>> v4: add revision history.
>>
>> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> Cc: Jani Nikula <jani.nikula at linux.intel.com>
>> Cc: Wayne Lin <waynelin at amd.com>
>> Cc: Lee Shawn C <shawn.c.lee at intel.com>
>> Signed-off-by: William Tseng <william.tseng at intel.com>
>
> Please attach the offending EDID to the bug [1]. I won't ack this before we see the EDID in question.
>
>
> BR,
> Jani.
>
>
> [1] https://gitlab.freedesktop.org/drm/intel/-/issues/6153
>
>> ---
>>  drivers/gpu/drm/drm_edid.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c 
>> index eaa819381281..3c6a4e09b2d6 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -6640,7 +6640,8 @@ static u8 drm_mode_hdmi_vic(const struct 
>> drm_connector *connector,  }
>>  
>>  static u8 drm_mode_cea_vic(const struct drm_connector *connector,
>> -			   const struct drm_display_mode *mode)
>> +			   const struct drm_display_mode *mode,
>> +			   bool is_hdmi2_sink)
>>  {
>>  	u8 vic;
>>  
>> @@ -6660,7 +6661,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector,
>>  	 * 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)
>> +	if (!is_hdmi2_sink && vic > 64)
>>  		return 0;
>>  
>>  	return vic;
>> @@ -6691,7 +6692,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
>>  	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
>>  		frame->pixel_repeat = 1;
>>  
>> -	vic = drm_mode_cea_vic(connector, mode);
>> +	vic = drm_mode_cea_vic(connector, mode, true);
>>  	hdmi_vic = drm_mode_hdmi_vic(connector, mode);
>>  
>>  	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -6735,7 +6736,8 
>> @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
>>  		picture_aspect = HDMI_PICTURE_ASPECT_NONE;
>>  	}
>>  
>> -	frame->video_code = vic;
>> +	frame->video_code = drm_mode_cea_vic(connector, mode,
>> +						is_hdmi2_sink(connector));
>>  	frame->picture_aspect = picture_aspect;
>>  	frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
>>  	frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;
>
> --
> Jani Nikula, Intel Open Source Graphics Center

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the dri-devel mailing list