summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lrc.c
diff options
context:
space:
mode:
authorChris Wilson2016-04-29 10:07:06 +0200
committerChris Wilson2016-04-29 11:20:51 +0200
commit0e93cdd4a94c16f646ad7d10ed5d0ca64e8de424 (patch)
tree51a65acf4057ff501ddd26a38f4c33ed65a88f80 /drivers/gpu/drm/i915/intel_lrc.c
parentdrm/i915: Trim the flush for the legacy request emission (diff)
downloadkernel-qcow2-linux-0e93cdd4a94c16f646ad7d10ed5d0ca64e8de424.tar.gz
kernel-qcow2-linux-0e93cdd4a94c16f646ad7d10ed5d0ca64e8de424.tar.xz
kernel-qcow2-linux-0e93cdd4a94c16f646ad7d10ed5d0ca64e8de424.zip
drm/i915: Trim the flush for the execlists request emission
At the start of request emission, we flush some space for the request, estimating the typical size for the request body. The common tail is now much larger than the typical body, so we can shrink the flush substantially. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1461917226-9132-3-git-send-email-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lrc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 874c2515f9d4..ec2522243b5e 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -228,6 +228,9 @@ enum {
#define GEN8_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x17
#define GEN9_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x26
+/* Typical size of the average request (2 pipecontrols and a MI_BB) */
+#define EXECLISTS_REQUEST_SIZE 64 /* bytes */
+
static int execlists_context_deferred_alloc(struct intel_context *ctx,
struct intel_engine_cs *engine);
static int intel_lr_context_pin(struct intel_context *ctx,
@@ -681,7 +684,7 @@ int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request
* we start building the request - in which case we will just
* have to repeat work.
*/
- request->reserved_space += MIN_SPACE_FOR_ADD_REQUEST;
+ request->reserved_space += EXECLISTS_REQUEST_SIZE;
if (request->ctx->engine[engine->id].state == NULL) {
ret = execlists_context_deferred_alloc(request->ctx, engine);
@@ -727,7 +730,7 @@ int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request
* to cancel/unwind this request now.
*/
- request->reserved_space -= MIN_SPACE_FOR_ADD_REQUEST;
+ request->reserved_space -= EXECLISTS_REQUEST_SIZE;
return 0;
err_unpin: