Skip to content

Commit

Permalink
drm/i915: Trim the flush for the legacy request emission
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Chris Wilson committed Apr 29, 2016
1 parent 596e5ef commit a044246
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2345,15 +2350,15 @@ 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;

ret = intel_ring_begin(request, 0);
if (ret)
return ret;

request->reserved_space -= MIN_SPACE_FOR_ADD_REQUEST;
request->reserved_space -= LEGACY_REQUEST_SIZE;
return 0;
}

Expand Down

0 comments on commit a044246

Please sign in to comment.