From 239e4e87fc830ec2ee3e97b7a7600873af260013 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 6 Oct 2020 21:46:56 -0400 Subject: [PATCH] panfrost: Fix Bifrost high LOD clamp Broke mipmapping. Fixes: ad0b32cdbd5 ("panfrost: XMLify Bifrost textures") Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/lib/pan_texture.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c index 4ea05e0cc02..c65c60bf7e4 100644 --- a/src/panfrost/lib/pan_texture.c +++ b/src/panfrost/lib/pan_texture.c @@ -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); } }