mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 00/12] drm/vkms: improve color curve LUTs precision
@ 2026-11-06 20:18 Leandro Ribeiro
  2026-11-06 20:18 ` [PATCH v2 01/12] drm/vkms: rename VKMS_LUT_SIZE to VKMS_GAMMA_LUT_SIZE Leandro Ribeiro
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Leandro Ribeiro @ 2026-11-06 20:18 UTC (permalink / raw)
  To: louis.chauvet
  Cc: airlied, alex.hung, daniel, hamohammed.sa, harry.wentland,
	maarten.lankhorst, melissa.srw, mripard, pekka.paalanen,
	robert.mader, simona, tzimmermann, dri-devel, linux-kernel

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

-- 
2.56.0


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

end of thread, other threads:[~2026-11-06 20:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 20:18 [PATCH v2 00/12] drm/vkms: improve color curve LUTs precision Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 01/12] drm/vkms: rename VKMS_LUT_SIZE to VKMS_GAMMA_LUT_SIZE Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 02/12] vkms: properly compute gamma LUT size in vkms_atomic_check() Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 03/12] drm/vkms: allow color curve LUTs to have different sizes Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 04/12] drm/vkms: remove TEST_LUT_SIZE Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 05/12] drm/vkms: remove linear_eotf Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 06/12] drm/vkms: improve the way in which we access LUT member Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 07/12] drm/vkms: rename struct vkms_color_lut::base to y Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 08/12] drm/vkms: rename get_lut_index() to get_uniform_lut_index() Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 09/12] drm/vkms: add support to non-uniform LUT for internal color curves Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 10/12] drm/vkms: test sRGB and inverse sRGB LUTs using more samples Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 11/12] drm/vkms: add script to create optimized LUTs for color curves Leandro Ribeiro
2026-11-06 20:18 ` [PATCH v2 12/12] drm/vkms: replace uniform sRGB LUT and its inverse with optimal ones Leandro Ribeiro

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

all inboxes | Powered by JetHome®