Commit 263ca71a authored by Rob Clark's avatar Rob Clark 💬
Browse files

fixup! WIP: freedreno/drm: Consider allocation flags in bo-cache

parent a17c739d
......@@ -135,13 +135,13 @@ find_in_bucket(struct fd_bo_bucket *bucket, uint32_t flags)
* (MRU, since likely to be in GPU cache), rather than head (LRU)..
*/
simple_mtx_lock(&table_lock);
if (!list_is_empty(&bucket->list)) {
bo = LIST_ENTRY(struct fd_bo, bucket->list.next, list);
if ((bo->alloc_flags == flags) &&
(fd_bo_state(bo) == FD_BO_STATE_IDLE)) {
list_for_each_entry (struct fd_bo, entry, &bucket->list, list) {
if (fd_bo_state(entry) != FD_BO_STATE_IDLE)
break;
if (entry->alloc_flags == flags) {
bo = entry;
list_del(&bo->list);
} else {
bo = NULL;
break;
}
}
simple_mtx_unlock(&table_lock);
......@@ -185,6 +185,9 @@ retry:
int
fd_bo_cache_free(struct fd_bo_cache *cache, struct fd_bo *bo)
{
if (bo->nosync || bo->shared)
return -1;
struct fd_bo_bucket *bucket = get_bucket(cache, bo->size);
/* see if we can be green and recycle: */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment