diff mbox

[4/4] tests/gem_gtt_hog: Fix for BDW

Message ID 1391705667-13122-4-git-send-email-rodrigo.vivi@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi Feb. 6, 2014, 4:54 p.m. UTC
Update XY_COLOR_BLT command for Broadwell.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 tests/gem_gtt_hog.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

Comments

Chris Wilson Feb. 6, 2014, 5:15 p.m. UTC | #1
On Thu, Feb 06, 2014 at 02:54:27PM -0200, Rodrigo Vivi wrote:
> Update XY_COLOR_BLT command for Broadwell.

Please stash the result of intel_get_drm_device(fd) >= 8; it makes a
big mess if you are trying to debug using drm.debug=1
-Chris
Chris Wilson Feb. 6, 2014, 5:26 p.m. UTC | #2
On Thu, Feb 06, 2014 at 02:54:27PM -0200, Rodrigo Vivi wrote:
> Update XY_COLOR_BLT command for Broadwell.
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
> ---
>  tests/gem_gtt_hog.c | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c
> index 53cd7eb..d97658e 100644
> --- a/tests/gem_gtt_hog.c
> +++ b/tests/gem_gtt_hog.c
> @@ -57,17 +57,26 @@ static void busy(int fd, uint32_t handle, int size, int loops)
>  	struct drm_i915_gem_execbuffer2 execbuf;
>  	struct drm_i915_gem_pwrite gem_pwrite;
>  	struct drm_i915_gem_create create;
> -	uint32_t buf[122], *b;
> +	uint32_t buf[122], buf_bdw[170], *b;

Just allocate the one buffer large enough to take both and tweak the
length use to pwrite/exec.
-Chris
diff mbox

Patch

diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c
index 53cd7eb..d97658e 100644
--- a/tests/gem_gtt_hog.c
+++ b/tests/gem_gtt_hog.c
@@ -57,17 +57,26 @@  static void busy(int fd, uint32_t handle, int size, int loops)
 	struct drm_i915_gem_execbuffer2 execbuf;
 	struct drm_i915_gem_pwrite gem_pwrite;
 	struct drm_i915_gem_create create;
-	uint32_t buf[122], *b;
+	uint32_t buf[122], buf_bdw[170], *b;
 	int i;
 
 	memset(reloc, 0, sizeof(reloc));
 	memset(gem_exec, 0, sizeof(gem_exec));
 	memset(&execbuf, 0, sizeof(execbuf));
 
-	b = buf;
+	if (intel_get_drm_devid(fd) >= 8)
+		b = buf_bdw;
+	else
+		b = buf;
 	for (i = 0; i < 20; i++) {
-		*b++ = XY_COLOR_BLT_CMD_NOLEN | 4 |
-			COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB;
+		if (intel_get_drm_devid(fd) >= 8) {
+			*b++ = MI_NOOP;
+			*b++ = XY_COLOR_BLT_CMD_NOLEN | 4 |
+				COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB;
+		} else {
+			*b++ = XY_COLOR_BLT_CMD_NOLEN | 5 |
+				COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB;
+		}
 		*b++ = 0xf0 << 16 | 1 << 25 | 1 << 24 | 4096;
 		*b++ = 0;
 		*b++ = size >> 12 << 16 | 1024;
@@ -76,6 +85,8 @@  static void busy(int fd, uint32_t handle, int size, int loops)
 		reloc[i].read_domains = I915_GEM_DOMAIN_RENDER;
 		reloc[i].write_domain = I915_GEM_DOMAIN_RENDER;
 		*b++ = 0;
+		if (intel_get_drm_devid(fd) >= 8)
+			*b++ = 0;
 		*b++ = canary;
 	}
 	*b++ = MI_BATCH_BUFFER_END;