[PATCH] drm/xe: Add WA BB to capture active context utilization

Matthew Brost matthew.brost at intel.com
Thu May 1 20:56:26 UTC 2025


On Thu, May 01, 2025 at 08:58:23AM -0500, Lucas De Marchi wrote:
> On Wed, Apr 30, 2025 at 11:28:40AM -0700, Umesh Nerlige Ramappa wrote:
> > > > u32 xe_lrc_update_timestamp(struct xe_lrc *lrc, u32 *old_ts)
> > > > {
> > > > +	u32 ctx_lrc, ctx_reg, engine_id;
> > > > +
> > > > 	*old_ts = lrc->ctx_timestamp;
> > > > 
> > > > -	lrc->ctx_timestamp = xe_lrc_ctx_timestamp(lrc);
> > > > +	ctx_lrc = xe_lrc_ctx_timestamp(lrc);
> > > > +	if (ctx_lrc == 1) {
> > > 
> > > so in the rare case this clashes with a real sched-out value, the
> > > outcome will be that we will read a bogus timestamp and the math will be
> > > totally invalid. Maybe start using the entire u64 counter for this since
> > > it would then not wrap in practice?
> > 
> > I was trying to keep it compatible with platforms without 64 bit
> > CTX_TIMESTAMP. Also th issue is reported on DG2.
> 
> DG2 is not even officially supported. If we can make it very unlikely on
> DG2 and impossible on Xe2 and later, let's do it.
> 

+1 if all offically supported platforms can use a 64-bit counter then
that seems like the way to go. Then just live with the possible race on
platforms with a 32-bit counter.

Matt

> Lucas De Marchi


More information about the Intel-xe mailing list