Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/perf: Consider OA buffer boundary when zeroing out reports
Date: Fri, 16 Jun 2023 11:14:37 -0700	[thread overview]
Message-ID: <87r0qbxoj6.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230616173402.699776-1-umesh.nerlige.ramappa@intel.com>

On Fri, 16 Jun 2023 10:34:02 -0700, Umesh Nerlige Ramappa wrote:
>
> For reports that are not powers of 2, reports at the end of the OA
> buffer may get split across the buffer boundary. When zeroing out such
> reports, take the split into consideration.
>
> v2: Use OA_BUFFER_SIZE (Ashutosh)
>
> Fixes: 09a36015d9a0 ("drm/i915/perf: Clear out entire reports after reading if not power of 2 size")
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_perf.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index b5491a382bfd..66ab6e1d5c7b 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -867,8 +867,17 @@ static int gen8_append_oa_reports(struct i915_perf_stream *stream,
>			oa_report_id_clear(stream, report32);
>			oa_timestamp_clear(stream, report32);
>		} else {
> +			u8 *oa_buf_end = stream->oa_buffer.vaddr +
> +					 OA_BUFFER_SIZE;

Above we already have "u8 *oa_buf_base = stream->oa_buffer.vaddr;" so we
could just use that?

> +			u32 part = oa_buf_end - (u8 *)report32;

We also have "u8 *report".

In any case:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

> +
>			/* Zero out the entire report */
> -			memset(report32, 0, report_size);
> +			if (report_size <= part) {
> +				memset(report32, 0, report_size);
> +			} else {
> +				memset(report32, 0, part);
> +				memset(oa_buf_base, 0, report_size - part);
> +			}
>		}
>	}
>
> --
> 2.36.1
>

  reply	other threads:[~2023-06-16 18:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 17:34 [Intel-gfx] [PATCH] drm/i915/perf: Consider OA buffer boundary when zeroing out reports Umesh Nerlige Ramappa
2023-06-16 18:14 ` Dixit, Ashutosh [this message]
2023-06-17  5:47 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/perf: Consider OA buffer boundary when zeroing out reports (rev2) Patchwork
2023-06-17 11:58 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-06-16  1:50 [Intel-gfx] [PATCH] drm/i915/perf: Consider OA buffer boundary when zeroing out reports Umesh Nerlige Ramappa
2023-06-16  6:39 ` Dixit, Ashutosh

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=87r0qbxoj6.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=umesh.nerlige.ramappa@intel.com \
    /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