提交 2f20055d 编写于 作者: J John Harrison 提交者: Daniel Vetter

drm/i915: Update a bunch of execbuffer helpers to take request structures

Updated *_ring_invalidate_all_caches(), i915_reset_gen7_sol_offsets() and
i915_emit_box() to take request structures instead of ring or ringbuf/context
pairs.

For: VIZ-5115
Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: NTomas Elf <tomas.elf@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 1d719cda
...@@ -924,7 +924,7 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req, ...@@ -924,7 +924,7 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
/* Unconditionally invalidate gpu caches and ensure that we do flush /* Unconditionally invalidate gpu caches and ensure that we do flush
* any residual writes from the previous batch. * any residual writes from the previous batch.
*/ */
return intel_ring_invalidate_all_caches(req->ring); return intel_ring_invalidate_all_caches(req);
} }
static bool static bool
...@@ -1071,8 +1071,9 @@ i915_gem_execbuffer_retire_commands(struct i915_execbuffer_params *params) ...@@ -1071,8 +1071,9 @@ i915_gem_execbuffer_retire_commands(struct i915_execbuffer_params *params)
static int static int
i915_reset_gen7_sol_offsets(struct drm_device *dev, i915_reset_gen7_sol_offsets(struct drm_device *dev,
struct intel_engine_cs *ring) struct drm_i915_gem_request *req)
{ {
struct intel_engine_cs *ring = req->ring;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
int ret, i; int ret, i;
...@@ -1097,10 +1098,11 @@ i915_reset_gen7_sol_offsets(struct drm_device *dev, ...@@ -1097,10 +1098,11 @@ i915_reset_gen7_sol_offsets(struct drm_device *dev,
} }
static int static int
i915_emit_box(struct intel_engine_cs *ring, i915_emit_box(struct drm_i915_gem_request *req,
struct drm_clip_rect *box, struct drm_clip_rect *box,
int DR1, int DR4) int DR1, int DR4)
{ {
struct intel_engine_cs *ring = req->ring;
int ret; int ret;
if (box->y2 <= box->y1 || box->x2 <= box->x1 || if (box->y2 <= box->y1 || box->x2 <= box->x1 ||
...@@ -1310,7 +1312,7 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params, ...@@ -1310,7 +1312,7 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params,
} }
if (args->flags & I915_EXEC_GEN7_SOL_RESET) { if (args->flags & I915_EXEC_GEN7_SOL_RESET) {
ret = i915_reset_gen7_sol_offsets(dev, ring); ret = i915_reset_gen7_sol_offsets(dev, params->request);
if (ret) if (ret)
goto error; goto error;
} }
...@@ -1321,7 +1323,7 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params, ...@@ -1321,7 +1323,7 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params,
if (cliprects) { if (cliprects) {
for (i = 0; i < args->num_cliprects; i++) { for (i = 0; i < args->num_cliprects; i++) {
ret = i915_emit_box(ring, &cliprects[i], ret = i915_emit_box(params->request, &cliprects[i],
args->DR1, args->DR4); args->DR1, args->DR4);
if (ret) if (ret)
goto error; goto error;
......
...@@ -604,10 +604,9 @@ static int execlists_context_queue(struct intel_engine_cs *ring, ...@@ -604,10 +604,9 @@ static int execlists_context_queue(struct intel_engine_cs *ring,
return 0; return 0;
} }
static int logical_ring_invalidate_all_caches(struct intel_ringbuffer *ringbuf, static int logical_ring_invalidate_all_caches(struct drm_i915_gem_request *req)
struct intel_context *ctx)
{ {
struct intel_engine_cs *ring = ringbuf->ring; struct intel_engine_cs *ring = req->ring;
uint32_t flush_domains; uint32_t flush_domains;
int ret; int ret;
...@@ -615,7 +614,7 @@ static int logical_ring_invalidate_all_caches(struct intel_ringbuffer *ringbuf, ...@@ -615,7 +614,7 @@ static int logical_ring_invalidate_all_caches(struct intel_ringbuffer *ringbuf,
if (ring->gpu_caches_dirty) if (ring->gpu_caches_dirty)
flush_domains = I915_GEM_GPU_DOMAINS; flush_domains = I915_GEM_GPU_DOMAINS;
ret = ring->emit_flush(ringbuf, ctx, ret = ring->emit_flush(req->ringbuf, req->ctx,
I915_GEM_GPU_DOMAINS, flush_domains); I915_GEM_GPU_DOMAINS, flush_domains);
if (ret) if (ret)
return ret; return ret;
...@@ -654,7 +653,7 @@ static int execlists_move_to_gpu(struct drm_i915_gem_request *req, ...@@ -654,7 +653,7 @@ static int execlists_move_to_gpu(struct drm_i915_gem_request *req,
/* Unconditionally invalidate gpu caches and ensure that we do flush /* Unconditionally invalidate gpu caches and ensure that we do flush
* any residual writes from the previous batch. * any residual writes from the previous batch.
*/ */
return logical_ring_invalidate_all_caches(req->ringbuf, req->ctx); return logical_ring_invalidate_all_caches(req);
} }
int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request) int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request)
......
...@@ -2910,8 +2910,9 @@ intel_ring_flush_all_caches(struct intel_engine_cs *ring) ...@@ -2910,8 +2910,9 @@ intel_ring_flush_all_caches(struct intel_engine_cs *ring)
} }
int int
intel_ring_invalidate_all_caches(struct intel_engine_cs *ring) intel_ring_invalidate_all_caches(struct drm_i915_gem_request *req)
{ {
struct intel_engine_cs *ring = req->ring;
uint32_t flush_domains; uint32_t flush_domains;
int ret; int ret;
......
...@@ -446,7 +446,7 @@ bool intel_ring_stopped(struct intel_engine_cs *ring); ...@@ -446,7 +446,7 @@ bool intel_ring_stopped(struct intel_engine_cs *ring);
int __must_check intel_ring_idle(struct intel_engine_cs *ring); int __must_check intel_ring_idle(struct intel_engine_cs *ring);
void intel_ring_init_seqno(struct intel_engine_cs *ring, u32 seqno); void intel_ring_init_seqno(struct intel_engine_cs *ring, u32 seqno);
int intel_ring_flush_all_caches(struct intel_engine_cs *ring); int intel_ring_flush_all_caches(struct intel_engine_cs *ring);
int intel_ring_invalidate_all_caches(struct intel_engine_cs *ring); int intel_ring_invalidate_all_caches(struct drm_i915_gem_request *req);
void intel_fini_pipe_control(struct intel_engine_cs *ring); void intel_fini_pipe_control(struct intel_engine_cs *ring);
int intel_init_pipe_control(struct intel_engine_cs *ring); int intel_init_pipe_control(struct intel_engine_cs *ring);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册