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: 84816c22e4 ("etnaviv: ask kernel for max number of supported varyings")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27923>
(cherry picked from commit 93255abe30)
This commit is contained in:
Christian Gmeiner 2023-10-25 13:55:53 +02:00 committed by Eric Engestrom
parent c93608ecf9
commit c46abe651b
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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. */