Skip to content

drm/vkms: improve color curve LUTs precision

Leandro Ribeiro dri-devel lkml 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest12 patches 14 repliesApplied
  2. v111 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Fixed a few minor issues spotted by Sashiko bot
- Added reviewed-by and tested-by tags
- Rebased

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/12drm/vkms: rename VKMS_LUT_SIZE to VKMS_GAMMA_LUT_SIZEdrivers/gpu/drm/vkms/vkms_crtc.c drivers/gpu/drm/vkms/vkms_drv.c drivers/gpu/drm/vkms/vkms_drv.h+4 -41 reply
2/12vkms: properly compute gamma LUT size in vkms_atomic_check()drivers/gpu/drm/vkms/vkms_drv.c+1 -12 replies
3/12drm/vkms: allow color curve LUTs to have different sizesdrivers/gpu/drm/vkms/tests/vkms_color_test.c drivers/gpu/drm/vkms/vkms_luts.c drivers/gpu/drm/vkms/vkms_luts.h+8 -101 reply
4/12drm/vkms: remove TEST_LUT_SIZEdrivers/gpu/drm/vkms/tests/vkms_color_test.c+3 -51 reply
5/12drm/vkms: remove linear_eotfdrivers/gpu/drm/vkms/tests/vkms_color_test.c drivers/gpu/drm/vkms/vkms_luts.c drivers/gpu/drm/vkms/vkms_luts.h+3 -2701 reply
6/12drm/vkms: improve the way in which we access LUT memberdrivers/gpu/drm/vkms/vkms_composer.c+24 -61 reply
7/12drm/vkms: rename struct vkms_color_lut::base to ydrivers/gpu/drm/vkms/tests/vkms_color_test.c drivers/gpu/drm/vkms/vkms_composer.c drivers/gpu/drm/vkms/vkms_drv.h +1 more+9 -91 reply
8/12drm/vkms: rename get_lut_index() to get_uniform_lut_index()drivers/gpu/drm/vkms/tests/vkms_color_test.c drivers/gpu/drm/vkms/vkms_composer.c drivers/gpu/drm/vkms/vkms_composer.h+18 -181 reply
9/12drm/vkms: add support to non-uniform LUT for internal color curvesdrivers/gpu/drm/vkms/tests/vkms_color_test.c drivers/gpu/drm/vkms/vkms_composer.c drivers/gpu/drm/vkms/vkms_drv.h +1 more+139 -321 reply
10/12drm/vkms: test sRGB and inverse sRGB LUTs using more samplesdrivers/gpu/drm/vkms/tests/vkms_color_test.c+7 -51 reply
11/12drm/vkms: add script to create optimized LUTs for color curvesdrivers/gpu/drm/vkms/scripts/color-curve-lut.py+573 -01 reply
12/12drm/vkms: replace uniform sRGB LUT and its inverse with optimal onesdrivers/gpu/drm/vkms/tests/vkms_color_test.c drivers/gpu/drm/vkms/vkms_luts.c+676 -5541 reply

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by.

PatchRobert MaderOarora EtimisLouis Chauvet
1/12R-b T-b R-b
2/12R-b T-b R-b R-b
3/12R-b T-b R-b
4/12R-b T-b R-b
5/12R-b T-b R-b
6/12R-b T-b R-b
7/12R-b T-b R-b
8/12R-b T-b R-b
9/12R-b T-b R-b
10/12R-b T-b R-b
11/12R-b T-b R-b
12/12R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/12] drm/vkms: improve color curve LUTs precision

Currently VKMS only supports uniform LUTs. Besides the userspace provided LUTs, it also represents color curves with LUTs, as it can't simply implement the continuous curve formulas (floating-point would be required).

This adds support to represent color curves with non-uniform LUTs, improving the precision significantly. It also provides a script that can be used to create these LUTs.

The optimized LUTs use more samples in regions where the interpolation and quantization errors are higher (usually in regions with a steeper slope). The LUT generator script compares different strategies and uses greedy subdivision, which outperformed the other methods, to generate the optimized LUTs for VKMS.

For now, only the existing sRGB and inverse sRGB curves are replaced. Support for more color curves will be added in future patchsets.

v2:
- Fixed a few minor issues spotted by Sashiko bot
- Added reviewed-by and tested-by tags
- Rebased

Leandro Ribeiro (12):
drm/vkms: rename VKMS_LUT_SIZE to VKMS_GAMMA_LUT_SIZE
vkms: properly compute gamma LUT size in vkms_atomic_check() drm/vkms: allow color curve LUTs to have different sizes drm/vkms: remove TEST_LUT_SIZE
drm/vkms: remove linear_eotf
drm/vkms: improve the way in which we access LUT member drm/vkms: rename struct vkms_color_lut::base to y drm/vkms: rename get_lut_index() to get_uniform_lut_index() drm/vkms: add support to non-uniform LUT for internal color curves drm/vkms: test sRGB and inverse sRGB LUTs using more samples drm/vkms: add script to create optimized LUTs for color curves drm/vkms: replace uniform sRGB LUT and its inverse with optimal ones

 .../gpu/drm/vkms/scripts/color-curve-lut.py   |  573 +++++++
 drivers/gpu/drm/vkms/tests/vkms_color_test.c  |   48 +-
 drivers/gpu/drm/vkms/vkms_composer.c          |  127 +-
 drivers/gpu/drm/vkms/vkms_composer.h          |    2 +-
 drivers/gpu/drm/vkms/vkms_crtc.c              |    4 +-
 drivers/gpu/drm/vkms/vkms_drv.c               |    4 +-
 drivers/gpu/drm/vkms/vkms_drv.h               |   13 +-
 drivers/gpu/drm/vkms/vkms_luts.c              | 1469 ++++++++---------
 drivers/gpu/drm/vkms/vkms_luts.h              |    3 -
 9 files changed, 1397 insertions(+), 846 deletions(-)
 create mode 100644 drivers/gpu/drm/vkms/scripts/color-curve-lut.py
Signature · 1 line
2.56.0