[Intel-gfx] [PATCH igt 4/6] lib/igt_draw: use igt_drm_format_to_bpp()

Paulo Zanoni paulo.r.zanoni at intel.com
Tue Jan 26 05:29:02 PST 2016


Don't reimplement the function.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
---
 lib/igt_draw.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index f85e376..45fa10f 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -594,20 +594,6 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
 	}
 }
 
-static int get_format_bpp(uint32_t drm_format)
-{
-	switch (drm_format) {
-	case DRM_FORMAT_RGB565:
-		return 16;
-	case DRM_FORMAT_XRGB8888:
-	case DRM_FORMAT_ARGB8888:
-	case DRM_FORMAT_XRGB2101010:
-		return 32;
-	default:
-		igt_assert(false);
-	}
-}
-
 /**
  * igt_draw_rect_fb:
  * @fd: the DRM file descriptor
@@ -632,7 +618,7 @@ void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
 {
 	igt_draw_rect(fd, bufmgr, context, fb->gem_handle, fb->size, fb->stride,
 		      method, rect_x, rect_y, rect_w, rect_h, color,
-		      get_format_bpp(fb->drm_format));
+		      igt_drm_format_to_bpp(fb->drm_format));
 }
 
 /**
-- 
2.7.0.rc3



More information about the Intel-gfx mailing list