From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77C4A2C21E8 for ; Thu, 2 Jul 2026 08:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782980299; cv=pass; b=p/Ayo3U8tOsKXhk1svUAkzxMsrjh4dg/fHE4u7w5Empc3nUs2J3Qq2h4Sm2lZfEmjVoOT2ansucjgxeztPjRWMsTnWtGi2OLfxiihH5tChF7LBrI2EoHoAqbLTQcuUeQoPA9N3+Xni1wNhNDN+KK14XjIDgvJ27juUUjNcbTbOY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782980299; c=relaxed/simple; bh=WUwitR7QmynSNbtZbcgYiLHokAlm8L6HIhtO39dJios=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rPGEnfL7eueJD6QAdwEW6iUYNSV3Ao2GNB/ITQAl1W6ZDxYrlHJmpOIQMcTd+NQStlKZQmBzNK3GrlLWCcTDiXzrlTn2wplJIudvxmuQ60WsCjdNPLo0kc6xcNEyAznZRhYt+cnLQI+uLQk90JOHAfKFOQ+JJ6wqQgXPH3gGV4Q= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=robert.mader@collabora.com header.b=Geisr4Ww; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=robert.mader@collabora.com header.b="Geisr4Ww" ARC-Seal: i=1; a=rsa-sha256; t=1782980259; cv=none; d=zohomail.com; s=zohoarc; b=UQ4N3uoTpLdHqGqeyN6bP31boYEYbJk7nNKzBUi5UAzHO64mnh7++NtNIct+RRm7qcF8xCT5MvlrEO1RCoyEFTS5GU0U/tMU/oU9fdUwZYLyCPDWkGbCs8tVlqHqao4O3u+Q5DQye2g0cM91EGHlayR20QkHYUF4Ajh+FPQmVNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782980259; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=wn/JhRLP/kw9OT3tYgqPgKSK7xYfFVe48gW5Umt2FKA=; b=F0k5PoQ6m7wK49IAyXZLL7cze/9rSRUfw3GXTqsIm2YYYE9C2AgacsXc+EEcxIGiw7pSCWz+L25ElUFWs3OWx2JZQpvUc8FpjYGP8cgjV6bUYbS52HiDSKvxbUToxXYS1BsPT90YUnEl7IzdNweJvBdUlSwYNjEI/QwiDTSdcP8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1782980259; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=wn/JhRLP/kw9OT3tYgqPgKSK7xYfFVe48gW5Umt2FKA=; b=Geisr4Wwqy5yLjY/Puu8gfYpHnElb+k2YKKM+wJf8reqnJ+D3z/eqcKSGhQzx+e8 2YCXEVcPVAVwmEX3nu4B9WEBuaT3MAFO/qYTd0i43APBucyK7JWSh83HmQF2PLSgDX6 fdMV+4rO75ihHE+ReAwif8x6Nxtt7Ou2d9CF9PCo= Received: by mx.zohomail.com with SMTPS id 1782980257337423.760676344912; Thu, 2 Jul 2026 01:17:37 -0700 (PDT) From: Robert Mader To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Harry Wentland , Daniel Stone , Chaitanya Kumar Borah , Uma Shankar , Louis Chauvet , Melissa Wen , Simon Ser , Pekka Paalanen , Leandro Ribeiro , Robert Mader Subject: [PATCH v2] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE Date: Thu, 2 Jul 2026 10:16:41 +0200 Message-ID: <20260702081641.22990-1-robert.mader@collabora.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The client cap is currently advertised unconditionally, even for drivers that do not support plane color pipelines. If clients supporting the later, like Wayland compositors or tools like drm_info, enable the client cap on such drivers they will be left without both color pipeline and the legacy properties COLOR_ENCODING and COLOR_RANGE, effectively breaking YUV->RGB conversion support. Prevent that by only marking the cap supported if there are actually planes with color pipelines. Note: while the color pipeline replacement for the legacy properties is still under review (1), we can assume that it will work as a drop-in replacement. That means any plane on any hardware currently supporting the legacy properties will be able to offer a functionally equal color pipeline and there will be no technical reason keep using the legacy properties if both the driver and the client support the new API. 1: https://lore.kernel.org/dri-devel/20260623164812.81110-1-harry.wentland@amd.com/ Signed-off-by: Robert Mader --- Changes in v2: - Replace the driver feature with a simple check (suggested by Maarten Lankhorst ) - Expand the commit message slightly and change the title --- drivers/gpu/drm/drm_ioctl.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index e2df4becce62..b2c0234eaf14 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -373,13 +373,26 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv) return -EINVAL; file_priv->supports_virtualized_cursor_plane = req->value; break; - case DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE: + case DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE: { + struct drm_plane *plane; + bool has_plane_with_color_pipeline = false; + + drm_for_each_plane(plane, dev) { + if (plane->color_pipeline_property) { + has_plane_with_color_pipeline = true; + break; + } + } + if (!has_plane_with_color_pipeline) + return -EOPNOTSUPP; + if (!file_priv->atomic) return -EINVAL; if (req->value > 1) return -EINVAL; file_priv->plane_color_pipeline = req->value; break; + } default: return -EINVAL; } -- 2.55.0