All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/vkms: speed up composition with a precomputed gamma LUT
@ 2026-11-08 19:33 Oarora Etimis
  2026-11-08 19:33 ` [PATCH 1/4] drm/vkms: use the gamma LUT of the state being composed Oarora Etimis
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Oarora Etimis @ 2026-11-08 19:33 UTC (permalink / raw)
  To: Louis Chauvet, Haneen Mohammed, Simona Vetter, Melissa Wen,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Maíra Canal, Harry Wentland, Pekka Paalanen, Arthur Grillo,
	Helen Koike, Vignesh Raman
  Cc: dri-devel, linux-kernel, Oarora Etimis

Four patches: a fix so that a frame takes the gamma LUT from the state it
is built from, a table that turns applying it into a lookup, a test, and
the CI entries that can go once the timeouts are gone.

apply_lut() samples the gamma LUT: every channel of every pixel gets a
fixed-point index and an interpolation between two neighbouring entries.
On a 1024x768 mode that is 2.36 million interpolations per frame, and
kms_plane@pixel-format takes 160.1-167.8 s while
pixel-format-source-clamping takes 78.9-83.8 s, over ten runs each. CI
lists both as Timeout in drivers/gpu/drm/ci/xfails/vkms-none-fails.txt.

A channel value is a u16, so a channel has only 65536 possible outputs.
Patch 2 computes them once per LUT change into three tables (384 KiB) and
applies the LUT by indexing them, which leaves the composed output
bit-identical to the interpolated path. The two subtests take 4.87-4.90 s
and 9.70-9.84 s.

Patch 1 is the fix I posted on 22 October
(<20261022215803.621996-1-oaroraetimis@gmail.com>), and patch 2 builds on
it. Patch 4 removes the two xfail entries and has to be merged with patch
2: on its own the subtests still time out.

The other approach I considered. drm_fixp_msbset() computes fls64() with a
62-step loop; replacing it with fls64() is three lines, needs no memory,
no cache and no lifetime, and returns the same values. In a userspace copy
of the same functions the LUT phase goes from 153.9 ms to 10.5 ms per
frame, ~15x, where the tables give 0.9 ms, ~170x. I have not measured the
subtests with it, so I have no wall clock for it. It is not part of this
series.

---
Oarora Etimis (4):
      drm/vkms: use the gamma LUT of the state being composed
      drm/vkms: precompute the gamma LUT for every channel value
      drm/vkms: add a KUnit test for the precomputed LUT table
      drm/ci: drop the kms_plane pixel-format xfails for vkms

 drivers/gpu/drm/ci/xfails/vkms-none-fails.txt |  2 -
 drivers/gpu/drm/vkms/tests/vkms_color_test.c  | 54 +++++++++++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_composer.c          | 47 ++++++++++++++++++-----
 drivers/gpu/drm/vkms/vkms_composer.h          |  3 ++
 drivers/gpu/drm/vkms/vkms_crtc.c              | 24 ++++++++++++
 drivers/gpu/drm/vkms/vkms_drv.h               |  6 +++
 6 files changed, 125 insertions(+), 11 deletions(-)
---
base-commit: 33ed26235db93162935d1719bc6f538c384a2fd8
change-id: 20261108-lut-4fde3dee44ce

Best regards,
--  
Oarora Etimis <oaroraetimis@gmail.com>


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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-08 19:33 [PATCH 0/4] drm/vkms: speed up composition with a precomputed gamma LUT Oarora Etimis
2026-11-08 19:33 ` [PATCH 1/4] drm/vkms: use the gamma LUT of the state being composed Oarora Etimis
2026-11-08 19:39   ` sashiko-bot
2026-11-08 19:33 ` [PATCH 2/4] drm/vkms: precompute the gamma LUT for every channel value Oarora Etimis
2026-11-08 19:33 ` [PATCH 3/4] drm/vkms: add a KUnit test for the precomputed LUT table Oarora Etimis
2026-11-08 19:33 ` [PATCH 4/4] drm/ci: drop the kms_plane pixel-format xfails for vkms Oarora Etimis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.