public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 3/3] lib/igt_draw: Pass bpp along to rendercopy.
Date: Fri, 16 Nov 2018 16:41:49 +0100	[thread overview]
Message-ID: <20181116154149.18155-3-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20181116154149.18155-1-maarten.lankhorst@linux.intel.com>

Now that rendercopy can perform copies for 8 bpp and 16 bpp, there's
no reason we have to skip on odd x/w any more for 16 bpp.

Pass the correct bpp to rendercopy, and prevent tests from skipping.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 lib/igt_draw.c | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 94f16632730d..7edfc56ecba4 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -573,16 +573,9 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
 	uint32_t tiling, swizzle;
 	struct buf_data tmp;
 	int pixel_size = buf->bpp / 8;
-	unsigned adjusted_w, adjusted_dst_x;
 
 	igt_skip_on(!rendercopy);
 
-	/* Rendercopy works at 32bpp, so if you try to do copies on buffers with
-	 * smaller bpps you won't succeeed if you need to copy "half" of a 32bpp
-	 * pixel or something similar. */
-	igt_skip_on(rect->x % (32 / buf->bpp) != 0 ||
-		    rect->w % (32 / buf->bpp) != 0);
-
 	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
 
 	/* We create a temporary buffer and copy from it using rendercopy. */
@@ -602,28 +595,18 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
 	src_buf.stride = tmp.stride;
 	src_buf.tiling = I915_TILING_NONE;
 	src_buf.size = tmp.size;
-	src_buf.bpp = 32;
+	src_buf.bpp = buf->bpp;
 	dst_buf.bo = dst;
 	dst_buf.stride = buf->stride;
 	dst_buf.tiling = tiling;
 	dst_buf.size = buf->size;
-	dst_buf.bpp = 32;
+	dst_buf.bpp = buf->bpp;
 
 	batch = intel_batchbuffer_alloc(cmd_data->bufmgr, devid);
 	igt_assert(batch);
 
-	switch (buf->bpp) {
-	case 16:
-	case 32:
-		adjusted_w = rect->w / (32 / buf->bpp);
-		adjusted_dst_x = rect->x / (32 / buf->bpp);
-		break;
-	default:
-		igt_assert(false);
-	}
-
-	rendercopy(batch, cmd_data->context, &src_buf, 0, 0, adjusted_w,
-		   rect->h, &dst_buf, adjusted_dst_x, rect->y);
+	rendercopy(batch, cmd_data->context, &src_buf, 0, 0, rect->w,
+		   rect->h, &dst_buf, rect->x, rect->y);
 
 	intel_batchbuffer_free(batch);
 	drm_intel_bo_unreference(src);
-- 
2.19.1

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

  parent reply	other threads:[~2018-11-16 15:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 15:41 [igt-dev] [PATCH i-g-t 1/3] lib/batchbuffer: Set bpp in igt_buf Maarten Lankhorst
2018-11-16 15:41 ` [igt-dev] [PATCH i-g-t 2/3] lib/rendercopy: Implement support for 8/16 bpp Maarten Lankhorst
2018-11-16 17:04   ` Ville Syrjälä
2018-11-16 15:41 ` Maarten Lankhorst [this message]
2018-11-16 17:06   ` [igt-dev] [PATCH i-g-t 3/3] lib/igt_draw: Pass bpp along to rendercopy Ville Syrjälä
2018-11-16 16:09 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] lib/batchbuffer: Set bpp in igt_buf Patchwork
2018-11-16 17:00 ` [igt-dev] [PATCH i-g-t 1/3] " Ville Syrjälä
2018-11-20 16:41   ` Maarten Lankhorst
2018-11-19 16:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] " Patchwork
2018-11-19 20:54 ` [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=20181116154149.18155-3-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@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