diff options
-rw-r--r-- | src/gallium/drivers/panfrost/pan_allocate.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_bo_cache.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_drm.c | 1 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/panfrost/pan_allocate.h b/src/gallium/drivers/panfrost/pan_allocate.h index 8d925ee38a4..0e06567d206 100644 --- a/src/gallium/drivers/panfrost/pan_allocate.h +++ b/src/gallium/drivers/panfrost/pan_allocate.h @@ -59,6 +59,8 @@ struct panfrost_bo { size_t size; int gem_handle; + + uint32_t flags; }; struct panfrost_memory { diff --git a/src/gallium/drivers/panfrost/pan_bo_cache.c b/src/gallium/drivers/panfrost/pan_bo_cache.c index fba495c1dd6..7378d0a8abe 100644 --- a/src/gallium/drivers/panfrost/pan_bo_cache.c +++ b/src/gallium/drivers/panfrost/pan_bo_cache.c @@ -84,11 +84,10 @@ panfrost_bo_cache_fetch( { struct list_head *bucket = pan_bucket(screen, size); - /* TODO: Honour flags? */ - /* Iterate the bucket looking for something suitable */ list_for_each_entry_safe(struct panfrost_bo, entry, bucket, link) { - if (entry->size >= size) { + if (entry->size >= size && + entry->flags == flags) { /* This one works, splice it out of the cache */ list_del(&entry->link); diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c index a1f0bb446b5..8ae541ae11b 100644 --- a/src/gallium/drivers/panfrost/pan_drm.c +++ b/src/gallium/drivers/panfrost/pan_drm.c @@ -123,6 +123,7 @@ panfrost_drm_create_bo(struct panfrost_screen *screen, size_t size, bo->size = create_bo.size; bo->gpu = create_bo.offset; bo->gem_handle = create_bo.handle; + bo->flags = flags; } /* Only mmap now if we know we need to. For CPU-invisible buffers, we |