[Intel-gfx] [PATCH] drm/i915: Mark pinned objects as busy.

Eric Anholt eric at anholt.net
Fri Feb 20 21:00:54 CET 2009


On Fri, 2009-02-20 at 16:33 +0000, Chris Wilson wrote:
> A pinned object, such as a scan-out buffer, needs to be marked as busy,
> to prevent reuse via the bo cache within libdrm.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_gem.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index a1c0950..094a823 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3019,7 +3019,8 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
>  	 * consumer of this interface, OpenGL's occlusion queries, also specs
>  	 * that the objects get unbusy "eventually" without any interference.
>  	 */
> -	args->busy = obj_priv->active && obj_priv->last_rendering_seqno != 0;
> +	args->busy = obj_priv->pin_count != 0 ||
> +	             (obj_priv->active && obj_priv->last_rendering_seqno != 0);
>  
>  	drm_gem_object_unreference(obj);
>  	mutex_unlock(&dev->struct_mutex);

How would a pinned object end up in the BO cache?

Seems like either you freed it while pinned (shouldn't be doing that),
or you named the object and somebody else pinned it and then you
unreffed, in which case it's named and shouldn't end up in the BO cache.

-- 
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/20090220/d9605a97/attachment.sig>


More information about the Intel-gfx mailing list