aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <[email protected]>2016-04-29 09:07:05 +0100
committerChris Wilson <[email protected]>2016-04-29 10:20:51 +0100
commita0442461f2caa406ce77261214ec3217fe3cac22 (patch)
tree6153dd4fa4983c1cf37a6dc2e7dc87a82e01e86e
parent596e5efc690d832e476018763ae6363c55e21165 (diff)
drm/i915: Trim the flush for the legacy request emission
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 <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index b5e79ac29ebc..c7637ceec1f4 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -34,6 +34,11 @@
#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;
}