Skip to content

Commit

Permalink
drm/i915: Don't return busy for buffers left on the flushing list.
Browse files Browse the repository at this point in the history
These buffers don't have active rendering still occurring to them, they just
need either a flush to be emitted or a retire_requests to occur so that we
notice they're done.  Return unbusy so that one of the two occurs.  The two
expected consumers of this interface (OpenGL and libdrm_intel BO cache) both
want this behavior.

Signed-off-by: Eric Anholt <[email protected]>
Acked-by: Keith Packard <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
anholt authored and airlied committed Dec 19, 2008
1 parent 929096f commit c4de0a5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,14 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
}

obj_priv = obj->driver_private;
args->busy = obj_priv->active;
/* Don't count being on the flushing list against the object being
* done. Otherwise, a buffer left on the flushing list but not getting
* flushed (because nobody's flushing that domain) won't ever return
* unbusy and get reused by libdrm's bo cache. The other expected
* 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;

drm_gem_object_unreference(obj);
mutex_unlock(&dev->struct_mutex);
Expand Down

0 comments on commit c4de0a5

Please sign in to comment.