[PATCH 0/5] drm/vkms: Add KUnit tests for packed RGB format conversions

From: Sidharth Saha via B4 Relay

Date: Mon Nov 16 2026 - 20:21:45 EST


This series adds KUnit tests for the pixel format conversions touched
by Matheus's series "drm/vkms: support more formats and fix RGB565
regression" [1], which it depends on.

The RGB565 writeback rounding fix in [1] restores a fix that was lost
once before in a refactor. These tests are meant to keep it, and the new
RGB332, BGR233 and BGR565 conversions, from regressing.

Each test is table-driven, with expected values computed by hand. With
[1] applied, all cases pass. Without it, the tests for the new formats
don't build, the RGB565 writeback rounding cases fail, and the
RGB565/BGR565 read cases pass unchanged.

Matheus offered to include these in a v2 of [1] if one is needed;
otherwise they can be applied on top of it.

[1] https://lore.kernel.org/dri-devel/20260928005301.367977-1-matheus.aalmeida@xxxxxxxxxxxx/

Signed-off-by: Sidharth Saha <40047656+Sidharth-Saha@xxxxxxxxxxxxxxxxxxxxxxxx>
---
Sidharth Saha (5):
drm/vkms: Add KUnit test for RGB565 writeback conversion
drm/vkms: Add KUnit test for BGR565 writeback conversion
drm/vkms: Add KUnit tests for RGB332 and BGR233 read conversion
drm/vkms: Add KUnit tests for RGB332 and BGR233 writeback conversion
drm/vkms: Add KUnit tests for RGB565 and BGR565 read conversion

drivers/gpu/drm/vkms/tests/vkms_format_test.c | 202 ++++++++++++++++++++++++++
drivers/gpu/drm/vkms/vkms_formats.c | 24 ++-
drivers/gpu/drm/vkms/vkms_formats.h | 10 ++
3 files changed, 228 insertions(+), 8 deletions(-)
---
base-commit: 66c571876c4634dc3258a75a6d49bd7e88ffcb35
change-id: 20261116-rgb565-test-3d8f9c3c9b3e
prerequisite-message-id: <20260928005301.367977-1-matheus.aalmeida@xxxxxxxxxxxx>
prerequisite-patch-id: 62056d93696db239d59a0ca486a7fba3f5ee204d
prerequisite-patch-id: a909d90a401095b0ad014f44f08b8c76563262b8
prerequisite-patch-id: 713b5a5532b2ec31d360132496e6f9980b91a16a
prerequisite-patch-id: fa0fda9d178c4b5a65d984a672f47ec90b86ea2a
prerequisite-patch-id: 8e173c420969c0943d31eec819288d9df4d39b5f

Best regards,
--
Sidharth Saha <ssaha2000@xxxxxxxxx>