* [Intel-gfx] [PATCH i-g-t] lib: Don't specify a non-existent blitter ring
@ 2020-02-18 14:47 Chris Wilson
2020-02-18 18:08 ` Antonio Argenziano
0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2020-02-18 14:47 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
I915_EXEC_BLT only exists on gen6+
Closes: https://gitlab.freedesktop.org/drm/intel/issues/1256
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
lib/intel_batchbuffer.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 5a00481cf..f1a45b473 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -695,20 +695,13 @@ fill_object(struct drm_i915_gem_exec_object2 *obj, uint32_t gem_handle,
static void exec_blit(int fd,
struct drm_i915_gem_exec_object2 *objs, uint32_t count,
- uint32_t batch_len /* in dwords */)
+ int gen)
{
- struct drm_i915_gem_execbuffer2 exec;
-
- exec.buffers_ptr = to_user_pointer(objs);
- exec.buffer_count = count;
- exec.batch_start_offset = 0;
- exec.batch_len = batch_len * 4;
- exec.DR1 = exec.DR4 = 0;
- exec.num_cliprects = 0;
- exec.cliprects_ptr = 0;
- exec.flags = I915_EXEC_BLT;
- i915_execbuffer2_set_context_id(exec, 0);
- exec.rsvd2 = 0;
+ struct drm_i915_gem_execbuffer2 exec = {
+ .buffers_ptr = to_user_pointer(objs),
+ .buffer_count = count,
+ .flags = gen >= 6 ? I915_EXEC_BLT : 0,
+ };
gem_execbuf(fd, &exec);
}
@@ -892,7 +885,7 @@ void igt_blitter_src_copy(int fd,
objs[0].flags |= EXEC_OBJECT_NEEDS_FENCE;
objs[1].flags |= EXEC_OBJECT_NEEDS_FENCE;
- exec_blit(fd, objs, 3, ARRAY_SIZE(batch));
+ exec_blit(fd, objs, 3, gen);
gem_close(fd, batch_handle);
}
@@ -985,7 +978,7 @@ void igt_blitter_fast_copy__raw(int fd,
fill_object(&objs[1], src_handle, NULL, 0);
fill_object(&objs[2], batch_handle, relocs, 2);
- exec_blit(fd, objs, 3, ARRAY_SIZE(batch));
+ exec_blit(fd, objs, 3, intel_gen(intel_get_drm_devid(fd)));
gem_close(fd, batch_handle);
}
--
2.25.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] lib: Don't specify a non-existent blitter ring
2020-02-18 14:47 [Intel-gfx] [PATCH i-g-t] lib: Don't specify a non-existent blitter ring Chris Wilson
@ 2020-02-18 18:08 ` Antonio Argenziano
0 siblings, 0 replies; 2+ messages in thread
From: Antonio Argenziano @ 2020-02-18 18:08 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: igt-dev
On 18/02/20 06:47, Chris Wilson wrote:
> I915_EXEC_BLT only exists on gen6+
>
> Closes: https://gitlab.freedesktop.org/drm/intel/issues/1256
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> lib/intel_batchbuffer.c | 23 ++++++++---------------
> 1 file changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index 5a00481cf..f1a45b473 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -695,20 +695,13 @@ fill_object(struct drm_i915_gem_exec_object2 *obj, uint32_t gem_handle,
>
> static void exec_blit(int fd,
> struct drm_i915_gem_exec_object2 *objs, uint32_t count,
> - uint32_t batch_len /* in dwords */)
> + int gen)
> {
> - struct drm_i915_gem_execbuffer2 exec;
> -
> - exec.buffers_ptr = to_user_pointer(objs);
> - exec.buffer_count = count;
> - exec.batch_start_offset = 0;
> - exec.batch_len = batch_len * 4;
> - exec.DR1 = exec.DR4 = 0;
> - exec.num_cliprects = 0;
> - exec.cliprects_ptr = 0;
> - exec.flags = I915_EXEC_BLT;
> - i915_execbuffer2_set_context_id(exec, 0);
> - exec.rsvd2 = 0;
> + struct drm_i915_gem_execbuffer2 exec = {
> + .buffers_ptr = to_user_pointer(objs),
> + .buffer_count = count,
> + .flags = gen >= 6 ? I915_EXEC_BLT : 0,
> + };
>
> gem_execbuf(fd, &exec);
> }
> @@ -892,7 +885,7 @@ void igt_blitter_src_copy(int fd,
> objs[0].flags |= EXEC_OBJECT_NEEDS_FENCE;
> objs[1].flags |= EXEC_OBJECT_NEEDS_FENCE;
>
> - exec_blit(fd, objs, 3, ARRAY_SIZE(batch));
> + exec_blit(fd, objs, 3, gen);
>
> gem_close(fd, batch_handle);
> }
> @@ -985,7 +978,7 @@ void igt_blitter_fast_copy__raw(int fd,
> fill_object(&objs[1], src_handle, NULL, 0);
> fill_object(&objs[2], batch_handle, relocs, 2);
>
> - exec_blit(fd, objs, 3, ARRAY_SIZE(batch));
> + exec_blit(fd, objs, 3, intel_gen(intel_get_drm_devid(fd)));
>
> gem_close(fd, batch_handle);
> }
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-18 18:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 14:47 [Intel-gfx] [PATCH i-g-t] lib: Don't specify a non-existent blitter ring Chris Wilson
2020-02-18 18:08 ` Antonio Argenziano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).