diff mbox series

[2/3] i915/perf: Do not add ggtt offset to hw_tail

Message ID 20230531235634.1309525-3-umesh.nerlige.ramappa@intel.com (mailing list archive)
State New, archived
Headers show
Series Avoid reading OA reports before they land | expand

Commit Message

Umesh Nerlige Ramappa May 31, 2023, 11:56 p.m. UTC
ggtt offset for hw_tail is not required for the calculations, so drop
it.

Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
---
 drivers/gpu/drm/i915/i915_perf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Dixit, Ashutosh June 1, 2023, 4:07 a.m. UTC | #1
On Wed, 31 May 2023 16:56:33 -0700, Umesh Nerlige Ramappa wrote:
>
> ggtt offset for hw_tail is not required for the calculations, so drop
> it.
>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_perf.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index 29124dcba8e2..beb1269422ca 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -565,7 +565,7 @@ static bool oa_buffer_check_unlocked(struct i915_perf_stream *stream)
>	partial_report_size %= report_size;
>
>	/* Subtract partial amount off the tail */
> -	hw_tail = gtt_offset + OA_TAKEN(hw_tail, partial_report_size);
> +	hw_tail = OA_TAKEN(hw_tail, partial_report_size);
>
>
>	/* NB: The head we observe here might effectively be a little
> @@ -575,7 +575,6 @@ static bool oa_buffer_check_unlocked(struct i915_perf_stream *stream)
>	head = stream->oa_buffer.head - gtt_offset;
>	aged_tail = stream->oa_buffer.tail - gtt_offset;
>
> -	hw_tail -= gtt_offset;

Yes gtt_offset addition/subtraction is now redundant after we drop the if-else.

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


>	tail = hw_tail;
>
>		/* Walk the stream backward until we find a report with report
> --
> 2.36.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 29124dcba8e2..beb1269422ca 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -565,7 +565,7 @@  static bool oa_buffer_check_unlocked(struct i915_perf_stream *stream)
 	partial_report_size %= report_size;
 
 	/* Subtract partial amount off the tail */
-	hw_tail = gtt_offset + OA_TAKEN(hw_tail, partial_report_size);
+	hw_tail = OA_TAKEN(hw_tail, partial_report_size);
 
 
 	/* NB: The head we observe here might effectively be a little
@@ -575,7 +575,6 @@  static bool oa_buffer_check_unlocked(struct i915_perf_stream *stream)
 	head = stream->oa_buffer.head - gtt_offset;
 	aged_tail = stream->oa_buffer.tail - gtt_offset;
 
-	hw_tail -= gtt_offset;
 	tail = hw_tail;
 
 		/* Walk the stream backward until we find a report with report