mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 23:40:10 +01:00
panfrost: Take into account flags when looking up in the BO cache
This will be useful right now so we avoid retrieving a non-executable buffer when a executable one is needed. As we support more flags, this logic will need to be extended to consider the different trade-offs to be made when matching BO specifications to BOs in the cache. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
950b5fc596
commit
9398932c2d
3 changed files with 5 additions and 3 deletions
|
|
@ -59,6 +59,8 @@ struct panfrost_bo {
|
|||
size_t size;
|
||||
|
||||
int gem_handle;
|
||||
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
struct panfrost_memory {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue