[igt-dev] [PATCH i-g-t v4 1/2] tests/i915/kms_draw_crc-replacing drmModeRmFb with igt_remove_fb.
Ananya Sharma
ananya.sharma at intel.com
Thu Feb 24 12:46:32 UTC 2022
Signed-off-by: Ananya Sharma <ananya.sharma at intel.com>
---
tests/i915/kms_draw_crc.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/tests/i915/kms_draw_crc.c b/tests/i915/kms_draw_crc.c
index 82c368e1..7072c572 100644
--- a/tests/i915/kms_draw_crc.c
+++ b/tests/i915/kms_draw_crc.c
@@ -156,21 +156,14 @@ static void get_method_crc(enum igt_draw_method method, uint32_t drm_format,
static bool format_is_supported(uint32_t format, uint64_t modifier)
{
- uint32_t gem_handle, fb_id;
- unsigned int offsets[4] = {};
- unsigned int strides[4] = {};
- int ret;
-
- gem_handle = igt_create_bo_with_dimensions(drm_fd, 64, 64,
- format, modifier,
- 0, NULL, &strides[0], NULL);
- 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);
- gem_close(drm_fd, gem_handle);
-
- return ret == 0;
+ struct igt_fb fb;
+ unsigned int fd_id;
+
+ fd_id = igt_create_fb(drm_fd, 64, 64, format, modifier, &fb);
+
+ igt_remove_fb(drm_fd, &fb);
+
+ return fd_id >= 0;
}
static void draw_method_subtest(enum igt_draw_method method,
--
2.25.1
More information about the igt-dev
mailing list