When we merged the drm_plane color pipeline API the major gap
that existed was the lack of a color-space conversion colorop.
We deprecated any legacy drm_plane color properties, which
means that the COLOR_RANGE and COLOR_ENCODING properties can't
be used with the COLOR_PIPELINE property on a drm_plane. In
practice this means that we can't use a COLOR_PIPELINE on
YCbCr encoded framebuffers.

This patchset adds a CSC colorop with the COLOR_RANGE and
COLOR_ENCODING properties and implements support in VKMS and
amdgpu.

An alternate way of possibly representing this has been proposed
here:
https://patchwork.freedesktop.org/patch/709860

This code has been tested with IGT and an experimental KWin branch.

IGT branch:
https://gitlab.freedesktop.org/hwentland/igt-gpu-tools/-/tree/csc-colorop

KWin branch:
https://invent.kde.org/hwentlan/kwin/-/tree/csc-3dlut

The kernel branch containing these changes, based on drm-misc-next
can be found at:
https://gitlab.freedesktop.org/hwentland/linux/-/tree/csc-colorop

In order to successfully use this branch you might need a few
bugfixes. The kernel tree containing those fixes plus these patches
can be found at:
https://gitlab.freedesktop.org/hwentland/linux/-/tree/csc-colorop-all

Further background on this work can be found at:
https://hwentland.github.io/2026/03/10/plane-color-pipeline-csc-3d-lut-kwin.html

Cc: Alex Hung <[email protected]>
Cc: Daniel Stone <[email protected]>
Cc: Chaitanya Kumar Borah <[email protected]>
Cc: Uma Shankar <[email protected]>
Cc: Louis Chauvet <[email protected]>
Cc: Melissa Wen <[email protected]>
Cc: Simon Ser <[email protected]>

Harry Wentland (10):
  drm/colorop: Add CSC colorop type
  drm/colorop: Add CSC colorop initialization helper
  drm/atomic: Add CSC colorop state handling
  drm/vkms: Add CSC colorop support
  drm/vkms: Add atomic check and matrix handling for CSC colorop
  drm/amd/display: Implement CSC colorop support
  drm/amd/display: Use GAMCOR for first TF if CSC is used
  drm/amd/display: Check CSC colorop bypass before programming
  drm/amd/display: Check actual state during commit_tail
  drm/amd/display: Set color_space to plane_infos

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  14 ++-
 .../amd/display/amdgpu_dm/amdgpu_dm_color.c   | 115 +++++++++++++++++-
 .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c |  25 +++-
 drivers/gpu/drm/drm_atomic.c                  |   6 +
 drivers/gpu/drm/drm_atomic_uapi.c             |   8 ++
 drivers/gpu/drm/drm_colorop.c                 |  91 ++++++++++++++
 drivers/gpu/drm/vkms/vkms_colorop.c           |  64 +++++++---
 drivers/gpu/drm/vkms/vkms_composer.c          |   5 +
 drivers/gpu/drm/vkms/vkms_plane.c             |  50 +++++++-
 include/drm/drm_colorop.h                     |  39 ++++++
 include/uapi/drm/drm_mode.h                   |   1 +
 11 files changed, 388 insertions(+), 30 deletions(-)

--
2.53.0

Reply via email to