vc4: Add a userspace BO cache.
Since our kernel BOs require CMA allocation, and the use of them requires new mmaps, it's pretty expensive and we should avoid it if possible. Copying my original design for Intel, make a userspace cache that reuses BOs that haven't been shared to other processes but frees BOs that have sat in the cache for over a second. Improves glxgears framerate on RPi by around 30%.
This commit is contained in:
@@ -76,6 +76,7 @@ vc4_screen_get_vendor(struct pipe_screen *pscreen)
|
||||
static void
|
||||
vc4_screen_destroy(struct pipe_screen *pscreen)
|
||||
{
|
||||
vc4_bufmgr_destroy(pscreen);
|
||||
ralloc_free(pscreen);
|
||||
}
|
||||
|
||||
@@ -449,6 +450,7 @@ vc4_screen_create(int fd)
|
||||
pscreen->is_format_supported = vc4_screen_is_format_supported;
|
||||
|
||||
screen->fd = fd;
|
||||
make_empty_list(&screen->bo_cache.time_list);
|
||||
|
||||
vc4_fence_init(screen);
|
||||
|
||||
|
Reference in New Issue
Block a user