etnaviv: fix SAMP_ANISOTROPY register value
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Sun, 3 May 2020 06:54:47 +0000 (08:54 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 4 May 2020 14:39:24 +0000 (14:39 +0000)
This caused some serious problems like shredded output, ~1fps and GPU hungs.

Fixes: 7aaa0e59086 ("etnaviv: add anisotropic filter support")
Reported-by: Lukas F. Hartmann <lukas@mntmn.com>
Tested-by: Lukas F. Hartmann <lukas@mntmn.com>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4872>

src/gallium/drivers/etnaviv/etnaviv_texture_desc.c

index efa0cd67147f6160a7d1fa55973371851fc3e567..bca73d65c142b71b0753ede229658f54927e2899 100644 (file)
@@ -109,8 +109,7 @@ etna_create_sampler_state_desc(struct pipe_context *pipe,
    cs->SAMP_LOD_BIAS =
       VIVS_NTE_DESCRIPTOR_SAMP_LOD_BIAS_BIAS(etna_float_to_fixp88(ss->lod_bias)) |
       COND(ss->lod_bias != 0.0, VIVS_NTE_DESCRIPTOR_SAMP_LOD_BIAS_ENABLE);
-   cs->SAMP_ANISOTROPY =
-      VIVS_NTE_DESCRIPTOR_SAMP_ANISOTROPY(COND(ansio, etna_log2_fixp88(ss->max_anisotropy)));
+   cs->SAMP_ANISOTROPY = COND(ansio, etna_log2_fixp88(ss->max_anisotropy));
 
    return cs;
 }