aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2019-08-14 11:39:13 +0200
committerChristian Gmeiner <[email protected]>2019-08-14 12:29:56 +0200
commit797a2e4fd0306b214e366a75caf2d54f17601393 (patch)
tree599656bfcd6d0e4bbb5aa9f62470a17eeb37903d /src/gallium/drivers/etnaviv
parent45cb5eee5d52844b86e20309db260425b81a97d4 (diff)
etnaviv: update logic to determine uniform limits
Taken 1:1 from the header file. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach [email protected]
Diffstat (limited to 'src/gallium/drivers/etnaviv')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_screen.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c
index 28b577bc3a5..e392f575e71 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
@@ -529,14 +529,36 @@ etna_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
static void
etna_determine_uniform_limits(struct etna_screen *screen)
{
- /* from QueryShaderCaps in kernel driver */
- if (screen->model < chipModel_GC4000) {
- screen->specs.max_vs_uniforms = 168;
+ /* values for the non unified case are taken from
+ * gcmCONFIGUREUNIFORMS in the Vivante kernel driver file
+ * drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h.
+ */
+ if (screen->model == chipModel_GC2000 &&
+ (screen->revision == 0x5118 || screen->revision == 0x5140)) {
+ screen->specs.max_vs_uniforms = 256;
screen->specs.max_ps_uniforms = 64;
- } else {
+ } else if (screen->specs.num_constants == 320) {
+ screen->specs.max_vs_uniforms = 256;
+ screen->specs.max_ps_uniforms = 64;
+ } else if (screen->specs.num_constants > 256 &&
+ screen->model == chipModel_GC1000) {
+ /* All GC1000 series chips can only support 64 uniforms for ps on non-unified const mode. */
+ screen->specs.max_vs_uniforms = 256;
+ screen->specs.max_ps_uniforms = 64;
+ } else if (screen->specs.num_constants > 256) {
screen->specs.max_vs_uniforms = 256;
screen->specs.max_ps_uniforms = 256;
}
+ else if (screen->specs.num_constants == 256)
+ {
+ screen->specs.max_vs_uniforms = 256;
+ screen->specs.max_ps_uniforms = 256;
+ }
+ else
+ {
+ screen->specs.max_vs_uniforms = 168;
+ screen->specs.max_ps_uniforms = 64;
+ }
}
static bool