Re: [PATCH v1 1/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
From: Melissa Wen
Date: Tue Jun 30 2026 - 13:03:24 EST
On 30/06/2026 10:42, Robert Mader wrote:
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 and drm_info, enable the client cap on sich drivers they will be
left without both color pipeline and the legacy properties COLOR_ENCODING and
COLOR_RANGE, effectively breaking YUV->RGB conversion support.
Add a new driver feature and guard the client cap behind it, allowing
plane color pipeline and legacy YUV->RGB support to co-exist.
Ouch, that's indeed a problem. Nice catch!
I'm not sure if this is the right way to go because plane color pipeline can be supported per plane and per hw family.
My suggestion would be to only deprecate COLOR_ENCODING and COLOR_RANGE in drm_mode_object_get_properties() if a plane COLOR_PIPELINE property is attached.
WDYT?
Melissa
Signed-off-by: Robert Mader <robert.mader@xxxxxxxxxxxxx>
---
drivers/gpu/drm/drm_ioctl.c | 2 ++
include/drm/drm_drv.h | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index ff193155129e..96fda92e31b9 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -374,6 +374,8 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
file_priv->supports_virtualized_cursor_plane = req->value;
break;
case DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE:
+ if (!drm_core_check_feature(dev, DRIVER_PLANE_COLOR_PIPELINE))
+ return -EOPNOTSUPP;
if (!file_priv->atomic)
return -EINVAL;
if (req->value > 1)
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index e09559495c5b..108ddd2c8d30 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -116,6 +116,12 @@ enum drm_driver_feature {
* the cursor planes to work correctly).
*/
DRIVER_CURSOR_HOTSPOT = BIT(9),
+ /**
+ * @DRIVER_PLANE_COLOR_PIPELINE:
+ *
+ * Driver supports PLANE_COLOR_PIPELINE.
+ */
+ DRIVER_PLANE_COLOR_PIPELINE = BIT(10),
/* IMPORTANT: Below are all the legacy flags, add new ones above. */