iris: Don't replace backing storage for exported buffers.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 30 Sep 2022 01:06:42 +0000 (18:06 -0700)
committerMarge Bot <emma+marge@anholt.net>
Fri, 9 Dec 2022 21:46:03 +0000 (21:46 +0000)
We already gave out the old BO...or acquired it from somewhere which
may be affecting it.  We simply can't replace the backing store.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19209>

src/gallium/drivers/iris/iris_resource.c

index c797ad0..5e994fd 100644 (file)
@@ -1943,6 +1943,10 @@ iris_invalidate_resource(struct pipe_context *ctx,
    if (res->bo->gem_handle && res->bo->real.userptr)
       return;
 
+   /* Nor can we allocate buffers we imported or exported. */
+   if (iris_bo_is_external(res->bo))
+      return;
+
    struct iris_bo *old_bo = res->bo;
    struct iris_bo *new_bo =
       iris_bo_alloc(screen->bufmgr, res->bo->name, resource->width0,