lima: align size before trying to fetch BO from cache
authorVasily Khoruzhick <anarsoul@gmail.com>
Fri, 25 Oct 2019 05:12:30 +0000 (22:12 -0700)
committerVasily Khoruzhick <anarsoul@gmail.com>
Fri, 1 Nov 2019 20:12:03 +0000 (13:12 -0700)
Otherwise we may be looking in wrong bucket

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
src/gallium/drivers/lima/lima_bo.c

index f0015396217383f404199e31c51355c43928bce6..779e23ce1c8691ef42eb44e871c942d97d221b9b 100644 (file)
@@ -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,