[PATCH i-g-t 16/22] tests/kms_plane: Adopt to use allocator

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri Jun 25 12:54:10 UTC 2021


Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_plane.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index f22c045d8c..707100604e 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -533,6 +533,8 @@ static void prepare_format_color(data_t *data, enum pipe pipe,
 				c->red, c->green, c->blue);
 
 	igt_put_cairo_ctx(cr);
+	if (is_i915_device(data->drm_fd))
+		put_offset(fb->ahnd, fb->alloc_offset);
 	igt_plane_set_fb(plane, fb);
 
 	/*
@@ -735,6 +737,8 @@ static bool test_format_plane_colors(data_t *data, enum pipe pipe,
 	int i, total_crcs = 1;
 	bool planar = igt_format_is_yuv_semiplanar(format);
 
+	if (is_i915_device(data->drm_fd))
+		fb->ahnd = get_reloc_ahnd(data->drm_fd, 0);
 	if (planar) {
 		capture_format_crcs_planar(data, pipe, plane, format, modifier,
 					   width, height, encoding, range, crc,
@@ -744,6 +748,8 @@ static bool test_format_plane_colors(data_t *data, enum pipe pipe,
 		capture_format_crcs_packed(data, pipe, plane, format, modifier,
 					   width, height, encoding, range, crc,
 					   fb);
+	if (is_i915_device(data->drm_fd))
+		put_ahnd(fb->ahnd);
 
 	for (i = 0; i < total_crcs; i++) {
 		if (!igt_check_crc_equal(&crc[i], &ref_crc[i])) {
@@ -913,6 +919,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 		igt_remove_fb(data->drm_fd, &test_fb);
 	}
 
+	if (is_i915_device(data->drm_fd))
+		fb.ahnd = get_reloc_ahnd(data->drm_fd, 0);
 	capture_format_crcs_packed(data, pipe, plane, ref.format, ref.modifier,
 				   width, height, IGT_COLOR_YCBCR_BT709,
 				   IGT_COLOR_YCBCR_LIMITED_RANGE,
@@ -923,6 +931,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 				   IGT_COLOR_YCBCR_LIMITED_RANGE,
 				   ref_crc[PLANAR_CRC_SET], &fb);
 
+	if (is_i915_device(data->drm_fd))
+		put_ahnd(fb.ahnd);
 	/*
 	 * Make sure we have some difference between the colors. This
 	 * at least avoids claiming success when everything is just
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list