Re: [PATCH 04/11] drm/vkms: remove linear_eotf
[email protected] Tue, 04 Aug 2026 20:42:36 +0000
| Newsgroups | org.freedesktop.lists.dri-devel |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The `vkms_color_test_linear` KUnit test loop relies on a hardcoded multiplier of `0x101` that was designed for a 256-element LUT. The patch replaces `linear_eotf` (256 elements) with `test_linear_lut` (16 elements) without adjusting the multiplier. Since the loop now only executes 16 times (`i` from 0 to 15), the evaluated channel values only range from `0x0000` to `0x0F0F` (~5.8% of the 16-bit color space). The test fails to exercise the remaining 94% of the color range and leaves 14 out of the 16 elements of `test_linear_lut` completely untested. To restore proper test coverage over the `0x0000` to `0xFFFF` range, both instances of `0x101` should be updated to `0x1111` (since `15 * 0x1111 = 0xFFFF`). -- --- Patch [4]: [PATCH 04/11] drm/vkms: remove linear_eotf --- commit e4769cf1ca6d6dd3c89f50766f7a24a69c53cccb Author: Leandro Ribeiro <[email protected]> drm/vkms: remove linear_eotf This patch removes the linear_eotf LUT, which was only used for testing, and updates the kunit color tests to use test_linear_lut instead. > diff --git a/drivers/gpu/drm/vkms/tests/vkms_color_test.c b/drivers/gpu/drm/vkms/tests/vkms_color_test.c > index 3489513af3527..28614edb8eb18 100644 > --- a/drivers/gpu/drm/vkms/tests/vkms_color_test.c > +++ b/drivers/gpu/drm/vkms/tests/vkms_color_test.c > @@ -126,8 +126,8 @@ static void vkms_color_test_lerp(struct kunit *test) > > static void vkms_color_test_linear(struct kunit *test) > { > - for (int i = 0; i < linear_eotf.lut_length; i++) { > - int linear = apply_lut_to_channel_value(&linear_eotf, i * 0x101, LUT_RED); > + for (int i = 0; i < test_linear_lut.lut_length; i++) { > + int linear = apply_lut_to_channel_value(&test_linear_lut, i * 0x101, LUT_RED); [Severity: Medium] Since the new test_linear_lut only has 16 elements (compared to the 256 elements in linear_eotf), does leaving the multiplier as 0x101 mean we only test values up to 0x0f0f (~5.8% of the 16-bit color space)? Should both instances of 0x101 in this loop be updated to 0x1111 so that the final iteration (15 * 0x1111) reaches 0xffff, restoring coverage over the full color range? > > - KUNIT_EXPECT_EQ(test, DIV_ROUND_CLOSEST(linear, 0x101), i); > + KUNIT_EXPECT_EQ(test, DIV_ROUND_CLOSEST(linear, 0x101), i); > } [ ... ] -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=4