{
struct panfrost_screen *screen = bo->screen;
+ if (bo->flags & PAN_BO_DONT_REUSE)
+ return false;
+
pthread_mutex_lock(&screen->bo_cache_lock);
struct list_head *bucket = pan_bucket(screen, bo->size);
struct drm_panfrost_madvise madv;
bo->gem_handle = gem_handle;
bo->gpu = (mali_ptr) get_bo_offset.offset;
bo->size = lseek(fd, 0, SEEK_END);
+ bo->flags |= PAN_BO_DONT_REUSE;
assert(bo->size > 0);
pipe_reference_init(&bo->reference, 1);
if (ret == -1)
return -1;
+ bo->flags |= PAN_BO_DONT_REUSE;
return args.fd;
}
* (semantically distinct from INVISIBLE, which cannot never be mmaped) */
#define PAN_BO_DELAY_MMAP (1 << 4)
+/* Some BOs shouldn't be returned back to the reuse BO cache, use this flag to
+ * let the BO logic know about this contraint. */
+#define PAN_BO_DONT_REUSE (1 << 5)
+
struct panfrost_bo {
/* Must be first for casting */
struct list_head link;