From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 3/3] [v3] intel_error_decode: Fix ACTHD/HEAD mess with libdrm Date: Tue, 23 Apr 2013 08:41:10 -0700 Message-ID: <20130423154109.GA25170@bwidawsk.net> References: <1366657257-5017-1-git-send-email-ben@bwidawsk.net> <1366679472-7824-1-git-send-email-ben@bwidawsk.net> <1366679472-7824-3-git-send-email-ben@bwidawsk.net> <20130423083033.GH3889@cantiga.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 52B45E6210 for ; Tue, 23 Apr 2013 08:41:14 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130423083033.GH3889@cantiga.alporthouse.com> 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: Chris Wilson , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Apr 23, 2013 at 09:30:33AM +0100, Chris Wilson wrote: > On Mon, Apr 22, 2013 at 06:11:12PM -0700, Ben Widawsky wrote: > > This patch is an enormous mess, and I'd be fine if people didn't want > > it. However I have made the code do what we want at least on the two > > error dumps I've tried. > > > > The way that it works is it attempts to identify which ACTHD belongs to > > the ring, or batch, and add the appropriate offset as necessary so the > > libdrm decoder can do the right thing. > > > > What I do is put each ACTHD in a fixed part of the array, and assume the > > error dump will dump each ring in gtt ascending order (ie. RCS offset < > > VCS offset < BCS offset). I know, its hacky. > > > > Signed-off-by: Ben Widawsky > > --- > > > +static void emit_acthd(struct drm_intel_decode *decode_ctx, > > + uint64_t gtt_offset, uint64_t size, int is_batch) > > +{ > > + /* XXX: This depends on always being in ascending gtt space order */ > > + static int which_acthd = 0; > > You have ring_name available to sort on. > I would prefer the use of RING_HEAD when decoding the ringbuffers, so > that the current HEAD is always printed there - acting like a frame > pointer in a stacktrace. Making that distinction between rings and > batches should make this code simplier. > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre Any issue with me pushing the first 2, and stalling on this one? -- Ben Widawsky, Intel Open Source Technology Center