drm/i915: Trim the flush for the legacy request emission
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 29 Apr 2016 08:07:05 +0000 (09:07 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 29 Apr 2016 09:20:51 +0000 (10:20 +0100)
At the start of request emission, we flush some space for the request,
estimating the typical size for the request body. The tail is now much
larger than the typical body, so we can shrink the flush slightly.

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-2-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_ringbuffer.c

index b5e79ac29ebc9e824a6855e009f88dac3e557522..c7637ceec1f429c8736f7a5e3799a2ef9b472839 100644 (file)
 #include "i915_trace.h"
 #include "intel_drv.h"
 
+/* Rough estimate of the typical request size, performing a flush,
+ * set-context and then emitting the batch.
+ */
+#define LEGACY_REQUEST_SIZE 200
+
 int __intel_ring_space(int head, int tail, int size)
 {
        int space = head - tail;
@@ -2345,7 +2350,7 @@ int intel_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 += LEGACY_REQUEST_SIZE;
 
        request->ringbuf = request->engine->buffer;
 
@@ -2353,7 +2358,7 @@ int intel_ring_alloc_request_extras(struct drm_i915_gem_request *request)
        if (ret)
                return ret;
 
-       request->reserved_space -= MIN_SPACE_FOR_ADD_REQUEST;
+       request->reserved_space -= LEGACY_REQUEST_SIZE;
        return 0;
 }