[Intel-gfx] [RFC] drm/i915/tgl: Gen12 csb support

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 27 21:06:08 UTC 2019


Quoting Daniele Ceraolo Spurio (2019-06-27 21:32:25)
> The CSB format has been reworked for Gen12 to include information on
> both the context we're switching away from and the context we're
> switching to. After the change, some of the events don't have their
> own bit anymore and need to be inferred from other values in the csb.
> One of the context IDs (0x7FF) has also been reserved to indicate
> the invalid ctx, i.e. engine idle.
> To keep the logic simple, we can convert the new gen12 format to the
> gen11 format and re-use the legacy csb handling logic. This result
> in a sliglthly slower handling for gen12 but allows us to get running
> with a relatively small change and avoids code duplication.
> 
> RFC: base TGL support [1] is not yet in the tree, but I wanted to get
> some early comments on this because I'm not totally convinced that the
> conversion is the best way of doing this. This way if another approach
> is proposed I can do the work while the base support gets reviewed. If
> we stick with the conversion we can probably optimize a bit.
> Toughts?

We only require a few states and so I wonder if we should try to map to
the current internal states

switch (csb_parse_fn[gen](buf + i)) {
	case PREEMPT:
		...
		/* fallthrough */
	case PROMOTE:
		break;

	case COMPLETE:
		break;

	default: /* boring non-event */
		break;
}

I hope function pointers like that are not severely penalized nowadays.

Basically instead of compiling the mask, we have a sequence of check
and return. If we keep on logging the full CSB[] that is at least the
information we need to verify the events against our state tracking,
except that we push the effort out to the debugger to parse the event
details.
-Chris


More information about the Intel-gfx mailing list