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 <ben at bwidawsk.net> > --- > +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