summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-09-11 16:23:20 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2013-09-11 17:58:43 +0200
commitd8577a99140f7079c9ddbf1e2cd239cd7b783f12 (patch)
treef0646f7926057c5c4bf2c2fb6211024605d393b3
parentb52077ea5a109a10b40c0d6a5c4fcbaca09fe68b (diff)
driver: Set bit 24 of PE_DEPTH_CONFIG correctly
Bypasses ZS buffer write when stencil and depth is not written.
-rw-r--r--native/driver/etna_zsa.c12
-rw-r--r--native/etnaviv/common.xml.h2
-rw-r--r--native/etnaviv/state.xml.h2
-rw-r--r--native/etnaviv/state_2d.xml.h2
-rw-r--r--native/etnaviv/state_3d.xml.h5
-rw-r--r--native/etnaviv/state_hi.xml.h2
-rw-r--r--native/etnaviv/state_vg.xml.h2
-rw-r--r--rnndb/state_3d.xml3
-rw-r--r--rnndb/state_hi.xml10
9 files changed, 22 insertions, 18 deletions
diff --git a/native/driver/etna_zsa.c b/native/driver/etna_zsa.c
index 892ecfb..165c1b6 100644
--- a/native/driver/etna_zsa.c
+++ b/native/driver/etna_zsa.c
@@ -42,6 +42,7 @@ static void *etna_pipe_create_depth_stencil_alpha_state(struct pipe_context *pip
struct pipe_depth_stencil_alpha_state dsa = *dsa_p;
/* XXX does stencil[0] / stencil[1] order depend on rs->front_ccw? */
bool early_z = true;
+ bool disable_zs = !dsa.depth.writemask;
int i;
/* Set operations to KEEP if write mask is 0.
@@ -57,14 +58,15 @@ static void *etna_pipe_create_depth_stencil_alpha_state(struct pipe_context *pip
}
}
- /* Determine whether to enable early z reject. Don't enable it when any of the stencil functions is used. */
+ /* Determine whether to enable early z reject. Don't enable it when any of
+ * the stencil-modifying functions is used. */
if(dsa.stencil[0].enabled)
{
if(dsa.stencil[0].fail_op != PIPE_STENCIL_OP_KEEP ||
dsa.stencil[0].zfail_op != PIPE_STENCIL_OP_KEEP ||
dsa.stencil[0].zpass_op != PIPE_STENCIL_OP_KEEP)
{
- early_z = false;
+ disable_zs = early_z = false;
}
else if(dsa.stencil[1].enabled)
{
@@ -72,16 +74,16 @@ static void *etna_pipe_create_depth_stencil_alpha_state(struct pipe_context *pip
dsa.stencil[1].zfail_op != PIPE_STENCIL_OP_KEEP ||
dsa.stencil[1].zpass_op != PIPE_STENCIL_OP_KEEP)
{
- early_z = false;
+ disable_zs = early_z = false;
}
}
}
-
/* compare funcs have 1 to 1 mapping */
cs->PE_DEPTH_CONFIG =
VIVS_PE_DEPTH_CONFIG_DEPTH_FUNC(dsa.depth.enabled ? dsa.depth.func : PIPE_FUNC_ALWAYS) |
(dsa.depth.writemask ? VIVS_PE_DEPTH_CONFIG_WRITE_ENABLE : 0) |
- (early_z ? VIVS_PE_DEPTH_CONFIG_EARLY_Z : 0);
+ (early_z ? VIVS_PE_DEPTH_CONFIG_EARLY_Z : 0) |
+ (disable_zs ? VIVS_PE_DEPTH_CONFIG_DISABLE_ZS : 0);
cs->PE_ALPHA_OP =
(dsa.alpha.enabled ? VIVS_PE_ALPHA_OP_ALPHA_TEST : 0) |
VIVS_PE_ALPHA_OP_ALPHA_FUNC(dsa.alpha.func) |
diff --git a/native/etnaviv/common.xml.h b/native/etnaviv/common.xml.h
index fe2d503..524f339 100644
--- a/native/etnaviv/common.xml.h
+++ b/native/etnaviv/common.xml.h
@@ -12,7 +12,7 @@ The rules-ng-ng source files this header was generated from are:
- /home/orion/projects/etna_viv/rnndb/common.xml ( 16543 bytes, from 2013-09-01 10:53:22)
- /home/orion/projects/etna_viv/rnndb/state_hi.xml ( 21682 bytes, from 2013-09-10 09:11:57)
- /home/orion/projects/etna_viv/rnndb/state_2d.xml ( 51058 bytes, from 2013-09-01 10:53:22)
-- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54038 bytes, from 2013-09-10 11:31:44)
+- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54159 bytes, from 2013-09-11 14:17:21)
- /home/orion/projects/etna_viv/rnndb/state_vg.xml ( 5942 bytes, from 2013-09-01 10:53:22)
Copyright (C) 2013
diff --git a/native/etnaviv/state.xml.h b/native/etnaviv/state.xml.h
index 66c5b59..a9e5693 100644
--- a/native/etnaviv/state.xml.h
+++ b/native/etnaviv/state.xml.h
@@ -12,7 +12,7 @@ The rules-ng-ng source files this header was generated from are:
- /home/orion/projects/etna_viv/rnndb/common.xml ( 16543 bytes, from 2013-09-01 10:53:22)
- /home/orion/projects/etna_viv/rnndb/state_hi.xml ( 21682 bytes, from 2013-09-10 09:11:57)
- /home/orion/projects/etna_viv/rnndb/state_2d.xml ( 51058 bytes, from 2013-09-01 10:53:22)
-- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54038 bytes, from 2013-09-10 11:31:44)
+- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54159 bytes, from 2013-09-11 14:17:21)
- /home/orion/projects/etna_viv/rnndb/state_vg.xml ( 5942 bytes, from 2013-09-01 10:53:22)
Copyright (C) 2013
diff --git a/native/etnaviv/state_2d.xml.h b/native/etnaviv/state_2d.xml.h
index 090c092..9de0637 100644
--- a/native/etnaviv/state_2d.xml.h
+++ b/native/etnaviv/state_2d.xml.h
@@ -12,7 +12,7 @@ The rules-ng-ng source files this header was generated from are:
- /home/orion/projects/etna_viv/rnndb/common.xml ( 16543 bytes, from 2013-09-01 10:53:22)
- /home/orion/projects/etna_viv/rnndb/state_hi.xml ( 21682 bytes, from 2013-09-10 09:11:57)
- /home/orion/projects/etna_viv/rnndb/state_2d.xml ( 51058 bytes, from 2013-09-01 10:53:22)
-- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54038 bytes, from 2013-09-10 11:31:44)
+- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54159 bytes, from 2013-09-11 14:17:21)
- /home/orion/projects/etna_viv/rnndb/state_vg.xml ( 5942 bytes, from 2013-09-01 10:53:22)
Copyright (C) 2013
diff --git a/native/etnaviv/state_3d.xml.h b/native/etnaviv/state_3d.xml.h
index d0978f3..42353da 100644
--- a/native/etnaviv/state_3d.xml.h
+++ b/native/etnaviv/state_3d.xml.h
@@ -12,7 +12,7 @@ The rules-ng-ng source files this header was generated from are:
- /home/orion/projects/etna_viv/rnndb/common.xml ( 16543 bytes, from 2013-09-01 10:53:22)
- /home/orion/projects/etna_viv/rnndb/state_hi.xml ( 21682 bytes, from 2013-09-10 09:11:57)
- /home/orion/projects/etna_viv/rnndb/state_2d.xml ( 51058 bytes, from 2013-09-01 10:53:22)
-- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54038 bytes, from 2013-09-10 11:31:44)
+- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54159 bytes, from 2013-09-11 14:17:21)
- /home/orion/projects/etna_viv/rnndb/state_vg.xml ( 5942 bytes, from 2013-09-01 10:53:22)
Copyright (C) 2013
@@ -493,7 +493,8 @@ Copyright (C) 2013
#define VIVS_PE_DEPTH_CONFIG_EARLY_Z_MASK 0x00020000
#define VIVS_PE_DEPTH_CONFIG_ONLY_DEPTH 0x00100000
#define VIVS_PE_DEPTH_CONFIG_ONLY_DEPTH_MASK 0x00200000
-#define VIVS_PE_DEPTH_CONFIG_UNK24 0x01000000
+#define VIVS_PE_DEPTH_CONFIG_DISABLE_ZS 0x01000000
+#define VIVS_PE_DEPTH_CONFIG_DISABLE_ZS_MASK 0x02000000
#define VIVS_PE_DEPTH_CONFIG_SUPER_TILED 0x04000000
#define VIVS_PE_DEPTH_CONFIG_SUPER_TILED_MASK 0x08000000
diff --git a/native/etnaviv/state_hi.xml.h b/native/etnaviv/state_hi.xml.h
index 06e5263..fd67ff9 100644
--- a/native/etnaviv/state_hi.xml.h
+++ b/native/etnaviv/state_hi.xml.h
@@ -12,7 +12,7 @@ The rules-ng-ng source files this header was generated from are:
- /home/orion/projects/etna_viv/rnndb/common.xml ( 16543 bytes, from 2013-09-01 10:53:22)
- /home/orion/projects/etna_viv/rnndb/state_hi.xml ( 21682 bytes, from 2013-09-10 09:11:57)
- /home/orion/projects/etna_viv/rnndb/state_2d.xml ( 51058 bytes, from 2013-09-01 10:53:22)
-- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54038 bytes, from 2013-09-10 11:31:44)
+- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54159 bytes, from 2013-09-11 14:17:21)
- /home/orion/projects/etna_viv/rnndb/state_vg.xml ( 5942 bytes, from 2013-09-01 10:53:22)
Copyright (C) 2013
diff --git a/native/etnaviv/state_vg.xml.h b/native/etnaviv/state_vg.xml.h
index f8fad7f..e4183dd 100644
--- a/native/etnaviv/state_vg.xml.h
+++ b/native/etnaviv/state_vg.xml.h
@@ -12,7 +12,7 @@ The rules-ng-ng source files this header was generated from are:
- /home/orion/projects/etna_viv/rnndb/common.xml ( 16543 bytes, from 2013-09-01 10:53:22)
- /home/orion/projects/etna_viv/rnndb/state_hi.xml ( 21682 bytes, from 2013-09-10 09:11:57)
- /home/orion/projects/etna_viv/rnndb/state_2d.xml ( 51058 bytes, from 2013-09-01 10:53:22)
-- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54038 bytes, from 2013-09-10 11:31:44)
+- /home/orion/projects/etna_viv/rnndb/state_3d.xml ( 54159 bytes, from 2013-09-11 14:17:21)
- /home/orion/projects/etna_viv/rnndb/state_vg.xml ( 5942 bytes, from 2013-09-01 10:53:22)
Copyright (C) 2013
diff --git a/rnndb/state_3d.xml b/rnndb/state_3d.xml
index 5892393..3a2175c 100644
--- a/rnndb/state_3d.xml
+++ b/rnndb/state_3d.xml
@@ -446,7 +446,8 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
<bitfield pos="17" name="EARLY_Z_MASK"/>
<bitfield pos="20" name="ONLY_DEPTH"/>
<bitfield pos="21" name="ONLY_DEPTH_MASK"/>
- <bitfield pos="24" name="UNK24"/>
+ <bitfield pos="24" name="DISABLE_ZS" brief="Completely disables writing to depth stencil buffer"/>
+ <bitfield pos="25" name="DISABLE_ZS_MASK"/>
<bitfield pos="26" name="SUPER_TILED"/>
<bitfield pos="27" name="SUPER_TILED_MASK"/>
</reg32>
diff --git a/rnndb/state_hi.xml b/rnndb/state_hi.xml
index 1e5e51d..46f1424 100644
--- a/rnndb/state_hi.xml
+++ b/rnndb/state_hi.xml
@@ -215,11 +215,11 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
<reg32 offset="0x0040C" name="MMU_PEZ_PAGE_TABLE" brief="Page table for PE depth"/>
<reg32 offset="0x00410" name="MMU_RA_PAGE_TABLE" brief="Page table for rasterize"/>
<reg32 offset="0x00414" name="DEBUG_MEMORY"/>
- <reg32 offset="0x00418" name="MEMORY_BASE_ADDR_RA"/>
- <reg32 offset="0x0041C" name="MEMORY_BASE_ADDR_FE"/>
- <reg32 offset="0x00420" name="MEMORY_BASE_ADDR_TX"/>
- <reg32 offset="0x00424" name="MEMORY_BASE_ADDR_PEZ"/>
- <reg32 offset="0x00428" name="MEMORY_BASE_ADDR_PE"/>
+ <reg32 offset="0x00418" name="MEMORY_BASE_ADDR_RA" brief="Base address for RA"/>
+ <reg32 offset="0x0041C" name="MEMORY_BASE_ADDR_FE" brief="Base address for FE"/>
+ <reg32 offset="0x00420" name="MEMORY_BASE_ADDR_TX" brief="Base address for TX"/>
+ <reg32 offset="0x00424" name="MEMORY_BASE_ADDR_PEZ" brief="Base address for PE depth"/>
+ <reg32 offset="0x00428" name="MEMORY_BASE_ADDR_PE" brief="Base address for PE color"/>
<reg32 offset="0x0042C" name="MEMORY_TIMING_CONTROL"/>
<reg32 offset="0x00430" name="MEMORY_FLUSH"/>
<reg32 offset="0x00438" name="PROFILE_CYCLE_COUNTER" brief="Cycles counter"/>