diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-01-25 21:04:37 -0200 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-01-29 16:28:47 -0200 |
commit | 096e020743b7e5500e36c4be73512ca548955829 (patch) | |
tree | d9a13b03c77515112703985599313984cfb6021c /tests/kms_frontbuffer_tracking.c | |
parent | be6f3fadaf2c45972f7a9830baa6fd35f4d755a6 (diff) |
kms_frontbuffer_tracking: use igt_drm_format_to_bpp()
The only format from fb_get_bpp() not supported by
igt_drm_format_to_bpp() is ARGB2101010, but we don't really use it in
kms_frontbuffer_tracking, so we can do the switch.
Adding ARGB2101010 to igt_fb won't be that simple since there's no
equivalent Cairo format, and igt_fb users assume that all formats
known by igt_fb have equivalent Cairo formats.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests/kms_frontbuffer_tracking.c')
-rw-r--r-- | tests/kms_frontbuffer_tracking.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index e7acc7ca..c8190197 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -1102,21 +1102,6 @@ static void *busy_thread_func(void *data) pthread_exit(0); } -static int fb_get_bpp(struct igt_fb *fb) -{ - switch (fb->drm_format) { - case DRM_FORMAT_RGB565: - return 16; - case DRM_FORMAT_XRGB8888: - case DRM_FORMAT_ARGB8888: - case DRM_FORMAT_ARGB2101010: - case DRM_FORMAT_XRGB2101010: - return 32; - default: - igt_assert(false); - } -} - static void start_busy_thread(struct igt_fb *fb) { int rc; @@ -1129,7 +1114,7 @@ static void start_busy_thread(struct igt_fb *fb) busy_thread.width = fb->width; busy_thread.height = fb->height; busy_thread.color = pick_color(fb, COLOR_PRIM_BG); - busy_thread.bpp = fb_get_bpp(fb); + busy_thread.bpp = igt_drm_format_to_bpp(fb->drm_format); rc = pthread_create(&busy_thread.thread, NULL, busy_thread_func, NULL); igt_assert_eq(rc, 0); |