From ae0b05d8db852cfe4df716e9b6d46c77510214d1 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Thu, 24 Oct 2019 22:12:30 -0700 Subject: [PATCH] lima: align size before trying to fetch BO from cache Otherwise we may be looking in wrong bucket Reviewed-by: Erico Nunes Signed-off-by: Vasily Khoruzhick --- src/gallium/drivers/lima/lima_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/lima/lima_bo.c b/src/gallium/drivers/lima/lima_bo.c index f0015396217..779e23ce1c8 100644 --- a/src/gallium/drivers/lima/lima_bo.c +++ b/src/gallium/drivers/lima/lima_bo.c @@ -289,13 +289,13 @@ struct lima_bo *lima_bo_create(struct lima_screen *screen, { struct lima_bo *bo; + size = align(size, LIMA_PAGE_SIZE); + /* Try to get bo from cache first */ bo = lima_bo_cache_get(screen, size, flags); if (bo) return bo; - size = align(size, LIMA_PAGE_SIZE); - struct drm_lima_gem_create req = { .size = size, .flags = flags, -- 2.30.2