mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-07 01:48:02 +02:00
[intel-gem] Wait for rendering to complete before unbinding.
Moving to the CPU domain doesn't ensure that rendering is finished, the buffer may still be in use as a texture or other data source.
This commit is contained in:
parent
8b9ab108ec
commit
73bc18cad8
1 changed files with 13 additions and 0 deletions
|
|
@ -688,6 +688,19 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
|
|||
if (obj_priv->gtt_space == NULL)
|
||||
return 0;
|
||||
|
||||
if (obj_priv->pin_count != 0) {
|
||||
DRM_ERROR("Attempting to unbind pinned buffer\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Wait for any rendering to complete
|
||||
*/
|
||||
ret = i915_gem_object_wait_rendering(obj);
|
||||
if (ret) {
|
||||
DRM_ERROR ("wait_rendering failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Move the object to the CPU domain to ensure that
|
||||
* any possible CPU writes while it's not in the GTT
|
||||
* are flushed when we go to remap it. This will
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue