public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 4/5] lib/igt_fb: Nuke redundant rendercopy cairo surface variant
Date: Thu, 18 Apr 2019 15:12:14 +0300	[thread overview]
Message-ID: <20190418121214.20896-1-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190417203544.22298-4-ville.syrjala@linux.intel.com>

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

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

v2: s/__blit/__gpu/ (Chris)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_fb.c | 51 ++++++---------------------------------------------
 1 file changed, 6 insertions(+), 45 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 766e504d5fce..292c19d28c1a 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1708,18 +1708,7 @@ static void free_linear_mapping(struct fb_blit_upload *blit)
 	}
 }
 
-static void destroy_cairo_surface__blit(void *arg)
-{
-	struct fb_blit_upload *blit = arg;
-
-	blit->fb->cairo_surface = NULL;
-
-	free_linear_mapping(blit);
-
-	free(blit);
-}
-
-static void destroy_cairo_surface__rendercopy(void *arg)
+static void destroy_cairo_surface__gpu(void *arg)
 {
 	struct fb_blit_upload *blit = arg;
 
@@ -1775,7 +1764,7 @@ static void setup_linear_mapping(struct fb_blit_upload *blit)
 				    0, linear->fb.size, PROT_READ | PROT_WRITE);
 }
 
-static void create_cairo_surface__blit(int fd, struct igt_fb *fb)
+static void create_cairo_surface__gpu(int fd, struct igt_fb *fb)
 {
 	struct fb_blit_upload *blit;
 	cairo_format_t cairo_format;
@@ -1796,34 +1785,8 @@ static void create_cairo_surface__blit(int fd, struct igt_fb *fb)
 	fb->domain = I915_GEM_DOMAIN_GTT;
 
 	cairo_surface_set_user_data(fb->cairo_surface,
-				    (cairo_user_data_key_t *)create_cairo_surface__blit,
-				    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);
+				    (cairo_user_data_key_t *)create_cairo_surface__gpu,
+				    blit, destroy_cairo_surface__gpu);
 }
 
 /**
@@ -2885,10 +2848,8 @@ 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))
-			create_cairo_surface__blit(fd, fb);
+		else if (use_blitter(fb) || use_rendercopy(fb))
+			create_cairo_surface__gpu(fd, fb);
 		else
 			create_cairo_surface__gtt(fd, fb);
 
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-04-18 12:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 20:35 [igt-dev] [PATCH i-g-t 1/5] lib/igt_fb: Unref the renderecopy scratch bos Ville Syrjala
2019-04-17 20:35 ` [igt-dev] [PATCH i-g-t 2/5] tests/i915/gem_render_copy: Don't leak bos between subtests Ville Syrjala
2019-04-17 20:41   ` Chris Wilson
2019-04-18 12:11   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2019-04-17 20:35 ` [igt-dev] [PATCH i-g-t 3/5] lib/intel_batchbuffer: Make blitter asserts more useful Ville Syrjala
2019-04-17 20:46   ` Chris Wilson
2019-04-18 11:52     ` Ville Syrjälä
2019-04-18 12:11   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2019-04-17 20:35 ` [igt-dev] [PATCH i-g-t 4/5] lib/igt_fb: Nuke redundant rendercopy cairo surface variant Ville Syrjala
2019-04-17 20:47   ` Chris Wilson
2019-04-18 11:53     ` Ville Syrjälä
2019-04-18 12:12   ` Ville Syrjala [this message]
2019-04-17 20:35 ` [igt-dev] [PATCH i-g-t 5/5] lib/igt_fb: Fix blitter limit checks Ville Syrjala
2019-04-17 20:52   ` Chris Wilson
2019-04-18 12:07     ` Ville Syrjälä
2019-04-18 12:12   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2019-04-17 20:38 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_fb: Unref the renderecopy scratch bos Chris Wilson
2019-04-18 11:51   ` Ville Syrjälä
2019-04-17 22:55 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/5] " Patchwork
2019-04-18 12:09 ` [igt-dev] [PATCH i-g-t v2 1/5] " Ville Syrjala
2019-04-18 12:50 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/5] lib/igt_fb: Unref the renderecopy scratch bos (rev6) Patchwork
2019-04-18 15:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190418121214.20896-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox