Color Pipeline API w/ VKMS
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest44 patches 17 repliesIn review
- v544 patches 17 repliesSuperseded
- v4 RFC42 patches 29 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 RFC | 23 patches | 25 replies | Superseded | |
| v2 RFC | 17 patches | 31 replies | Superseded | |
| v1 RFC | 10 patches | 29 replies | Superseded |
Changes in v6 from the cover letter
- Eliminate need to include test as .c file (Louis Chauvet)
- some doc updates
- cleanup if colorop alloc or init fails in VKMS and amdgpu (Louis Chauvet)
- couple other small improvements in VKMS, such as rounding (Louis Chauvet)
- take ref for DATA blob in duplicate_state func & fix refcount issues (Xaver Hugl)
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/44 | drm: Add helper for conversion from signed-magnitudeinclude/ | +18 | 0 replies | |
| 2/44 | drm/vkms: Round fixp2int conversion in lerp_u16drivers/ | +1 | 0 replies | |
| 3/44 | drm/vkms: Add kunit tests for VKMS LUT handlingdrivers/ drivers/ drivers/ +4 more | +211 | 2 replies | |
| 4/44 | drm/doc/rfc: Describe why prescriptive color pipeline is neededDocumentation/ Documentation/ | +379 | 0 replies | |
| 5/44 | drm/colorop: Introduce new drm_colorop mode objectdrivers/ drivers/ drivers/ +9 more | +522 | 2 replies | |
| 6/44 | drm/colorop: Add TYPE propertydrivers/ drivers/ drivers/ +2 more | +61 | 0 replies | |
| 7/44 | drm/colorop: Add 1D Curve subtypedrivers/ drivers/ include/ | +207 | 0 replies | |
| 8/44 | Documentation/gpu: document drm_coloropDocumentation/ drivers/ | +46 | 0 replies | |
| 9/44 | drm/colorop: Add BYPASS propertydrivers/ drivers/ include/ | +42 | 0 replies | |
| 10/44 | drm/colorop: Add NEXT propertydrivers/ include/ | +50 | 0 replies | |
| 11/44 | drm/colorop: Add atomic state print for drm_coloropdrivers/ | +24 | 0 replies | |
| 12/44 | drm/plane: Add COLOR PIPELINE propertydrivers/ drivers/ drivers/ +4 more | +161 | 0 replies | |
| 13/44 | drm/colorop: Add NEXT to colorop state printdrivers/ | +1 | 1 reply | |
| 14/44 | drm/vkms: Add enumerated 1D curve coloropdrivers/ drivers/ drivers/ +4 more | +953 | 1 reply | |
| 15/44 | drm/vkms: Add kunit tests for linear and sRGB LUTsdrivers/ drivers/ drivers/ | +53 | 1 reply | |
| 16/44 | drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINEdrivers/ drivers/ include/ +1 more | +42 | 1 reply | |
| 17/44 | drm/colorop: Add 3x4 CTM typedrivers/ drivers/ drivers/ +3 more | +128 | 0 replies | |
| 18/44 | drm/vkms: Use s32 for internal color pipeline precisiondrivers/ drivers/ | +29 | 2 replies | |
| 19/44 | drm/vkms: add 3x4 matrix in color pipelinedrivers/ drivers/ | +65 | 1 reply | |
| 20/44 | drm/tests: Add a few tests around drm_fixed.hdrivers/ drivers/ | +72 | 1 reply | |
| 21/44 | drm/vkms: Add tests for CTM handlingdrivers/ drivers/ drivers/ | +253 | 1 reply | |
| 22/44 | drm/colorop: pass plane_color_pipeline client cap to atomic checkdrivers/ include/ | +19 | 0 replies | |
| 23/44 | drm/colorop: define a new macro for_each_new_colorop_in_stateinclude/ | +20 | 0 replies | |
| 24/44 | drm/amd/display: Ignore deprecated props when plane_color_pipeline setdrivers/ | +4 | 0 replies | |
| 25/44 | drm/amd/display: Add bypass COLOR PIPELINEdrivers/ | +19 | 0 replies | |
| 26/44 | drm/amd/display: Skip color pipeline initialization for cursor planedrivers/ | +3 | 0 replies | |
| 27/44 | drm/amd/display: Add support for sRGB EOTF in DEGAM blockdrivers/ drivers/ drivers/ +2 more | +205 | 0 replies | |
| 28/44 | drm/amd/display: Add support for sRGB Inverse EOTF in SHAPER blockdrivers/ drivers/ drivers/ | +94 | 0 replies | |
| 29/44 | drm/amd/display: Add support for sRGB EOTF in BLND blockdrivers/ drivers/ drivers/ | +97 | 0 replies | |
| 30/44 | drm/colorop: Add PQ 125 EOTF and its inversedrivers/ include/ | +22 | 0 replies | |
| 31/44 | drm/amd/display: Enable support for PQ 125 EOTF and Inversedrivers/ drivers/ | +18 | 0 replies | |
| 32/44 | drm/colorop: add BT2020/BT709 OETF and Inverse OETFdrivers/ include/ | +21 | 0 replies | |
| 33/44 | drm/amd/display: Add support for BT.709 and BT.2020 TFsdrivers/ drivers/ | +15 | 0 replies | |
| 34/44 | drm/colorop: Add 1D Curve Custom LUT typedrivers/ drivers/ drivers/ +2 more | +79 | 0 replies | |
| 35/44 | drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUTdrivers/ drivers/ | +121 | 0 replies | |
| 36/44 | drm/amd/display: add 3x4 matrix coloropdrivers/ drivers/ | +66 | 0 replies | |
| 37/44 | drm/colorop: Add mutliplier typedrivers/ drivers/ drivers/ +2 more | +67 | 0 replies | |
| 38/44 | drm/amd/display: add multiplier coloropdrivers/ drivers/ | +56 | 0 replies | |
| 39/44 | drm/amd/display: Swap matrix and multiplierdrivers/ drivers/ | +27 | 0 replies | |
| 40/44 | drm/colorop: Define LUT_1D interpolationdrivers/ drivers/ drivers/ +2 more | +71 | 0 replies | |
| 41/44 | drm/colorop: allow non-bypass coloropsdrivers/ drivers/ drivers/ +2 more | +60 | 2 replies | |
| 42/44 | drm/colorop: Add 3D LUT supports to color pipelinedrivers/ drivers/ drivers/ +2 more | +233 | 2 replies | |
| 43/44 | drm/amd/display: add 3D LUT coloropdrivers/ drivers/ | +137 | 0 replies | |
| 44/44 | drm/amd/display: Add AMD color pipeline docdrivers/ | +102 | 0 replies |
Reviews trailers per patch
4 of 44 patches have a Reviewed-by or Acked-by.
| Patch | Louis Chauvet |
|---|---|
| 1/44 | |
| 2/44 | R-b |
| 3/44 | R-b |
| 4/44 | |
| 5/44 | |
| 6/44 | |
| 7/44 | |
| 8/44 | |
| 9/44 | |
| 10/44 | |
| 11/44 | |
| 12/44 | |
| 13/44 | |
| 14/44 | |
| 15/44 | R-b |
| 16/44 | |
| 17/44 | |
| 18/44 | |
| 19/44 | |
| 20/44 | Reviewd-by |
| 21/44 | R-b |
| 22/44 | |
| 23/44 | |
| 24/44 | |
| 25/44 | |
| 26/44 | |
| 27/44 | |
| 28/44 | |
| 29/44 | |
| 30/44 | |
| 31/44 | |
| 32/44 | |
| 33/44 | |
| 34/44 | |
| 35/44 | |
| 36/44 | |
| 37/44 | |
| 38/44 | |
| 39/44 | |
| 40/44 | |
| 41/44 | |
| 42/44 | |
| 43/44 | |
| 44/44 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 00/44] Color Pipeline API w/ VKMS
This is an RFC set for a color pipeline API, along with implementations in VKMS and amdgpu. It is tested with a set of IGT tests that can be found at [1]. The IGT tests run a pixel-by-pixel comparison with an allowable delta variation as the goal for these transformations is perceptual correctness, not complete pixel accuracy.
v5 of this patchset fleshed out documentation for colorops and the various defines that are being introduced.
v6 addresses a few comments from various reviewers.
VKMS supports two named transfer function colorops and two matrix colorops.
Amdgpu advertises the following pipeline for GPUs with DCN 3 or newer:
1. 1D Curve EOTF
2. 3x4 CTM
3. Multiplier
4. 1D Curve Inverse EOTF
5. 1D LUT
6. 3D LUT
7. 1D Curve EOTF
8. 1D LUT
The supported curves for the 1D Curve type are:
- sRGB EOTF and its inverse
- PQ EOTF, scaled to [0.0, 125.0] and its inverse
- BT.2020/BT.709 OETF and its inverse
Note that the 1st and 5th colorops take the EOTF or Inverse OETF while the 3rd colorop takes the Inverse EOTF or OETF.
The 3D LUT is a 17^3 tetrahedrally interpolated LUT but the mechanism exists for other drivers to describe their own 3D LUT capability.
This mirrors the color pipeline used by gamescope and presented by Melissa Wen, with the exception of the DEGAM LUT, which is not currently used. See [1]
https://indico.freedesktop.org/event/4/contributions/186/attachments/138/218/xdc2023-TheRainbowTreasureMap-MelissaWen.pdf
At this point we're hoping to see gamescope and kwin implementations take shape. The existing pipeline should be enough to satisfy the gamescope use-cases on the drm_plane.
In order to support YUV we'll need to add COLOR_ENCODING and COLOR_RANGE support to the color pipeline. I have sketched these out already but don't have it all hooked up yet. This should not hinder adoption of this API for gaming use-cases.
We'll also want to advertise IN_FORMATS on a color pipeline as some color pipelines won't be able to work for all IN_FORMATS on a plane. Again, I have a sketch but no full implementation yet. This is not currently required by the AMD color pipeline and could be added after the merge of this set.
VKMS patches could still be improved in a few ways, though the payoff might be limited and I would rather focus on other work at the moment. The most obvious thing to improve would be to eliminate the hard-coded LUTs for identity, and sRGB, and replace them with fixed-point math instead.
There are plenty of things that I would like to see, but they could be added after the merge of this patchset:
- COLOR_ENCODING and COLOR_RANGE
- IN_FORMATS for a color pipeline
- Is it possible to support HW which can't bypass entire pipeline?
- Can we do a LOAD / COMMIT model for LUTs (and other properties)?
- read-only scaling colorop which defines scaling taps and position
- named matrices, for things like converting YUV to RGB
- Add custom LUT colorops to VKMS
IGT tests can be found at [1] or on the igt-dev mailing list. There have been no updates since v5 and rebase on latest main is straight- forward.
A kernel branch can be found at [2].
There is a version of v5 with Uma and Chaitanya's patches for the Intel color pipeline based on top of v5 to show how I envision them to mesh with my changes. The relevant branches can be found at [3] for the kernel and [4] for IGT. There were some rebase conflicts in i915 and I'm not entirely sure I've resolved all of them correctly, but the branch compiles and shows my thoughts for the new DRM concepts to support Intel's pipeline.
[1] https://gitlab.freedesktop.org/hwentland/igt-gpu-tools/-/tree/amd-color-pipeline-v5
[2] https://gitlab.freedesktop.org/hwentland/linux/-/tree/amd-color-pipeline-v6
[3] https://gitlab.freedesktop.org/hwentland/linux/-/tree/amd-intel-color-pipeline-v5
[4] https://gitlab.freedesktop.org/hwentland/igt-gpu-tools/-/tree/amd-intel-color-pipeline-v5
v6:
- Eliminate need to include test as .c file (Louis Chauvet)
- some doc updates
- cleanup if colorop alloc or init fails in VKMS and amdgpu (Louis Chauvet)
- couple other small improvements in VKMS, such as rounding (Louis Chauvet)
- take ref for DATA blob in duplicate_state func & fix refcount issues (Xaver Hugl)
v5:
- amdgpu 3D LUT
- Don't require BYPASS
- update RFC docs and add to TOC tree
- add drm_colorop and COLOR_PIPELINE kernel docs (non-RFC)
- add amdgpu color pipeline doc
- define SIZE property similar to drm_crtc's GAMMA_SIZE
- various minor fixes and cleanups
v4:
- Add amdgpu color pipeline (WIP)
- Don't block setting of deprecated properties, instead pass client cap to atomic check so drivers can ignore these props
- Drop IOCTL definitions (Pekka)
- Use enum property for colorop TYPE (Pekka)
- A few cleanups to the docs (Pekka)
- Rework the TYPE enum to name relation to avoid code duplication (Pekka)
- Add missing function declarations (Chaitanya Kumar Borah)
- Allow setting of NEXT property to NULL in _set_ function (Chaitanya Kumar Borah)
- Add helper for creation of pipeline drm_plane property (Pekka)
- Always create Bypass pipeline (Pekka)
- A bunch of changes to VKMS kunit tests (Pekka)
- Fix index in CTM doc (Pekka)
v3:
- Abandon IOCTLs and discover colorops as clients iterate the pipeline
- Remove need for libdrm
- Add color_pipeline client cap and make mutually exclusive with COLOR_RANGE and COLOR_ENCODING properties
- add CTM colorop to VKMS
- Use include way for kunit testing static functions (Arthur)
- Make TYPE a range property
- Move enum drm_colorop_type to uapi header
- and a bunch of smaller bits that are highlighted in the relevant commit description
v2:
- Rebased on drm-misc-next
- Introduce a VKMS Kunit so we can test LUT functionality in vkms_composer
- Incorporate feedback in color_pipeline.rst doc
- Add support for sRGB inverse EOTF
- Add 2nd enumerated TF colorop to VKMS
- Fix LUTs and some issues with applying LUTs in VKMS
Alex Hung (13):
drm/colorop: define a new macro for_each_new_colorop_in_state drm/amd/display: Skip color pipeline initialization for cursor plane drm/amd/display: Add support for sRGB EOTF in DEGAM block drm/amd/display: Add support for sRGB Inverse EOTF in SHAPER block drm/amd/display: Add support for sRGB EOTF in BLND block drm/colorop: Add 1D Curve Custom LUT type
drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUT drm/amd/display: add 3x4 matrix colorop
drm/colorop: Add mutliplier type
drm/amd/display: add multiplier colorop
drm/amd/display: Swap matrix and multiplier
drm/colorop: Add 3D LUT supports to color pipeline drm/amd/display: add 3D LUT colorop
Harry Wentland (31):
drm: Add helper for conversion from signed-magnitude drm/vkms: Round fixp2int conversion in lerp_u16
drm/vkms: Add kunit tests for VKMS LUT handling drm/doc/rfc: Describe why prescriptive color pipeline is needed drm/colorop: Introduce new drm_colorop mode object drm/colorop: Add TYPE property
drm/colorop: Add 1D Curve subtype
Documentation/gpu: document drm_colorop
drm/colorop: Add BYPASS property
drm/colorop: Add NEXT property
drm/colorop: Add atomic state print for drm_colorop drm/plane: Add COLOR PIPELINE property
drm/colorop: Add NEXT to colorop state print
drm/vkms: Add enumerated 1D curve colorop
drm/vkms: Add kunit tests for linear and sRGB LUTs drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE drm/colorop: Add 3x4 CTM type
drm/vkms: Use s32 for internal color pipeline precision drm/vkms: add 3x4 matrix in color pipeline
drm/tests: Add a few tests around drm_fixed.h
drm/vkms: Add tests for CTM handling
drm/colorop: pass plane_color_pipeline client cap to atomic check drm/amd/display: Ignore deprecated props when plane_color_pipeline set drm/amd/display: Add bypass COLOR PIPELINE
drm/colorop: Add PQ 125 EOTF and its inverse drm/amd/display: Enable support for PQ 125 EOTF and Inverse drm/colorop: add BT2020/BT709 OETF and Inverse OETF drm/amd/display: Add support for BT.709 and BT.2020 TFs drm/colorop: Define LUT_1D interpolation
drm/colorop: allow non-bypass colorops
drm/amd/display: Add AMD color pipeline doc
Documentation/gpu/drm-kms.rst | 15 + Documentation/gpu/rfc/color_pipeline.rst | 376 ++++++++ Documentation/gpu/rfc/index.rst | 3 + drivers/gpu/drm/Makefile | 1 + .../gpu/drm/amd/display/amdgpu_dm/Makefile | 3 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 + .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 581 ++++++++++++- .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 216 +++++ .../amd/display/amdgpu_dm/amdgpu_dm_colorop.h | 36 + .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 32 + drivers/gpu/drm/drm_atomic.c | 184 +++- drivers/gpu/drm/drm_atomic_helper.c | 12 + drivers/gpu/drm/drm_atomic_state_helper.c | 5 + drivers/gpu/drm/drm_atomic_uapi.c | 175 ++++ drivers/gpu/drm/drm_colorop.c | 565 ++++++++++++ drivers/gpu/drm/drm_ioctl.c | 7 + drivers/gpu/drm/drm_mode_config.c | 7 + drivers/gpu/drm/drm_plane.c | 52 ++ drivers/gpu/drm/tests/Makefile | 3 +- drivers/gpu/drm/tests/drm_fixp_test.c | 70 ++ drivers/gpu/drm/vkms/Kconfig | 15 + drivers/gpu/drm/vkms/Makefile | 5 +- drivers/gpu/drm/vkms/tests/.kunitconfig | 4 + drivers/gpu/drm/vkms/tests/Makefile | 3 + drivers/gpu/drm/vkms/tests/vkms_color_test.c | 454 ++++++++++ drivers/gpu/drm/vkms/vkms_colorop.c | 113 +++ drivers/gpu/drm/vkms/vkms_composer.c | 132 ++- drivers/gpu/drm/vkms/vkms_composer.h | 27 + drivers/gpu/drm/vkms/vkms_drv.h | 8 + drivers/gpu/drm/vkms/vkms_luts.c | 802 ++++++++++++++++++ drivers/gpu/drm/vkms/vkms_luts.h | 12 + drivers/gpu/drm/vkms/vkms_plane.c | 2 + include/drm/drm_atomic.h | 130 +++ include/drm/drm_atomic_uapi.h | 3 + include/drm/drm_colorop.h | 441 ++++++++++ include/drm/drm_file.h | 7 + include/drm/drm_fixed.h | 18 + include/drm/drm_mode_config.h | 18 + include/drm/drm_plane.h | 19 + include/uapi/drm/amdgpu_drm.h | 9 - include/uapi/drm/drm.h | 16 + include/uapi/drm/drm_mode.h | 155 ++++ 42 files changed, 4691 insertions(+), 49 deletions(-) create mode 100644 Documentation/gpu/rfc/color_pipeline.rst create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.h create mode 100644 drivers/gpu/drm/drm_colorop.c create mode 100644 drivers/gpu/drm/tests/drm_fixp_test.c create mode 100644 drivers/gpu/drm/vkms/tests/.kunitconfig create mode 100644 drivers/gpu/drm/vkms/tests/Makefile create mode 100644 drivers/gpu/drm/vkms/tests/vkms_color_test.c create mode 100644 drivers/gpu/drm/vkms/vkms_colorop.c create mode 100644 drivers/gpu/drm/vkms/vkms_composer.h create mode 100644 drivers/gpu/drm/vkms/vkms_luts.c create mode 100644 drivers/gpu/drm/vkms/vkms_luts.h create mode 100644 include/drm/drm_colorop.h
--
2.46.2