drm/tests
Geert Uytterhoeven a2dbfd6442 modetest: add SMPTE pattern support for C[124] formats
Add support for drawing the SMPTE pattern in buffers using a
color-indexed frame buffer formats with two, four, or sixteen colors.

Note that this still uses 256 as the CLUT size, as
DRM_IOCTL_MODE_SETGAMMA enforces that the size matches against the
(fixed) gamma size, while the CLUT size depends on the format.

Move clearing the color LUT entries from util_smpte_index_gamma() to its
caller, as only the caller knows how many entries there really are
(currently DRM always assumes 256 entries).

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
v5:
  - Add Reviewed-by,

v4:
  - Add missing C[12] to oneline-summary,
  - Do not remove memset() of full lut, else some entries may stay
    uninitialized,

v3:
  - Add Acked-by,

v2:
  - Split off changes to tests/modetest/modetest.c,
  - Add C1 and C2 support.

The linuxdoc comments say userspace can query the gamma size:

 * drm_mode_gamma_set_ioctl - set the gamma table
 *
 * Set the gamma table of a CRTC to the one passed in by the user. Userspace can
 * inquire the required gamma table size through drm_mode_gamma_get_ioctl.

 * drm_mode_gamma_get_ioctl - get the gamma table
 *
 * Copy the current gamma table into the storage provided. This also provides
 * the gamma table size the driver expects, which can be used to size the
 * allocated storage.

but the code doesn't seem to support that in an easy way (like setting
red/green/blue to NULL on input, retrieving gamma_size on output), only
by providing big enough buffers for red/green/blue, and looping over
gamma_size until -EINVAL is no longer returned.
2023-10-24 09:45:14 +02:00
..
amdgpu amdgpu: Use PRI?64 to format uint64_t 2023-09-04 09:31:55 +02:00
etnaviv tests/etnaviv_2d_test: check whether the rendering is correct 2020-12-09 16:00:51 +01:00
exynos libkms: Remove libkms completely 2022-04-15 22:40:29 +00:00
modeprint tests: use drmModeGetConnectorTypeName 2022-07-02 20:13:29 +00:00
modetest modetest: add SMPTE pattern support for C[124] formats 2023-10-24 09:45:14 +02:00
nouveau use standard `__typeof__()` instead of GNU extension `typeof()` 2022-01-19 16:08:31 -08:00
proptest tests: use drmModeGetConnectorTypeName 2022-07-02 20:13:29 +00:00
radeon Revert "Revert "libdrm: remove autotools support"" 2019-10-18 18:05:45 +01:00
tegra tests: tegra: Add VIC flip test 2022-02-23 16:06:49 +01:00
ttmtest fix various typos 2019-04-17 18:23:25 +01:00
util util: add SMPTE pattern support for C2 format 2023-10-24 09:44:49 +02:00
vbltest meson: always define whether headers exist 2020-01-23 17:00:12 +00:00
Android.mk android: simplify the including rule of subdirs 2015-03-20 17:07:21 +00:00
drmdevice.c Remove unused 3rd parameter to open(2) 2022-08-23 22:43:38 +00:00
drmsl.c drmsltest: Check expected neighbours 2017-08-21 13:05:13 +01:00
hash.c tests/hash: return non-zero on failure 2015-04-05 15:33:06 +01:00
meson.build libkms: Remove libkms completely 2022-04-15 22:40:29 +00:00