From: Ville Syrjälä Date: Thu, 16 May 2024 17:33:24 +0000 (+0300) Subject: drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid() X-Git-Tag: v6.11-rc1~141^2~24^2~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a856a53de93ef25e44b315fc1aedce609ba2d453;p=thirdparty%2Fkernel%2Flinux.git drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid() 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ä Link: https://patchwork.freedesktop.org/patch/msgid/20240516173324.18149-1-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 4f75a1cfd820f..249c8c2cb3192 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;