diff options
author | John Harrison <John.C.Harrison@Intel.com> | 2014-04-09 13:05:40 +0100 |
---|---|---|
committer | John Harrison <John.C.Harrison@Intel.com> | 2016-05-06 14:12:54 +0100 |
commit | 5b5b8960b1a6609161a7c69a3524209d54e78a2f (patch) | |
tree | 86399956b6746b50ea7583ce134bf2f2a19cc1cf | |
parent | 567feb3b3e2b1803c3da77f6273f245717b8c432 (diff) |
drm/i915: Redirect execbuffer_final() via scheduler
Updated the execbuffer() code to pass the packaged up batch buffer
information to the scheduler rather than calling execbuffer_final()
directly. The scheduler queue() code is currently a stub which simply
chains on to _final() immediately.
v6: Updated to newer nightly (lots of ring -> engine renaming).
Renamed 'i915_gem_execbuff_release_batch_obj' to
'i915_gem_execbuf_release_batch_obj'. [review feedback from Joonas
Lahtinen]
For: VIZ-1587
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 12 |
2 files changed, 11 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index b77d554f41d2..1565ee5631d7 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -33,6 +33,7 @@ #include "intel_drv.h" #include <linux/dma_remapping.h> #include <linux/uaccess.h> +#include "i915_scheduler.h" #define __EXEC_OBJECT_HAS_PIN (1<<31) #define __EXEC_OBJECT_HAS_FENCE (1<<30) @@ -1230,6 +1231,7 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params, struct drm_i915_gem_execbuffer2 *args, struct list_head *vmas) { + struct i915_scheduler_queue_entry *qe; struct drm_device *dev = params->dev; struct intel_engine_cs *engine = params->engine; struct drm_i915_private *dev_priv = dev->dev_private; @@ -1274,17 +1276,11 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params, i915_gem_execbuffer_move_to_active(vmas, params->request); - ret = dev_priv->gt.execbuf_final(params); + qe = container_of(params, typeof(*qe), params); + ret = i915_scheduler_queue_execbuffer(qe); if (ret) return ret; - /* - * Free everything that was stored in the QE structure (until the - * scheduler arrives and does it instead): - */ - if (params->dispatch_flags & I915_DISPATCH_SECURE) - i915_gem_execbuf_release_batch_obj(params->batch_obj); - return 0; } @@ -1474,8 +1470,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, struct intel_engine_cs *engine; struct intel_context *ctx; struct i915_address_space *vm; - struct i915_execbuffer_params params_master; /* XXX: will be removed later */ - struct i915_execbuffer_params *params = ¶ms_master; + struct i915_scheduler_queue_entry qe; + struct i915_execbuffer_params *params = &qe.params; const u32 ctx_id = i915_execbuffer2_get_context_id(*args); u32 dispatch_flags; int ret; @@ -1541,7 +1537,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, else vm = &ggtt->base; - memset(¶ms_master, 0x00, sizeof(params_master)); + memset(&qe, 0x00, sizeof(qe)); eb = eb_create(args); if (eb == NULL) { diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 69df9487c30b..6bf0e3f21342 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -137,6 +137,7 @@ #include <drm/i915_drm.h> #include "i915_drv.h" #include "intel_mocs.h" +#include "i915_scheduler.h" #define GEN9_LR_CONTEXT_RENDER_SIZE (22 * PAGE_SIZE) #define GEN8_LR_CONTEXT_RENDER_SIZE (20 * PAGE_SIZE) @@ -942,6 +943,7 @@ int intel_execlists_submission(struct i915_execbuffer_params *params, struct drm_i915_gem_execbuffer2 *args, struct list_head *vmas) { + struct i915_scheduler_queue_entry *qe; struct drm_device *dev = params->dev; struct intel_engine_cs *engine = params->engine; struct drm_i915_private *dev_priv = dev->dev_private; @@ -984,17 +986,11 @@ int intel_execlists_submission(struct i915_execbuffer_params *params, i915_gem_execbuffer_move_to_active(vmas, params->request); - ret = dev_priv->gt.execbuf_final(params); + qe = container_of(params, typeof(*qe), params); + ret = i915_scheduler_queue_execbuffer(qe); if (ret) return ret; - /* - * Free everything that was stored in the QE structure (until the - * scheduler arrives and does it instead): - */ - if (params->dispatch_flags & I915_DISPATCH_SECURE) - i915_gem_execbuf_release_batch_obj(params->batch_obj); - return 0; } |