diff options
author | Wladimir J. van der Laan <[email protected]> | 2017-02-09 13:18:22 +0100 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2017-02-12 20:42:37 +0100 |
commit | 55e00c7cfe704a430606bc415a259a2cc827fa40 (patch) | |
tree | b3859c2712b9c1ad8184a004e02a66f33c9d9dba | |
parent | 0fe60e4fcc921b63cd5ba3f9e391c420c2e5039b (diff) |
etnaviv: Set shader instruction area correctly for GC3000
- Use the same instruction area on GC3000 as the Vivante driver.
This allows the same number of instructions on GC3000 as GC2000
instead of half.
- Makes sure that the "PE to FE" stall before updating the shader code
or constants is hit (which is conditional on vs_offset > 0x4000). This
is necessary on GC3000 too, it increases stability.
Signed-off-by: Wladimir J. van der Laan <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_screen.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 9324a95fcaa..c277f64ce98 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -627,14 +627,30 @@ etna_get_specs(struct etna_screen *screen) screen->specs.has_new_sin_cos = VIV_FEATURE(screen, chipMinorFeatures3, HAS_FAST_TRANSCENDENTALS); - if (instruction_count > 256) { /* unified instruction memory? */ + if (VIV_FEATURE(screen, chipMinorFeatures3, INSTRUCTION_CACHE)) { + /* GC3000 - this core is capable of loading shaders from + * memory. It can also run shaders from registers, as a fallback, but + * "max_instructions" does not have the correct value. It has place for + * 2*256 instructions just like GC2000, but the offsets are slightly + * different. + */ screen->specs.vs_offset = 0xC000; - screen->specs.ps_offset = 0xD000; /* like vivante driver */ + /* State 08000-0C000 mirrors 0C000-0E000, and the Vivante driver uses + * this mirror for writing PS instructions, probably safest to do the + * same. + */ + screen->specs.ps_offset = 0x8000 + 0x1000; screen->specs.max_instructions = 256; } else { - screen->specs.vs_offset = 0x4000; - screen->specs.ps_offset = 0x6000; - screen->specs.max_instructions = instruction_count / 2; + if (instruction_count > 256) { /* unified instruction memory? */ + screen->specs.vs_offset = 0xC000; + screen->specs.ps_offset = 0xD000; /* like vivante driver */ + screen->specs.max_instructions = 256; + } else { + screen->specs.vs_offset = 0x4000; + screen->specs.ps_offset = 0x6000; + screen->specs.max_instructions = instruction_count / 2; + } } if (VIV_FEATURE(screen, chipMinorFeatures1, HALTI0)) { |