From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id A8BE010E043 for ; Wed, 22 Mar 2023 05:41:19 +0000 (UTC) Date: Tue, 21 Mar 2023 22:40:56 -0700 Message-ID: <875yatuyvr.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa In-Reply-To: <20230322000523.3310187-30-umesh.nerlige.ramappa@intel.com> References: <20230322000523.3310187-1-umesh.nerlige.ramappa@intel.com> <20230322000523.3310187-30-umesh.nerlige.ramappa@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [igt-dev] [PATCH i-g-t v4 29/31] lib/i915/perf: Adjust the GPU timestamp for new OA formats List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, Lionel G Landwerlin Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Tue, 21 Mar 2023 17:05:21 -0700, Umesh Nerlige Ramappa wrote: > > In some OA formats, gpu_ts is a 64 bit value and the right shift can > result in bit[31] being set. This throws off the correlation and the > timelines. Apply the mask on gpu_ts as well. Reviewed-by: Ashutosh Dixit > Signed-off-by: Umesh Nerlige Ramappa > --- > lib/i915/perf_data_reader.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/lib/i915/perf_data_reader.c b/lib/i915/perf_data_reader.c > index 332f530e..2272ae2c 100644 > --- a/lib/i915/perf_data_reader.c > +++ b/lib/i915/perf_data_reader.c > @@ -216,6 +216,12 @@ correlate_gpu_timestamp(struct intel_perf_data_reader *reader, > uint64_t mask = reader->perf->devinfo.oa_timestamp_mask; > int corr_idx = -1; > > + /* On some OA formats, gpu_ts is a 64 bit value and the shift can > + * result in bit[31] being set. This throws off the correlation and the > + * timelines. Apply the mask on gpu_ts as well. > + */ > + gpu_ts = gpu_ts & mask; > + > for (uint32_t i = 0; i < reader->n_correlation_chunks; i++) { > if (gpu_ts >= (reader->correlation_chunks[i].gpu_ts_begin & mask) && > gpu_ts <= (reader->correlation_chunks[i].gpu_ts_end & mask)) {