panfrost: Fix Bifrost high LOD clamp
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 7 Oct 2020 01:46:56 +0000 (21:46 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sat, 10 Oct 2020 21:15:02 +0000 (17:15 -0400)
Broke mipmapping.

Fixes: ad0b32cdbd5 ("panfrost: XMLify Bifrost textures")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7081>

src/panfrost/lib/pan_texture.c

index 4ea05e0..c65c60b 100644 (file)
@@ -405,9 +405,10 @@ panfrost_new_texture_bifrost(
                 cfg.levels = last_level - first_level;
                 cfg.surfaces = payload->gpu;
 
-                /* Use the sampler descriptor for LOD clamping */
-                cfg.minimum_lod = 0;
-                cfg.maximum_lod = last_level - first_level;
+                /* We specify API-level LOD clamps in the sampler descriptor
+                 * and use these clamps simply for bounds checking */
+                cfg.minimum_lod = FIXED_16(0, false);
+                cfg.maximum_lod = FIXED_16(cfg.levels, false);
         }
 }