Re: [PATCH 1/5] drm/vkms: make argb_u16_to_RGB565 round resulting values
From: Sidharth Saha
Date: Sat Nov 07 2026 - 22:12:41 EST
Hi Matheus,
I wrote a KUnit test for argb_u16_to_RGB565() covering zero and max
values, the channel midpoint (0x8000 -> 16/32/16), the 0->1 rounding
step for a 5-bit channel (1057 -> 0, 1058 -> 1), and distinct values
per channel to catch channel placement.
Without this patch, the midpoint, above-step and distinct cases fail
(e.g. green comes out 31 instead of 32, i.e. truncated). With it, all
six cases pass.
Tested-by: Sidharth Saha ssaha2000@xxxxxxxxx
Since this rounding fix was lost once before in a refactor, I'm happy
to send the test as a follow-up patch once this series lands, or you're
welcome to fold it into a v2 if that's easier.
Thanks,
Sidharth
On 9/27/2026 5:52 PM, Matheus Alves de Almeida wrote:
Currently, argb_u16_to_RGB565() truncates the resulting channel values.