freedreno/drm: disallow exported buffers in bo cache
authorRob Clark <robdclark@chromium.org>
Tue, 19 May 2020 15:27:04 +0000 (08:27 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 25 May 2020 20:47:24 +0000 (20:47 +0000)
Otherwise we can MADVISE(WONTNEED) a bo that someone else is still
using.  We already handled that in the dma-buf and flink-name export
paths.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5204>

src/freedreno/drm/freedreno_bo.c

index b6d5cdd9bec254ee1f7b5f80e15956e3b0886756..862465cfe43c5eea3e001c37fc67ec417d911264 100644 (file)
@@ -318,6 +318,7 @@ int fd_bo_get_name(struct fd_bo *bo, uint32_t *name)
 
 uint32_t fd_bo_handle(struct fd_bo *bo)
 {
+       bo->bo_reuse = NO_CACHE;
        return bo->handle;
 }