Re: [Mesa-dev] [PATCH 26/27] i965: Disable gather push constants for null constants

2015-05-08 Thread Abdiel Janulgue


On 05/07/2015 05:48 PM, Pohjolainen, Topi wrote:
> On Tue, Apr 28, 2015 at 11:08:23PM +0300, Abdiel Janulgue wrote:
>> Programming null constants with gather constant tables seems to
>> be unsupported and results in a GPU lockup even with the prescribed
>> GPU workarounds in the bspec. Found out by trial and error that
>> disabling HW gather constant when the constant state for a stage
>> needs to be nullified is the only way to go around the issue.
> 
> Just a general question. We keep resource streamer itself always enabled
> (except for blorp of course). Does it still do something meaningful without
> gather constants or should we disable them both?
> 

The resource streamer is just an infrastructure containing the specific
optimizations hw-generated binding tables and gather constants. The
dependency below flows from left to right.

RS_on ringbuffer --> hw-binding tables --> gather constants

So switching on gather constants require HW-gen binding tables be
enabled as well. But hw-generated binding table is not required to be
switched off for gather constants to be turned off.

The only problem with disabling both is the additional required state
setup packets to tear-down and then re-enable everything again which
increases the size of the command buffers for every 3D primitive

-Abdiel


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 26/27] i965: Disable gather push constants for null constants

2015-05-07 Thread Pohjolainen, Topi
On Tue, Apr 28, 2015 at 11:08:23PM +0300, Abdiel Janulgue wrote:
> Programming null constants with gather constant tables seems to
> be unsupported and results in a GPU lockup even with the prescribed
> GPU workarounds in the bspec. Found out by trial and error that
> disabling HW gather constant when the constant state for a stage
> needs to be nullified is the only way to go around the issue.

Just a general question. We keep resource streamer itself always enabled
(except for blorp of course). Does it still do something meaningful without
gather constants or should we disable them both?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 26/27] i965: Disable gather push constants for null constants

2015-04-28 Thread Abdiel Janulgue
Programming null constants with gather constant tables seems to
be unsupported and results in a GPU lockup even with the prescribed
GPU workarounds in the bspec. Found out by trial and error that
disabling HW gather constant when the constant state for a stage
needs to be nullified is the only way to go around the issue.

Signed-off-by: Abdiel Janulgue 
---
 src/mesa/drivers/dri/i965/gen7_disable.c  |  4 
 src/mesa/drivers/dri/i965/gen7_vs_state.c | 11 +++
 2 files changed, 15 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/gen7_disable.c 
b/src/mesa/drivers/dri/i965/gen7_disable.c
index 2c43cd7..ba7fbf8 100644
--- a/src/mesa/drivers/dri/i965/gen7_disable.c
+++ b/src/mesa/drivers/dri/i965/gen7_disable.c
@@ -29,6 +29,8 @@
 static void
 disable_stages(struct brw_context *brw)
 {
+   gen7_toggle_gather_constants(brw, false);
+
/* Disable the HS Unit */
BEGIN_BATCH(7);
OUT_BATCH(_3DSTATE_CONSTANT_HS << 16 | (7 - 2));
@@ -87,6 +89,8 @@ disable_stages(struct brw_context *brw)
OUT_BATCH(_3DSTATE_BINDING_TABLE_POINTERS_DS << 16 | (2 - 2));
OUT_BATCH(0);
ADVANCE_BATCH();
+
+   gen7_toggle_gather_constants(brw, true);
 }
 
 const struct brw_tracked_state gen7_disable_stages = {
diff --git a/src/mesa/drivers/dri/i965/gen7_vs_state.c 
b/src/mesa/drivers/dri/i965/gen7_vs_state.c
index adfaa59..f5e77ed 100644
--- a/src/mesa/drivers/dri/i965/gen7_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_vs_state.c
@@ -85,6 +85,13 @@ gen7_upload_constant_state(struct brw_context *brw,
int const_loc = use_gather ? 16 : 0;
int dwords = brw->gen >= 8 ? 11 : 7;
 
+   /* Disable gather constants when zeroing constant states */
+   bool gather_switched_off = false;
+   if (use_gather && !active) {
+  gen7_toggle_gather_constants(brw, false);
+  gather_switched_off = true;
+   }
+
struct brw_stage_prog_data *prog_data = stage_state->prog_data;
if (prog_data && use_gather && active) {
   gen7_submit_gather_table(brw, stage_state, prog_data, gather_opcode);
@@ -115,6 +122,10 @@ gen7_upload_constant_state(struct brw_context *brw,
 
ADVANCE_BATCH();
 
+   /* Re-enable gather again if required */
+   if (gather_switched_off)
+  gen7_toggle_gather_constants(brw, true);
+
   /* On SKL+ the new constants don't take effect until the next corresponding
* 3DSTATE_BINDING_TABLE_POINTER_* command is parsed so we need to ensure
* that is sent
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev