@@ -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);
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. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> --- tests/kms_frontbuffer_tracking.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-)