[igt-dev] [PATCH i-g-t 4/5] lib/igt_fb: Nuke redundant rendercopy cairo surface variant

Ville Syrjala ville.syrjala at linux.intel.com
Wed Apr 17 20:35:43 UTC 2019


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

The blit and rendercopy implementations are now identical.
Kill one.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 lib/igt_fb.c | 41 +----------------------------------------
 1 file changed, 1 insertion(+), 40 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index c3ecd7186444..794f0eef04a3 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1714,17 +1714,6 @@ static void destroy_cairo_surface__blit(void *arg)
 	free(blit);
 }
 
-static void destroy_cairo_surface__rendercopy(void *arg)
-{
-	struct fb_blit_upload *blit = arg;
-
-	blit->fb->cairo_surface = NULL;
-
-	free_linear_mapping(blit);
-
-	free(blit);
-}
-
 static void setup_linear_mapping(struct fb_blit_upload *blit)
 {
 	int fd = blit->fd;
@@ -1795,32 +1784,6 @@ static void create_cairo_surface__blit(int fd, struct igt_fb *fb)
 				    blit, destroy_cairo_surface__blit);
 }
 
-static void create_cairo_surface__rendercopy(int fd, struct igt_fb *fb)
-{
-	struct fb_blit_upload *blit;
-	cairo_format_t cairo_format;
-
-	blit = calloc(1, sizeof(*blit));
-	igt_assert(blit);
-
-	blit->fd = fd;
-	blit->fb = fb;
-
-	setup_linear_mapping(blit);
-
-	cairo_format = drm_format_to_cairo(fb->drm_format);
-	fb->cairo_surface =
-		cairo_image_surface_create_for_data(blit->linear.map,
-						    cairo_format,
-						    fb->width, fb->height,
-						    blit->linear.fb.strides[0]);
-	fb->domain = I915_GEM_DOMAIN_GTT;
-
-	cairo_surface_set_user_data(fb->cairo_surface,
-				    (cairo_user_data_key_t *)create_cairo_surface__rendercopy,
-				    blit, destroy_cairo_surface__rendercopy);
-}
-
 /**
  * igt_dirty_fb:
  * @fd: open drm file descriptor
@@ -2880,9 +2843,7 @@ cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb)
 		    ((f->cairo_id == CAIRO_FORMAT_INVALID) &&
 		     (f->pixman_id != PIXMAN_invalid)))
 			create_cairo_surface__convert(fd, fb);
-		else if (use_rendercopy(fb))
-			create_cairo_surface__rendercopy(fd, fb);
-		else if (use_blitter(fb))
+		else if (use_blitter(fb) || use_rendercopy(fb))
 			create_cairo_surface__blit(fd, fb);
 		else
 			create_cairo_surface__gtt(fd, fb);
-- 
2.21.0



More information about the igt-dev mailing list