From patchwork Thu May 16 17:33:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 13666417 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 276CBC25B74 for ; Thu, 16 May 2024 17:33:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C18810E3B5; Thu, 16 May 2024 17:33:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="mOaLFM3Y"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E7F610E3B5; Thu, 16 May 2024 17:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715880809; x=1747416809; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=IOeEh7kRfRKtlnqKWfmYj0750ClwuhWw8RQ+Q/sQk2g=; b=mOaLFM3YjqwUER1s6VE4G8aYoWpf4BT6mi/oFXiA675Ta/iG6NkpR07N HU1VK7nQ1yYXzH8ZgaylvtEhKNP4Ss0Gc1ioJrQNEq4INn1T2RgIt4zMC lV+amjreKcPfcpo5JGGM/qSIXXGgiqWLA71A+QrwgCgRUb8T0rU5AVbfC /2PBHBPDar0XfsON/2yOI6rnaZc3dOnb1fqRl87HABCpmPAbjFaWWMGyx WAN4BkycaeMa43niGTMfkR/UYFZBpSsEATK8Ago0LszdpG9KcOnxjQrLZ YlE5w0ghtcWsZUFf8jAjb4o+0KnMLJ2V+UkUUXaZ3XWWTK+cP3Yl665T0 w==; X-CSE-ConnectionGUID: 6MC1eNBySAmxQPNhfENRVw== X-CSE-MsgGUID: 9lRH4SVTTfiB3si9ZldoyQ== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="29517753" X-IronPort-AV: E=Sophos;i="6.08,165,1712646000"; d="scan'208";a="29517753" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2024 10:33:28 -0700 X-CSE-ConnectionGUID: DOei1TphQAeqg2T3nrzenA== X-CSE-MsgGUID: /yPbzQicTPeQSd+YypkeiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,165,1712646000"; d="scan'208";a="31512477" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 16 May 2024 10:33:25 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 16 May 2024 20:33:24 +0300 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org Subject: [PATCH] drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid() Date: Thu, 16 May 2024 20:33:24 +0300 Message-ID: <20240516173324.18149-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.44.1 MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä 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ä Reviewed-by: Daniel Vetter --- 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;