The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
@ 2026-06-30  8:42 Robert Mader
  2026-06-30  8:42 ` [PATCH v1 1/4] " Robert Mader
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Robert Mader @ 2026-06-30  8:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, linux-kernel, amd-gfx, intel-gfx, Harry Wentland,
	Daniel Stone, Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet,
	Melissa Wen, Simon Ser, Pekka Paalanen, Leandro Ribeiro,
	Robert Mader

From the main commit:

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.

In case of VKMS make the client cap depend on the enable_plane_pipeline.

The series can be easily tested with drm_info >= v2.10.0 and VKMS. Without the
enable_plane_pipeline option - currently the default - the legacy flags
COLOR_ENCODING and COLOR_RANGE should be advertised, just like older drm_info
versions.

---

Related series actually implementing the color pipeline replacement for the
legacy flags:
https://lists.freedesktop.org/archives/dri-devel/2026-June/575655.html


Robert Mader (4):
  drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
  drm/amdgpu: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
  drm/i915: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
  drm/vkms: Add DRIVER_PLANE_COLOR_PIPELINE driver feature

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
 drivers/gpu/drm/drm_ioctl.c             | 2 ++
 drivers/gpu/drm/i915/i915_driver.c      | 2 +-
 drivers/gpu/drm/vkms/vkms_drv.c         | 6 +++++-
 include/drm/drm_drv.h                   | 6 ++++++
 5 files changed, 15 insertions(+), 3 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v1 1/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
  2026-06-30  8:42 [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature Robert Mader
@ 2026-06-30  8:42 ` Robert Mader
  2026-06-30 16:57   ` Melissa Wen
  2026-06-30  8:42 ` [PATCH v1 2/4] drm/amdgpu: Add DRIVER_PLANE_COLOR_PIPELINE " Robert Mader
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Robert Mader @ 2026-06-30  8:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, linux-kernel, amd-gfx, intel-gfx, Harry Wentland,
	Daniel Stone, Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet,
	Melissa Wen, Simon Ser, Pekka Paalanen, Leandro Ribeiro,
	Robert Mader

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.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
 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. */
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v1 2/4] drm/amdgpu: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
  2026-06-30  8:42 [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature Robert Mader
  2026-06-30  8:42 ` [PATCH v1 1/4] " Robert Mader
@ 2026-06-30  8:42 ` Robert Mader
  2026-06-30  8:42 ` [PATCH v1 3/4] drm/i915: " Robert Mader
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Robert Mader @ 2026-06-30  8:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, linux-kernel, amd-gfx, intel-gfx, Harry Wentland,
	Daniel Stone, Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet,
	Melissa Wen, Simon Ser, Pekka Paalanen, Leandro Ribeiro,
	Robert Mader

Which is now required for DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 1781c0c3d010..87e676abe151 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -3083,7 +3083,7 @@ static const struct drm_driver amdgpu_kms_driver = {
 	    DRIVER_ATOMIC |
 	    DRIVER_GEM |
 	    DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ |
-	    DRIVER_SYNCOBJ_TIMELINE,
+	    DRIVER_SYNCOBJ_TIMELINE | DRIVER_PLANE_COLOR_PIPELINE,
 	.open = amdgpu_driver_open_kms,
 	.postclose = amdgpu_driver_postclose_kms,
 	.ioctls = amdgpu_ioctls_kms,
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v1 3/4] drm/i915: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
  2026-06-30  8:42 [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature Robert Mader
  2026-06-30  8:42 ` [PATCH v1 1/4] " Robert Mader
  2026-06-30  8:42 ` [PATCH v1 2/4] drm/amdgpu: Add DRIVER_PLANE_COLOR_PIPELINE " Robert Mader
@ 2026-06-30  8:42 ` Robert Mader
  2026-06-30  8:42 ` [PATCH v1 4/4] drm/vkms: " Robert Mader
  2026-07-01 10:41 ` [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind " Maarten Lankhorst
  4 siblings, 0 replies; 11+ messages in thread
From: Robert Mader @ 2026-06-30  8:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, linux-kernel, amd-gfx, intel-gfx, Harry Wentland,
	Daniel Stone, Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet,
	Melissa Wen, Simon Ser, Pekka Paalanen, Leandro Ribeiro,
	Robert Mader

Which is now required for DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
 drivers/gpu/drm/i915/i915_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index f06b2e8cf7d4..346b3a45d0d8 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1875,7 +1875,7 @@ static const struct drm_driver i915_drm_driver = {
 	.driver_features =
 	    DRIVER_GEM |
 	    DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_SYNCOBJ |
-	    DRIVER_SYNCOBJ_TIMELINE,
+	    DRIVER_SYNCOBJ_TIMELINE | DRIVER_PLANE_COLOR_PIPELINE,
 	.release = i915_driver_release,
 	.open = i915_driver_open,
 	.postclose = i915_driver_postclose,
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v1 4/4] drm/vkms: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
  2026-06-30  8:42 [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature Robert Mader
                   ` (2 preceding siblings ...)
  2026-06-30  8:42 ` [PATCH v1 3/4] drm/i915: " Robert Mader
@ 2026-06-30  8:42 ` Robert Mader
  2026-07-01 10:41 ` [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind " Maarten Lankhorst
  4 siblings, 0 replies; 11+ messages in thread
From: Robert Mader @ 2026-06-30  8:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, linux-kernel, amd-gfx, intel-gfx, Harry Wentland,
	Daniel Stone, Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet,
	Melissa Wen, Simon Ser, Pekka Paalanen, Leandro Ribeiro,
	Robert Mader

Which is now required for DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE. Only
enable it if the enable_plane_pipeline option is enabled so otherwise
the legacy flags COLOR_ENCODING and COLOR_RANGE continue to be
supported.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
 drivers/gpu/drm/vkms/vkms_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index 5a640b531d88..00bbde950521 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -91,7 +91,8 @@ static void vkms_atomic_commit_tail(struct drm_atomic_commit *old_state)
 }
 
 static const struct drm_driver vkms_driver = {
-	.driver_features	= DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM,
+	.driver_features	= DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM |
+				  DRIVER_PLANE_COLOR_PIPELINE,
 	.fops			= &vkms_driver_fops,
 	DRM_GEM_SHMEM_DRIVER_OPS,
 	DRM_FBDEV_SHMEM_DRIVER_OPS,
@@ -184,6 +185,9 @@ int vkms_create(struct vkms_config *config)
 	vkms_device->config = config;
 	config->dev = vkms_device;
 
+	if (!enable_plane_pipeline)
+		vkms_device->drm.driver_features &= ~DRIVER_PLANE_COLOR_PIPELINE;
+
 	ret = dma_coerce_mask_and_coherent(vkms_device->drm.dev,
 					   DMA_BIT_MASK(64));
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 1/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
  2026-06-30  8:42 ` [PATCH v1 1/4] " Robert Mader
@ 2026-06-30 16:57   ` Melissa Wen
       [not found]     ` <9eb18964-fcca-4fce-9fb9-f36d762ac23e@collabora.com>
  0 siblings, 1 reply; 11+ messages in thread
From: Melissa Wen @ 2026-06-30 16:57 UTC (permalink / raw)
  To: Robert Mader, dri-devel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, linux-kernel, amd-gfx, intel-gfx, Harry Wentland,
	Daniel Stone, Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet,
	Simon Ser, Pekka Paalanen, Leandro Ribeiro



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@collabora.com>
> ---
>   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. */
>   


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 1/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
       [not found]       ` <267deaf4-55ec-492d-8646-e16a9b4bfb65@collabora.com>
@ 2026-07-01  8:28         ` Borah, Chaitanya Kumar
  0 siblings, 0 replies; 11+ messages in thread
From: Borah, Chaitanya Kumar @ 2026-07-01  8:28 UTC (permalink / raw)
  To: Robert Mader, Melissa Wen, dri-devel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, linux-kernel, amd-gfx, intel-gfx, Harry Wentland,
	Daniel Stone, Uma Shankar, Louis Chauvet, Simon Ser,
	Pekka Paalanen, Leandro Ribeiro



On 7/1/2026 1:39 PM, Robert Mader wrote:
> On 01.07.26 09:35, Robert Mader wrote:
>> On 30.06.26 18:57, Melissa Wen wrote:
>>>
>>>
>>> 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?
>>
>> Hi Melissa!
>>
>> I don't think we need or should use the legacy properties for drivers 
>> and clients that supports the new API. Once Harrys YUV conversion 
>> colorop series(1) lands, every plane on every hardware currently 
>> supporting COLOR_ENCODING and COLOR_RANGE could express that with the 
>> colorop API as well - even if not supporting any other operations.

Is it a concern then that v6.19 will have COLOR PIPELINE advertised 
without YUV support in AMD and still not allow legacy properties to be 
used? If it is, then the nuanced approach that Melissa suggested might help.

In Intel's case, currently the COLOR PIPELINE is exposed with a CTM 
block which can in theory be used for the YUV -> RGB conversion but we 
do have a dedicated programmable input CSC for this which we plan to 
expose in the near future. [1]

==
Chaitanya

[1] Note: This is in addition to the fixed matrix block that we are 
exposing for our SDR planes in

https://lore.kernel.org/intel-gfx/20260617090819.1735153-1-chaitanya.kumar.borah@intel.com/
It
>> would look roughly like this:
>>
>> └───"COLOR_PIPELINE" (atomic): enum {Bypass, YUV Pipeline 123} = Bypass
>>      ├───Bypass
>>      └───YUV Pipeline 123
>>          └───Color Operation 123
>>              └───Properties
>>                  ├───"TYPE" (immutable): enum {1D Curve, 1D LUT, 3x4 Matrix, Multiplier, 3D LUT, Fixed Matrix} = Fixed Matrix
>>                  ├───"BYPASS" (atomic): range [0, 1] = 1
>>                  ├───"NEXT" (atomic, immutable): object colorop = 465
>>                  └───"FIXED_MATRIX_TYPE" (atomic): enum {YCbCr 601 Full to RGB, YCbCr 601 Limited to RGB, YCbCr 709 Full to RGB, YCbCr 709 Limited to RGB, YCbCr 2020 NC Full to RGB, YCbCr 2020 NC Limited to RGB} = YCbCr 601 Full to RGB
>>
>> Doing so will be nicer for compositors/clients going forward as they'd 
>> only need to support a single API if they don't care about legacy 
>> drivers (and we can adapt all in-tree drivers).
>>
>> Do you agree?
>>
>> Best regards
>>
>> Robert
>>
>> 1: https://lists.freedesktop.org/archives/dri-devel/2026-June/575655.html
>>
> P.S.: sorry for the noise, just resending with all to/cc headers to make 
> sure it doesn't get lost - and wanted to add that I'm currently working 
> on the Weston implementation for the YUV conversion colorop to get it 
> over the line.
> 
> -- 
> Robert Mader
> Consultant Software Developer
> 
> Collabora Ltd.
> Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
> Registered in England & Wales, no. 5513718
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
  2026-06-30  8:42 [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature Robert Mader
                   ` (3 preceding siblings ...)
  2026-06-30  8:42 ` [PATCH v1 4/4] drm/vkms: " Robert Mader
@ 2026-07-01 10:41 ` Maarten Lankhorst
  2026-07-01 13:32   ` Robert Mader
  4 siblings, 1 reply; 11+ messages in thread
From: Maarten Lankhorst @ 2026-07-01 10:41 UTC (permalink / raw)
  To: Robert Mader, dri-devel
  Cc: Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	linux-kernel, amd-gfx, intel-gfx, Harry Wentland, Daniel Stone,
	Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet, Melissa Wen,
	Simon Ser, Pekka Paalanen, Leandro Ribeiro

Hello,

All you have to do is iterate over all planes at runtime until
one is found that has the pipeline property attached, it's not
a performance sensitive area and no locking is required for
testing if plane->color_pipeline_property is NULL.

You can also make drm_plane_create_color_pipeline_property set
the flag in drm_device::driver_features that the cap is supported.

But the cap setting code's not really performance sensitive, it will
be called only a few times during boot at most. Perhaps check whether
the first crtc->primary plane has the cap is also sufficient.

If you want to continue with a special driver cap, then please set
the flag for the xe driver too.

Kind regards,
~Maarten Lankhorst

On 6/30/26 10:42, Robert Mader wrote:
> From the main commit:
> 
> 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.
> 
> In case of VKMS make the client cap depend on the enable_plane_pipeline.
> 
> The series can be easily tested with drm_info >= v2.10.0 and VKMS. Without the
> enable_plane_pipeline option - currently the default - the legacy flags
> COLOR_ENCODING and COLOR_RANGE should be advertised, just like older drm_info
> versions.
> 
> ---
> 
> Related series actually implementing the color pipeline replacement for the
> legacy flags:
> https://lists.freedesktop.org/archives/dri-devel/2026-June/575655.html
> 
> 
> Robert Mader (4):
>   drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
>   drm/amdgpu: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
>   drm/i915: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
>   drm/vkms: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
> 
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
>  drivers/gpu/drm/drm_ioctl.c             | 2 ++
>  drivers/gpu/drm/i915/i915_driver.c      | 2 +-
>  drivers/gpu/drm/vkms/vkms_drv.c         | 6 +++++-
>  include/drm/drm_drv.h                   | 6 ++++++
>  5 files changed, 15 insertions(+), 3 deletions(-)
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
  2026-07-01 10:41 ` [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind " Maarten Lankhorst
@ 2026-07-01 13:32   ` Robert Mader
  2026-07-01 14:26     ` Maarten Lankhorst
  0 siblings, 1 reply; 11+ messages in thread
From: Robert Mader @ 2026-07-01 13:32 UTC (permalink / raw)
  To: Maarten Lankhorst, dri-devel
  Cc: Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	linux-kernel, amd-gfx, intel-gfx, Harry Wentland, Daniel Stone,
	Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet, Melissa Wen,
	Simon Ser, Pekka Paalanen, Leandro Ribeiro

Hi Maarten,

On 01.07.26 12:41, Maarten Lankhorst wrote:
> Hello,
>
> All you have to do is iterate over all planes at runtime until
> one is found that has the pipeline property attached, it's not
> a performance sensitive area and no locking is required for
> testing if plane->color_pipeline_property is NULL.

that's correct - I checked that before and while the amount of code 
changes necessary to support such a 
"check-planes-with-cap-enabled-and-reinitialize-without-cap-otherwise" 
is not big (AFAICS it should be possible with under 100 lines in 
Weston), it would need to be replicated in various Wayland compositors 
and lots of apps with native DRM backend (drm_info, Gstreamer KMS sink, 
MPV, Kodi etc.). The small change proposed here seems like a more 
elegant solution to me.

In a previous chat Pekka and Simon seemed to agree, quoting: "< 
emersion> pq, you mean the cap is advertised regardless of driver 
support? that sounds like a bug".

> You can also make drm_plane_create_color_pipeline_property set
> the flag in drm_device::driver_features that the cap is supported.
Automatically enabling the driver feature sounds like a reasonable 
improvement - I'll try that, thanks!
>
> But the cap setting code's not really performance sensitive, it will
> be called only a few times during boot at most. Perhaps check whether
> the first crtc->primary plane has the cap is also sufficient.
>
> If you want to continue with a special driver cap, then please set
> the flag for the xe driver too.
Indeed, will do in case the approach mentioned above doesn't work out 
for some reason.
> Kind regards,
> ~Maarten Lankhorst

Regards and thanks for the feedback!

>
> On 6/30/26 10:42, Robert Mader wrote:
>>  From the main commit:
>>
>> 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.
>>
>> In case of VKMS make the client cap depend on the enable_plane_pipeline.
>>
>> The series can be easily tested with drm_info >= v2.10.0 and VKMS. Without the
>> enable_plane_pipeline option - currently the default - the legacy flags
>> COLOR_ENCODING and COLOR_RANGE should be advertised, just like older drm_info
>> versions.
>>
>> ---
>>
>> Related series actually implementing the color pipeline replacement for the
>> legacy flags:
>> https://lists.freedesktop.org/archives/dri-devel/2026-June/575655.html
>>
>>
>> Robert Mader (4):
>>    drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
>>    drm/amdgpu: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
>>    drm/i915: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
>>    drm/vkms: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
>>
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
>>   drivers/gpu/drm/drm_ioctl.c             | 2 ++
>>   drivers/gpu/drm/i915/i915_driver.c      | 2 +-
>>   drivers/gpu/drm/vkms/vkms_drv.c         | 6 +++++-
>>   include/drm/drm_drv.h                   | 6 ++++++
>>   5 files changed, 15 insertions(+), 3 deletions(-)
>>
-- 
Robert Mader
Consultant Software Developer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
  2026-07-01 13:32   ` Robert Mader
@ 2026-07-01 14:26     ` Maarten Lankhorst
  2026-07-01 16:10       ` Robert Mader
  0 siblings, 1 reply; 11+ messages in thread
From: Maarten Lankhorst @ 2026-07-01 14:26 UTC (permalink / raw)
  To: Robert Mader, dri-devel
  Cc: Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	linux-kernel, amd-gfx, intel-gfx, Harry Wentland, Daniel Stone,
	Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet, Melissa Wen,
	Simon Ser, Pekka Paalanen, Leandro Ribeiro

Hey,


On 7/1/26 15:32, Robert Mader wrote:
> Hi Maarten,
> 
> On 01.07.26 12:41, Maarten Lankhorst wrote:
>> Hello,
>>
>> All you have to do is iterate over all planes at runtime until
>> one is found that has the pipeline property attached, it's not
>> a performance sensitive area and no locking is required for
>> testing if plane->color_pipeline_property is NULL.
> 
> that's correct - I checked that before and while the amount of code changes necessary to support such a "check-planes-with-cap-enabled-and-reinitialize-without-cap-otherwise" is not big (AFAICS it should be possible with under 100 lines in Weston), it would need to be replicated in various Wayland compositors and lots of apps with native DRM backend (drm_info, Gstreamer KMS sink, MPV, Kodi etc.). The small change proposed here seems like a more elegant solution to me.
> 
> In a previous chat Pekka and Simon seemed to agree, quoting: "< emersion> pq, you mean the cap is advertised regardless of driver support? that sounds like a bug".

You misunderstand my comment, I meant this from the kernel side.

>> You can also make drm_plane_create_color_pipeline_property set
>> the flag in drm_device::driver_features that the cap is supported.
> Automatically enabling the driver feature sounds like a reasonable improvement - I'll try that, thanks!
>>
>> But the cap setting code's not really performance sensitive, it will
>> be called only a few times during boot at most. Perhaps check whether
>> the first crtc->primary plane has the cap is also sufficient.
>>
>> If you want to continue with a special driver cap, then please set
>> the flag for the xe driver too.
> Indeed, will do in case the approach mentioned above doesn't work out for some reason.
>> Kind regards,
>> ~Maarten Lankhorst
> 
> Regards and thanks for the feedback!e
>>
>> On 6/30/26 10:42, Robert Mader wrote:
>>>  From the main commit:
>>>
>>> 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.
>>>
>>> In case of VKMS make the client cap depend on the enable_plane_pipeline.
>>>
>>> The series can be easily tested with drm_info >= v2.10.0 and VKMS. Without the
>>> enable_plane_pipeline option - currently the default - the legacy flags
>>> COLOR_ENCODING and COLOR_RANGE should be advertised, just like older drm_info
>>> versions.
>>>
>>> ---
>>>
>>> Related series actually implementing the color pipeline replacement for the
>>> legacy flags:
>>> https://lists.freedesktop.org/archives/dri-devel/2026-June/575655.html
>>>
>>>
>>> Robert Mader (4):
>>>    drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
>>>    drm/amdgpu: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
>>>    drm/i915: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
>>>    drm/vkms: Add DRIVER_PLANE_COLOR_PIPELINE driver feature
>>>
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
>>>   drivers/gpu/drm/drm_ioctl.c             | 2 ++
>>>   drivers/gpu/drm/i915/i915_driver.c      | 2 +-
>>>   drivers/gpu/drm/vkms/vkms_drv.c         | 6 +++++-
>>>   include/drm/drm_drv.h                   | 6 ++++++
>>>   5 files changed, 15 insertions(+), 3 deletions(-)
>>>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature
  2026-07-01 14:26     ` Maarten Lankhorst
@ 2026-07-01 16:10       ` Robert Mader
  0 siblings, 0 replies; 11+ messages in thread
From: Robert Mader @ 2026-07-01 16:10 UTC (permalink / raw)
  To: Maarten Lankhorst, dri-devel
  Cc: Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	linux-kernel, amd-gfx, intel-gfx, Harry Wentland, Daniel Stone,
	Chaitanya Kumar Borah, Uma Shankar, Louis Chauvet, Melissa Wen,
	Simon Ser, Pekka Paalanen, Leandro Ribeiro

Hey Maarten,

On 01.07.26 16:26, Maarten Lankhorst wrote:
> Hey,
>
>
> On 7/1/26 15:32, Robert Mader wrote:
>> Hi Maarten,
>>
>> On 01.07.26 12:41, Maarten Lankhorst wrote:
>>> Hello,
>>>
>>> All you have to do is iterate over all planes at runtime until
>>> one is found that has the pipeline property attached, it's not
>>> a performance sensitive area and no locking is required for
>>> testing if plane->color_pipeline_property is NULL.
>> that's correct - I checked that before and while the amount of code changes necessary to support such a "check-planes-with-cap-enabled-and-reinitialize-without-cap-otherwise" is not big (AFAICS it should be possible with under 100 lines in Weston), it would need to be replicated in various Wayland compositors and lots of apps with native DRM backend (drm_info, Gstreamer KMS sink, MPV, Kodi etc.). The small change proposed here seems like a more elegant solution to me.
>>
>> In a previous chat Pekka and Simon seemed to agree, quoting: "< emersion> pq, you mean the cap is advertised regardless of driver support? that sounds like a bug".
> You misunderstand my comment, I meant this from the kernel side.

Ouch, you are right - and iterating over all planes in 
`drm_setclientcap()` with `drm_for_each_plane()` indeed looks like the 
much easier and cleaner solution. Will send out a v2 doing that and 
ditching the new cap again.

Thanks!

-- 
Robert Mader
Consultant Software Developer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-01 16:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30  8:42 [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind driver feature Robert Mader
2026-06-30  8:42 ` [PATCH v1 1/4] " Robert Mader
2026-06-30 16:57   ` Melissa Wen
     [not found]     ` <9eb18964-fcca-4fce-9fb9-f36d762ac23e@collabora.com>
     [not found]       ` <267deaf4-55ec-492d-8646-e16a9b4bfb65@collabora.com>
2026-07-01  8:28         ` Borah, Chaitanya Kumar
2026-06-30  8:42 ` [PATCH v1 2/4] drm/amdgpu: Add DRIVER_PLANE_COLOR_PIPELINE " Robert Mader
2026-06-30  8:42 ` [PATCH v1 3/4] drm/i915: " Robert Mader
2026-06-30  8:42 ` [PATCH v1 4/4] drm/vkms: " Robert Mader
2026-07-01 10:41 ` [PATCH v1 0/4] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE behind " Maarten Lankhorst
2026-07-01 13:32   ` Robert Mader
2026-07-01 14:26     ` Maarten Lankhorst
2026-07-01 16:10       ` Robert Mader

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox