From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>,
<intel-gfx@lists.freedesktop.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/perf: Clear out entire reports after reading if not power of 2 size
Date: Tue, 23 May 2023 17:31:47 +0300 [thread overview]
Message-ID: <ae490e97-4ac0-f2be-6381-50a86b426df0@intel.com> (raw)
In-Reply-To: <20230522201749.4094742-1-ashutosh.dixit@intel.com>
On 22/05/2023 23:17, Ashutosh Dixit wrote:
> Clearing out report id and timestamp as means to detect unlanded reports
> only works if report size is power of 2. That is, only when report size is
> a sub-multiple of the OA buffer size can we be certain that reports will
> land at the same place each time in the OA buffer (after rewind). If report
> size is not a power of 2, we need to zero out the entire report to be able
> to detect unlanded reports reliably.
>
> Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Sad but necessary unfortunately....
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> ---
> drivers/gpu/drm/i915/i915_perf.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index 19d5652300eeb..58284156428dc 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -877,12 +877,17 @@ static int gen8_append_oa_reports(struct i915_perf_stream *stream,
> stream->oa_buffer.last_ctx_id = ctx_id;
> }
>
> - /*
> - * Clear out the report id and timestamp as a means to detect unlanded
> - * reports.
> - */
> - oa_report_id_clear(stream, report32);
> - oa_timestamp_clear(stream, report32);
> + if (is_power_of_2(report_size)) {
> + /*
> + * Clear out the report id and timestamp as a means
> + * to detect unlanded reports.
> + */
> + oa_report_id_clear(stream, report32);
> + oa_timestamp_clear(stream, report32);
> + } else {
> + /* Zero out the entire report */
> + memset(report32, 0, report_size);
> + }
> }
>
> if (start_offset != *offset) {
next prev parent reply other threads:[~2023-05-23 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 20:17 [Intel-gfx] [PATCH] drm/i915/perf: Clear out entire reports after reading if not power of 2 size Ashutosh Dixit
2023-05-22 21:19 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2023-05-22 21:34 ` [Intel-gfx] [PATCH] " Umesh Nerlige Ramappa
2023-05-22 21:50 ` Dixit, Ashutosh
2023-05-23 17:50 ` Umesh Nerlige Ramappa
2023-05-23 8:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/perf: Clear out entire reports after reading if not power of 2 size (rev2) Patchwork
2023-05-23 10:21 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-05-23 14:31 ` Lionel Landwerlin [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-05-23 20:40 [Intel-gfx] [PATCH] drm/i915/perf: Clear out entire reports after reading if not power of 2 size Ashutosh Dixit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ae490e97-4ac0-f2be-6381-50a86b426df0@intel.com \
--to=lionel.g.landwerlin@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox