diff mbox series

[v2,3/4] drm/i915/gt: Re-work reset_csb

Message ID 20220128221020.188253-4-michael.cheng@intel.com (mailing list archive)
State New, archived
Headers show
Series Use drm_clflush* instead of clflush | expand

Commit Message

Michael Cheng Jan. 28, 2022, 10:10 p.m. UTC
Use drm_clflush_virt_range instead of directly invoking clflush. This
will prevent compiler errors when building for non-x86 architectures.

Signed-off-by: Michael Cheng <michael.cheng@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bowman, Casey G Jan. 29, 2022, 7:23 a.m. UTC | #1
> -----Original Message-----
> From: Cheng, Michael <michael.cheng@intel.com>
> Sent: Friday, January 28, 2022 2:10 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Cheng, Michael <michael.cheng@intel.com>; Bowman, Casey G
> <casey.g.bowman@intel.com>; De Marchi, Lucas
> <lucas.demarchi@intel.com>; Boyer, Wayne <wayne.boyer@intel.com>;
> ville.syrjala@linux.intel.com; Kuoppala, Mika <mika.kuoppala@intel.com>;
> Auld, Matthew <matthew.auld@intel.com>
> Subject: [PATCH v2 3/4] drm/i915/gt: Re-work reset_csb
> 
> Use drm_clflush_virt_range instead of directly invoking clflush. This will
> prevent compiler errors when building for non-x86 architectures.
> 
> Signed-off-by: Michael Cheng <michael.cheng@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> index 90b5daf9433d..e8a2e2683b81 100644
> --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> @@ -2951,6 +2951,8 @@ reset_csb(struct intel_engine_cs *engine, struct
> i915_request **inactive)
> 
>  	mb(); /* paranoia: read the CSB pointers from after the reset */
>  	clflush(execlists->csb_write);
> +	drm_clflush_virt_range(execlists->csb_write,
> +			sizeof(execlists->csb_write));

I only see the insertion of drm_clflush_virt_range() here, not the removal of the
clflush() call, which sounds like it's supposed to be replaced here, based on your
commit message.

>  	mb();
> 
>  	inactive = process_csb(engine, inactive); /* drain preemption events
> */
> --
> 2.25.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
index 90b5daf9433d..e8a2e2683b81 100644
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
@@ -2951,6 +2951,8 @@  reset_csb(struct intel_engine_cs *engine, struct i915_request **inactive)
 
 	mb(); /* paranoia: read the CSB pointers from after the reset */
 	clflush(execlists->csb_write);
+	drm_clflush_virt_range(execlists->csb_write,
+			sizeof(execlists->csb_write));
 	mb();
 
 	inactive = process_csb(engine, inactive); /* drain preemption events */