[PATCH i-g-t 2/3] test/amdgpu/amd_color: check CRTC color LUTs with cursor plane
Melissa Wen
mwen at igalia.com
Sun Jun 1 19:14:45 UTC 2025
CRTC degamma on AMD uses pre-blending degamma block applied to all
planes before blending in which we expect similar results as a
post-blending degamma. There is also a cursor attribute that can apply
implict degamma ROM only to its plane if set which may cause unexpected
results. To validate that there is no implict degamma ROM on hw cursor,
expand CRTC LUT accuracy test to also check if cursor and primary with
equal colors continue the same after applying CRTC degamma and CRTC
gamma. The goal to avoid regressions, as reported in [1][2] and fixed by
[3][4].
[1] https://gitlab.freedesktop.org/drm/amd/-/issues/1513
[2] https://gitlab.freedesktop.org/drm/amd/-/issues/4144
[3] https://lore.kernel.org/amd-gfx/20230731083505.1500965-1-mwen@igalia.com/
[4] https://lore.kernel.org/amd-gfx/20250422150427.59679-1-mwen@igalia.com/
Signed-off-by: Melissa Wen <mwen at igalia.com>
---
tests/amdgpu/amd_color.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/tests/amdgpu/amd_color.c b/tests/amdgpu/amd_color.c
index e34d11ef0..45760e9ab 100644
--- a/tests/amdgpu/amd_color.c
+++ b/tests/amdgpu/amd_color.c
@@ -41,6 +41,7 @@ typedef struct color {
typedef struct data {
igt_display_t display;
igt_plane_t *primary;
+ igt_plane_t *cursor;
igt_output_t *output;
igt_pipe_t *pipe;
igt_pipe_crc_t *pipe_crc;
@@ -193,6 +194,9 @@ static void test_init(data_t *data)
data->primary =
igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
+ data->cursor =
+ igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_CURSOR);
+
data->pipe_crc = igt_pipe_crc_new(data->fd, data->pipe_id,
IGT_PIPE_CRC_SOURCE_AUTO);
@@ -307,9 +311,12 @@ static void test_crtc_linear_regamma(data_t *data)
/*
* Tests LUT accuracy. CRTC regamma and CRTC degamma should produce a visually
- * correct image when used. Hardware limitations on degamma prevent this from
- * being CRC level accurate across a full test gradient but most values should
- * still match.
+ * correct image, not only with primary but also cursor plane. It validates
+ * that using pre-blending degamma block for CRTC degamma with multiple planes
+ * deliver expect results and there is no implicit ROM curve on cursor when
+ * using CRTC atomic color mgmt properties. Hardware limitations on degamma
+ * prevent this from being CRC level accurate across a full test gradient but
+ * most values should still match.
*
* This test skips on DCE because it doesn't support user degamma.
*/
@@ -331,7 +338,7 @@ static void test_crtc_lut_accuracy(data_t *data)
};
igt_display_t *display = &data->display;
igt_crc_t ref_crc, new_crc;
- igt_fb_t afb;
+ igt_fb_t afb, cfb;
lut_t lut_degamma, lut_regamma;
int i;
@@ -354,16 +361,19 @@ static void test_crtc_lut_accuracy(data_t *data)
igt_create_fb(data->fd, data->w, data->h, DRM_FORMAT_XRGB8888, 0, &afb);
igt_plane_set_fb(data->primary, &afb);
+ igt_create_fb(data->fd, 64, 64, DRM_FORMAT_ARGB8888, 0, &cfb);
+ igt_plane_set_fb(data->cursor, &cfb);
igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
/* Test colors. */
for (i = 0; i < ARRAY_SIZE(colors); ++i) {
color_t col = colors[i];
- igt_info("Testing color (%.2f, %.2f, %.2f) ...\n", col.r, col.g,
+ igt_info("Testing color (%.2f, %.2f, %.2f) with primary and cursor plane...\n", col.r, col.g,
col.b);
draw_color(&afb, col.r, col.g, col.b);
+ draw_color(&cfb, col.r, col.g, col.b);
set_regamma_lut(data, NULL);
set_degamma_lut(data, NULL);
@@ -384,10 +394,12 @@ static void test_crtc_lut_accuracy(data_t *data)
set_regamma_lut(data, NULL);
test_fini(data);
igt_remove_fb(data->fd, &afb);
+ igt_remove_fb(data->fd, &cfb);
lut_free(&lut_regamma);
lut_free(&lut_degamma);
}
+
igt_main
{
data_t data;
--
2.47.2
More information about the igt-dev
mailing list