All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tseng, William" <william.tseng@intel.com>
To: "Lin, Wayne" <Wayne.Lin@amd.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Cc: "Lee, Shawn C" <shawn.c.lee@intel.com>
Subject: RE: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA-861-D
Date: Mon, 13 Jun 2022 12:22:38 +0000	[thread overview]
Message-ID: <SJ0PR11MB5894B7FD0621531B552E9593F1AB9@SJ0PR11MB5894.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CO6PR12MB5489D1366E44E62AFE5A104AFCAB9@CO6PR12MB5489.namprd12.prod.outlook.com>

Thanks Wayne for clarifying.
I will correct the typos and submit the patch again.


-----Original Message-----
From: Lin, Wayne <Wayne.Lin@amd.com> 
Sent: Monday, June 13, 2022 3:25 PM
To: Tseng, William <william.tseng@intel.com>; dri-devel@lists.freedesktop.org
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>; Jani Nikula <jani.nikula@linux.intel.com>; Lee, Shawn C <shawn.c.lee@intel.com>
Subject: RE: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA-861-D

[AMD Official Use Only - General]

Thanks William!

After fixing few typos below, feel free to add:

Acked-by: Wayne Lin <Wayne.Lin@amd.com>

> -----Original Message-----
> From: William Tseng <william.tseng@intel.com>
> Sent: Monday, June 13, 2022 12:27 PM
> To: dri-devel@lists.freedesktop.org
> Cc: William Tseng <william.tseng@intel.com>; Ville Syrjälä 
> <ville.syrjala@linux.intel.com>; Jani Nikula 
> <jani.nikula@linux.intel.com>; Lin, Wayne <Wayne.Lin@amd.com>; Lee 
> Shawn C <shawn.c.lee@intel.com>
> Subject: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA- 
> 861-D
> 
> 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

Typo - picture
> 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

Typo - picture
> 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.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Wayne Lin <waynelin@amd.com>
> Cc: Lee Shawn C <shawn.c.lee@intel.com>
> Signed-off-by: William Tseng <william.tseng@intel.com>
> ---
>  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 bc43e1b32092..a4582627ec9d 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -5876,7 +5876,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;
> 
> @@ -5896,7 +5897,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;
> @@ -5927,7 +5928,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; @@ -
> 5971,7 +5972,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;
> --
> 2.17.1

  parent reply	other threads:[~2022-06-13 12:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 10:34 [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D William Tseng
2022-05-31 10:34 ` [Intel-gfx] " William Tseng
2022-05-31 10:56 ` Jani Nikula
2022-05-31 11:06   ` Jani Nikula
2022-06-01  9:43     ` Tseng, William
2022-06-01  9:56       ` Jani Nikula
2022-06-01 10:02         ` Tseng, William
2022-06-01 10:15           ` Jani Nikula
2022-06-01  9:42   ` Tseng, William
2022-05-31 13:55 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/edid: ignore the CEA modes not defined in CEA-861-D (rev2) Patchwork
2022-05-31 16:15 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-05-31 16:42 ` [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D Ville Syrjälä
2022-06-01  9:57   ` Tseng, William
2022-06-13  4:27 ` [PATCH v2] " William Tseng
2022-06-13  7:25   ` Lin, Wayne
2022-06-13  8:05     ` Tseng, William
2022-06-13  8:11       ` Lin, Wayne
2022-06-13 12:22     ` Tseng, William [this message]
2022-06-13 12:26   ` [PATCH v3] " William Tseng
2022-09-20  6:23     ` [PATCH v4] " William Tseng
2022-09-20  6:23       ` [Intel-gfx] " William Tseng
2022-09-20  6:49       ` Jani Nikula
2022-09-20  8:22         ` Tseng, William
2022-12-06  9:53           ` Tseng, William
2023-01-04 10:25             ` Jani Nikula
2022-09-20  7:01 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: ignore the CEA modes not defined in CEA-861-D (rev3) Patchwork
2022-09-20  7:24 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR11MB5894B7FD0621531B552E9593F1AB9@SJ0PR11MB5894.namprd11.prod.outlook.com \
    --to=william.tseng@intel.com \
    --cc=20220613042707.8525-1-william.tseng@intel.com \
    --cc=Wayne.Lin@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=shawn.c.lee@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.