[igt-dev] [PATCH i-g-t v3 2/2] tests/kms_draw_crc: replacing drmModeRmFb with igt_remove_fb

Ananya Sharma ananya.sharma at intel.com
Fri Dec 24 16:17:44 UTC 2021


Signed-off-by: Ananya Sharma <ananya.sharma at intel.com>
---
 tests/i915/kms_draw_crc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/i915/kms_draw_crc.c b/tests/i915/kms_draw_crc.c
index 82c368e1..c76acad7 100644
--- a/tests/i915/kms_draw_crc.c
+++ b/tests/i915/kms_draw_crc.c
@@ -160,6 +160,10 @@ static bool format_is_supported(uint32_t format, uint64_t modifier)
 	unsigned int offsets[4] = {};
 	unsigned int strides[4] = {};
 	int ret;
+	struct igt_fb fb;
+	igt_create_fb(drm_fd, ms.mode->hdisplay, ms.mode->vdisplay,
+                      format, modifier, &fb);
+
 
 	gem_handle = igt_create_bo_with_dimensions(drm_fd, 64, 64,
 						   format, modifier,
@@ -167,7 +171,7 @@ static bool format_is_supported(uint32_t format, uint64_t modifier)
 	ret =  __kms_addfb(drm_fd, gem_handle, 64, 64,
 			   format, modifier, strides, offsets, 1,
 			   DRM_MODE_FB_MODIFIERS, &fb_id);
-	drmModeRmFB(drm_fd, fb_id);
+	igt_remove_fb(drm_fd, &fb);
 	gem_close(drm_fd, gem_handle);
 
 	return ret == 0;
-- 
2.25.1



More information about the igt-dev mailing list