[Intel-gfx] [PATCH] drm/i915: Perform a flush on throttle.

Eric Anholt eric at anholt.net
Fri Feb 13 21:18:48 CET 2009


On Wed, 2009-02-11 at 14:26 +0000, Chris Wilson wrote:
> Add a flush on every throttle to ensure that the output is written at
> least once every frame. The reason for performing the flush in the
> kernel is to take advantage of the amalgamation of pending flushes,
> and saves allocation, by the application, of a batch buffer simply to
> emit a MI_FLUSH.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_gem.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 40bfbe9..cece254 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2461,8 +2461,11 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file_priv)
>  
>  	mutex_lock(&dev->struct_mutex);
>  	seqno = i915_file_priv->mm.last_gem_throttle_seqno;
> -	i915_file_priv->mm.last_gem_throttle_seqno =
> -		i915_file_priv->mm.last_gem_seqno;
> +	if (i915_file_priv->mm.last_gem_seqno > seqno) {
> +		i915_gem_flush(dev, I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS);
> +		i915_file_priv->mm.last_gem_throttle_seqno =
> +			i915_add_request(dev, I915_GEM_GPU_DOMAINS);
> +	}
>  	if (seqno)
>  		ret = i915_wait_request(dev, seqno);
>  	mutex_unlock(&dev->struct_mutex);

I don't really like this one.  The point of this ioctl is just to keep
an individual application from getting too far ahead of itself (and
starving interactivity of others in the process) -- I don't really want
it to be a cache management ioctl.  In particular, having the X Server
doing this on blockhandler means that whenever you ask it for some
information, your GPU read caches are blown away -- ouch!

An application that found the allocation of batches to MI_FLUSH to be
too expensive could simply reuse an existing BO containing just the
MI_FLUSH.

-- 
Eric Anholt
eric at anholt.net                         eric.anholt at intel.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090213/3b494bdf/attachment.sig>


More information about the Intel-gfx mailing list