diff mbox

[04/10] i965: setup system routine

Message ID 1310945148-6777-5-git-send-email-ben@bwidawsk.net (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky July 17, 2011, 11:25 p.m. UTC
Upload the system routine as part of the invariant state if debugging.

Remove SIP setting if not debugging to make it more friendly for others
that may be debugging shaders or media kernels.

v2: removed comment per Chris

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 src/mesa/drivers/dri/i965/brw_misc_state.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Comments

Eric Anholt July 18, 2011, 6:19 p.m. UTC | #1
On Sun, 17 Jul 2011 16:25:42 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> Upload the system routine as part of the invariant state if debugging.
> 
> Remove SIP setting if not debugging to make it more friendly for others
> that may be debugging shaders or media kernels.
> 
> v2: removed comment per Chris

This patch doesn't really make sense to me.  Nothing good will come of
my driver's buffer execution landing inside someone else's debug kernel,
right?  So why should my driver's batchbuffer be leaving their SIP in
place?

Of course, if we're landing in a SIP at all from our !brw->wm.debugging
batchbuffers, we're screwed if we don't have actual SIP instructions in
place, so I guess this doesn't *really* change anything.
Ben Widawsky July 19, 2011, 4:48 a.m. UTC | #2
On Mon, Jul 18, 2011 at 11:19:17AM -0700, Eric Anholt wrote:
> On Sun, 17 Jul 2011 16:25:42 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> > Upload the system routine as part of the invariant state if debugging.
> > 
> > Remove SIP setting if not debugging to make it more friendly for others
> > that may be debugging shaders or media kernels.
> > 
> > v2: removed comment per Chris
> 
> This patch doesn't really make sense to me.  Nothing good will come of
> my driver's buffer execution landing inside someone else's debug kernel,
> right?  So why should my driver's batchbuffer be leaving their SIP in
> place?

Yeah you're right. Furthermore, the default value should be 0, which should be
all good all around. Initially I was trying to do something fancier here,
detecting when the SIP has been changed external to mesa, but I gave up on
that.

I will remove the condition and always set sip.

Ben
diff mbox

Patch

diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index bc8ef78..5563ade 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -652,10 +652,14 @@  static void upload_invarient_state( struct brw_context *brw )
       }
    }
 
-   BEGIN_BATCH(2);
-   OUT_BATCH(CMD_STATE_SIP << 16 | (2 - 2));
-   OUT_BATCH(0);
-   ADVANCE_BATCH();
+   /* The system routine must be set after a change to Instruction base */
+   if (brw->wm.debugging)  {
+      assert(brw->wm.sip_offset != 0);
+      BEGIN_BATCH(2);
+      OUT_BATCH(CMD_STATE_SIP << 16 | (2 - 2));
+      OUT_BATCH(brw->wm.sip_offset);
+      ADVANCE_BATCH();
+   }
 
    BEGIN_BATCH(1);
    OUT_BATCH(brw->CMD_VF_STATISTICS << 16 |