Commit 53fddaf7 authored by John Harrison's avatar John Harrison Committed by Daniel Vetter

drm/i915: Update ring->dispatch_execbuffer() to take a request structure

Updated the various ring->dispatch_execbuffer() implementations to take a
request instead of a ring.

For: VIZ-5115
Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarTomas Elf <tomas.elf@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c4e76638
...@@ -1328,14 +1328,14 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params, ...@@ -1328,14 +1328,14 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params,
if (ret) if (ret)
goto error; goto error;
ret = ring->dispatch_execbuffer(ring, ret = ring->dispatch_execbuffer(params->request,
exec_start, exec_len, exec_start, exec_len,
params->dispatch_flags); params->dispatch_flags);
if (ret) if (ret)
goto error; goto error;
} }
} else { } else {
ret = ring->dispatch_execbuffer(ring, ret = ring->dispatch_execbuffer(params->request,
exec_start, exec_len, exec_start, exec_len,
params->dispatch_flags); params->dispatch_flags);
if (ret) if (ret)
......
...@@ -164,8 +164,7 @@ int i915_gem_render_state_init(struct drm_i915_gem_request *req) ...@@ -164,8 +164,7 @@ int i915_gem_render_state_init(struct drm_i915_gem_request *req)
if (so.rodata == NULL) if (so.rodata == NULL)
return 0; return 0;
ret = req->ring->dispatch_execbuffer(req->ring, ret = req->ring->dispatch_execbuffer(req, so.ggtt_offset,
so.ggtt_offset,
so.rodata->batch_items * 4, so.rodata->batch_items * 4,
I915_DISPATCH_SECURE); I915_DISPATCH_SECURE);
if (ret) if (ret)
......
...@@ -1760,10 +1760,11 @@ gen8_ring_put_irq(struct intel_engine_cs *ring) ...@@ -1760,10 +1760,11 @@ gen8_ring_put_irq(struct intel_engine_cs *ring)
} }
static int static int
i965_dispatch_execbuffer(struct intel_engine_cs *ring, i965_dispatch_execbuffer(struct drm_i915_gem_request *req,
u64 offset, u32 length, u64 offset, u32 length,
unsigned dispatch_flags) unsigned dispatch_flags)
{ {
struct intel_engine_cs *ring = req->ring;
int ret; int ret;
ret = intel_ring_begin(ring, 2); ret = intel_ring_begin(ring, 2);
...@@ -1786,10 +1787,11 @@ i965_dispatch_execbuffer(struct intel_engine_cs *ring, ...@@ -1786,10 +1787,11 @@ i965_dispatch_execbuffer(struct intel_engine_cs *ring,
#define I830_TLB_ENTRIES (2) #define I830_TLB_ENTRIES (2)
#define I830_WA_SIZE max(I830_TLB_ENTRIES*4096, I830_BATCH_LIMIT) #define I830_WA_SIZE max(I830_TLB_ENTRIES*4096, I830_BATCH_LIMIT)
static int static int
i830_dispatch_execbuffer(struct intel_engine_cs *ring, i830_dispatch_execbuffer(struct drm_i915_gem_request *req,
u64 offset, u32 len, u64 offset, u32 len,
unsigned dispatch_flags) unsigned dispatch_flags)
{ {
struct intel_engine_cs *ring = req->ring;
u32 cs_offset = ring->scratch.gtt_offset; u32 cs_offset = ring->scratch.gtt_offset;
int ret; int ret;
...@@ -1848,10 +1850,11 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring, ...@@ -1848,10 +1850,11 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring,
} }
static int static int
i915_dispatch_execbuffer(struct intel_engine_cs *ring, i915_dispatch_execbuffer(struct drm_i915_gem_request *req,
u64 offset, u32 len, u64 offset, u32 len,
unsigned dispatch_flags) unsigned dispatch_flags)
{ {
struct intel_engine_cs *ring = req->ring;
int ret; int ret;
ret = intel_ring_begin(ring, 2); ret = intel_ring_begin(ring, 2);
...@@ -2423,10 +2426,11 @@ static int gen6_bsd_ring_flush(struct drm_i915_gem_request *req, ...@@ -2423,10 +2426,11 @@ static int gen6_bsd_ring_flush(struct drm_i915_gem_request *req,
} }
static int static int
gen8_ring_dispatch_execbuffer(struct intel_engine_cs *ring, gen8_ring_dispatch_execbuffer(struct drm_i915_gem_request *req,
u64 offset, u32 len, u64 offset, u32 len,
unsigned dispatch_flags) unsigned dispatch_flags)
{ {
struct intel_engine_cs *ring = req->ring;
bool ppgtt = USES_PPGTT(ring->dev) && bool ppgtt = USES_PPGTT(ring->dev) &&
!(dispatch_flags & I915_DISPATCH_SECURE); !(dispatch_flags & I915_DISPATCH_SECURE);
int ret; int ret;
...@@ -2446,10 +2450,11 @@ gen8_ring_dispatch_execbuffer(struct intel_engine_cs *ring, ...@@ -2446,10 +2450,11 @@ gen8_ring_dispatch_execbuffer(struct intel_engine_cs *ring,
} }
static int static int
hsw_ring_dispatch_execbuffer(struct intel_engine_cs *ring, hsw_ring_dispatch_execbuffer(struct drm_i915_gem_request *req,
u64 offset, u32 len, u64 offset, u32 len,
unsigned dispatch_flags) unsigned dispatch_flags)
{ {
struct intel_engine_cs *ring = req->ring;
int ret; int ret;
ret = intel_ring_begin(ring, 2); ret = intel_ring_begin(ring, 2);
...@@ -2468,10 +2473,11 @@ hsw_ring_dispatch_execbuffer(struct intel_engine_cs *ring, ...@@ -2468,10 +2473,11 @@ hsw_ring_dispatch_execbuffer(struct intel_engine_cs *ring,
} }
static int static int
gen6_ring_dispatch_execbuffer(struct intel_engine_cs *ring, gen6_ring_dispatch_execbuffer(struct drm_i915_gem_request *req,
u64 offset, u32 len, u64 offset, u32 len,
unsigned dispatch_flags) unsigned dispatch_flags)
{ {
struct intel_engine_cs *ring = req->ring;
int ret; int ret;
ret = intel_ring_begin(ring, 2); ret = intel_ring_begin(ring, 2);
......
...@@ -194,7 +194,7 @@ struct intel_engine_cs { ...@@ -194,7 +194,7 @@ struct intel_engine_cs {
bool lazy_coherency); bool lazy_coherency);
void (*set_seqno)(struct intel_engine_cs *ring, void (*set_seqno)(struct intel_engine_cs *ring,
u32 seqno); u32 seqno);
int (*dispatch_execbuffer)(struct intel_engine_cs *ring, int (*dispatch_execbuffer)(struct drm_i915_gem_request *req,
u64 offset, u32 length, u64 offset, u32 length,
unsigned dispatch_flags); unsigned dispatch_flags);
#define I915_DISPATCH_SECURE 0x1 #define I915_DISPATCH_SECURE 0x1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment