Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid()
Date: Tue, 21 May 2024 14:09:19 +0200	[thread overview]
Message-ID: <ZkyO7ybX-pdDiWMR@phenom.ffwll.local> (raw)
In-Reply-To: <20240516173324.18149-1-ville.syrjala@linux.intel.com>

On Thu, May 16, 2024 at 08:33:24PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Make life easier for drivers by filtering out unwanted YCbCr 4:2:0
> only modes prior to calling the connector->mode_valid() hook.
> Currently drivers will still see YCbCr 4:2:0 only modes in said
> hook, which will likely come as a suprise when the driver has
> declared no support for such modes (via setting
> connector->ycbcr_420_allowed to false).
> 
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10992
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Sounds reasonable.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/drm_probe_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index 4f75a1cfd820..249c8c2cb319 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -474,6 +474,10 @@ static int __drm_helper_update_and_validate(struct drm_connector *connector,
>  		if (mode->status != MODE_OK)
>  			continue;
>  
> +		mode->status = drm_mode_validate_ycbcr420(mode, connector);
> +		if (mode->status != MODE_OK)
> +			continue;
> +
>  		ret = drm_mode_validate_pipeline(mode, connector, ctx,
>  						 &mode->status);
>  		if (ret) {
> @@ -486,10 +490,6 @@ static int __drm_helper_update_and_validate(struct drm_connector *connector,
>  			else
>  				return -EDEADLK;
>  		}
> -
> -		if (mode->status != MODE_OK)
> -			continue;
> -		mode->status = drm_mode_validate_ycbcr420(mode, connector);
>  	}
>  
>  	return 0;
> -- 
> 2.44.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  parent reply	other threads:[~2024-05-21 12:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 17:33 [PATCH] drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid() Ville Syrjala
2024-05-16 20:00 ` ✗ Fi.CI.BAT: failure for " Patchwork
2024-05-16 21:43 ` ✗ Fi.CI.BAT: failure for drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid() (rev2) Patchwork
2024-05-17  1:37 ` ✓ Fi.CI.BAT: success for drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid() (rev3) Patchwork
2024-05-17 10:30 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-05-21 12:09 ` Daniel Vetter [this message]
2024-05-21 19:09   ` [PATCH] drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid() Ville Syrjälä

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=ZkyO7ybX-pdDiWMR@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox