[igt-dev] [PATCH] tests/kms_addfb_basic: Test addfb2 with DRM_FORMAT_C8 only if supported.
Mark Yacoub
markyacoub at chromium.org
Thu Jul 8 19:51:30 UTC 2021
From: Mark Yacoub <markyacoub at google.com>
[Why]
Some devices such as Trogdor do not support DRM_FORMAT_C8 pixel format.
Skip any addfb2 test on such devices that is expected to succeed such as
subtest size-max.
[How]
Only run the check on devices with DRM_FORMAT_C8 support
Tested on ChromeOS Trogdor
Signed-off-by: Mark Yacoub <markyacoub at chromium.org>
---
tests/kms_addfb_basic.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
index 91fb6ac9..a76c07d1 100644
--- a/tests/kms_addfb_basic.c
+++ b/tests/kms_addfb_basic.c
@@ -410,6 +410,7 @@ static void size_tests(int fd)
struct drm_mode_fb_cmd2 f_16 = {};
struct drm_mode_fb_cmd2 f_8 = {};
struct drm_mode_fb_cmd2 *framebuffers[] = {&f, &f_16, &f_8};
+ igt_display_t display;
int i;
f.width = 1024;
@@ -428,6 +429,8 @@ static void size_tests(int fd)
f_8.pitches[0] = 1024*2;
igt_fixture {
+ igt_display_require(&display, fd);
+
gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024,
DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL);
igt_assert(gem_bo);
@@ -440,17 +443,19 @@ static void size_tests(int fd)
f_16.handles[0] = gem_bo;
f_8.handles[0] = gem_bo;
- igt_describe("Check if addfb2 call works with max size of buffer object");
+ igt_describe("Check if addfb2 call works with max size of buffer object");
igt_subtest("size-max") {
igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0);
igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0);
f.fb_id = 0;
igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_16) == 0);
igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_16.fb_id) == 0);
- f.fb_id = 0;
- igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_8) == 0);
- igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_8.fb_id) == 0);
- f.fb_id = 0;
+ f_16.fb_id = 0;
+ if (igt_display_has_format_mod(&display, DRM_FORMAT_C8, 0)) {
+ igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_8) == 0);
+ igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_8.fb_id) == 0);
+ f_8.fb_id = 0;
+ }
}
f.width++;
--
2.32.0.93.g670b81a890-goog
More information about the igt-dev
mailing list