From 93255abe30b0a2181fd7ef844c2e74e43865f32a Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Wed, 25 Oct 2023 13:55:53 +0200 Subject: [PATCH] etnaviv: Fix how we determine the max supported number of varyings The driver is written that we should support ETNA_NUM_VARYINGS and reporting a bigger number will cause some troubles. I had a quick look at galcore's hw database and there are entries that report a higher value. So I think what we want is to the minimum value of what kernel driver reports and what the gallium driver should be able to handle. Fixes: 84816c22e4c ("etnaviv: ask kernel for max number of supported varyings") Signed-off-by: Christian Gmeiner Reviewed-by: Lucas Stach Part-of: --- src/gallium/drivers/etnaviv/etnaviv_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index e4c40452e72..9c66d0ec983 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -899,7 +899,7 @@ etna_get_specs(struct etna_screen *screen) DBG("could not get ETNA_GPU_NUM_VARYINGS"); goto fail; } - screen->specs.max_varyings = MAX2(val, ETNA_NUM_VARYINGS); + screen->specs.max_varyings = MIN2(val, ETNA_NUM_VARYINGS); if (etna_gpu_get_param(screen->gpu, ETNA_GPU_NN_CORE_COUNT, &val)) { DBG("could not get ETNA_GPU_NN_CORE_COUNT");