From c46abe651b5ee1ce18694bb9d03dca46962751ac 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: (cherry picked from commit 93255abe30b0a2181fd7ef844c2e74e43865f32a) --- .pick_status.json | 2 +- src/gallium/drivers/etnaviv/etnaviv_screen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 7bbef7f7873..7f15e1fceba 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -304,7 +304,7 @@ "description": "etnaviv: Fix how we determine the max supported number of varyings", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "84816c22e4cf782bf521a005cff6063932a11872", "notes": null diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 801562602fe..f210a98d0ce 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -896,7 +896,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); /* Figure out gross GPU architecture. See rnndb/common.xml for a specific * description of the differences. */