mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-03 15:14:17 +08:00
etnaviv: ask kernel for max number of supported varyings
The inital etnaviv kernel driver in 4.5 has support for this param. See kernel commit 602eb48966d7b7f7e64dca8d9ea2842d83bfae73 Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Jonathan Marek <jonathan@marek.ca> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3827>
This commit is contained in:
parent
0103f02acb
commit
84816c22e4
@ -700,6 +700,12 @@ etna_get_specs(struct etna_screen *screen)
|
||||
}
|
||||
screen->specs.num_constants = val;
|
||||
|
||||
if (etna_gpu_get_param(screen->gpu, ETNA_GPU_NUM_VARYINGS, &val)) {
|
||||
DBG("could not get ETNA_GPU_NUM_VARYINGS");
|
||||
goto fail;
|
||||
}
|
||||
screen->specs.max_varyings = MAX2(val, ETNA_NUM_VARYINGS);
|
||||
|
||||
/* Figure out gross GPU architecture. See rnndb/common.xml for a specific
|
||||
* description of the differences. */
|
||||
if (VIV_FEATURE(screen, chipMinorFeatures5, HALTI5))
|
||||
@ -791,22 +797,14 @@ etna_get_specs(struct etna_screen *screen)
|
||||
}
|
||||
|
||||
if (VIV_FEATURE(screen, chipMinorFeatures1, HALTI0)) {
|
||||
screen->specs.max_varyings = 12;
|
||||
screen->specs.vertex_max_elements = 16;
|
||||
} else {
|
||||
screen->specs.max_varyings = 8;
|
||||
/* Etna_viv documentation seems confused over the correct value
|
||||
* here so choose the lower to be safe: HALTI0 says 16 i.s.o.
|
||||
* 10, but VERTEX_ELEMENT_CONFIG register says 16 i.s.o. 12. */
|
||||
screen->specs.vertex_max_elements = 10;
|
||||
}
|
||||
|
||||
/* Etna_viv documentation does not indicate where varyings above 8 are
|
||||
* stored. Moreover, if we are passed more than 8 varyings, we will
|
||||
* walk off the end of some arrays. Limit the maximum number of varyings. */
|
||||
if (screen->specs.max_varyings > ETNA_NUM_VARYINGS)
|
||||
screen->specs.max_varyings = ETNA_NUM_VARYINGS;
|
||||
|
||||
etna_determine_uniform_limits(screen);
|
||||
|
||||
if (screen->specs.halti >= 5) {
|
||||
|
Loading…
Reference in New Issue
Block a user