From: Ben Widawsky Subject: Shader debugging Date: Tue, 14 Jun 2011 12:46:03 -0700 Message-ID: <1308080767-21176-1-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DDF8A088C for ; Tue, 14 Jun 2011 12:46:15 -0700 (PDT) Received: from localhost.localdomain (c-24-21-202-86.hsd1.or.comcast.net [24.21.202.86]) by cloud01.chad-versace.us (Postfix) with ESMTPSA id 6E7761D4078 for ; Tue, 14 Jun 2011 19:48:10 +0000 (UTC) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org The following patches enable GEN hardware shader debugging features. This is for >= GEN6 only. The patches are not usable without patches to the DDX as well as Mesa. Furthermore currently a kernel ioctl is required (more on that later). As these are all in tools, I figure I would post these now while I continue cleaning up the other patches. Furthermore, no interactive debugging is yet supported. The system routine has been tested on a fragment shader (though it should work for vertex shaders as well). Here is a brief description of what is missing (ie. not yet ready for mailing list): - DDX state setup needs to cooperate when setting the Instruction Base address. - Mesa state setup needs to cooperate. - Mesa need some way to set breakpoints. - Mesa register allocation needs modification. - Kernel ioctl to set the system routine instruction pointer Here is what is working in the current implementation: - System routine upload (done in Kernel IOCTL currently) - Basic system routine - Coherent EU/CPU communication (while ring is frozen) - EU architectural state saving (just MRF 1-15, GRF 0-15, SR, and CR), and saved into CPU visible space. - Tool to read architectural state (mostly for reference). Here is what is planned next: - Clean up and send out what I have for Mesa, DDX, and kernel (even though I know most of those need changes anyway). - When I started this work nobody was using the instuction base pointer, so I need to cooperate more closely with that now. - Work on EU side communication (do different things based on CPU commands). - Change eviction macro to a loop There's probably more which I'm forgetting right now. The 4th patch is the gigantic, not sure how to split it up, patch. I will probably add an extremely, more simpler system routine for basic sanity testing.