mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 05:20:09 +01:00
i965/bufmgr: Skip wait ioctl when not busy.
If the buffer is idle, we I915_GEM_WAIT will return immediately, so we may as well skip the ioctl altogether. We can't trust the "idle" flag for external buffers, but for most, it should be fine. Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
38e2142f39
commit
bdae2ddff8
1 changed files with 4 additions and 0 deletions
|
|
@ -924,6 +924,10 @@ brw_bo_wait(struct brw_bo *bo, int64_t timeout_ns)
|
|||
struct drm_i915_gem_wait wait;
|
||||
int ret;
|
||||
|
||||
/* If we know it's idle, don't bother with the kernel round trip */
|
||||
if (bo->idle && !bo->external)
|
||||
return 0;
|
||||
|
||||
memclear(wait);
|
||||
wait.bo_handle = bo->gem_handle;
|
||||
wait.timeout_ns = timeout_ns;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue