[RFC,08/33] drm/i915: Use intel_uncore_rmw in intel_gt_init_swizzling
diff mbox series

Message ID 20190617181236.7981-9-tvrtko.ursulin@linux.intel.com
State New
Headers show
Series
  • Implicit dev_priv removal and GT compartmentalization
Related show

Commit Message

Tvrtko Ursulin June 17, 2019, 6:12 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Two easy opportunities to compact the code by using the existing helper.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_fence_reg.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Chris Wilson June 17, 2019, 7:57 p.m. UTC | #1
Quoting Tvrtko Ursulin (2019-06-17 19:12:11)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Two easy opportunities to compact the code by using the existing helper.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Suggested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_fence_reg.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_fence_reg.c b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> index dd09790c420d..bcac359ec661 100644
> --- a/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> +++ b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> @@ -844,17 +844,12 @@ void intel_gt_init_swizzling(struct intel_gt *gt)
>             i915->mm.bit_6_swizzle_x == I915_BIT_6_SWIZZLE_NONE)
>                 return;
>  
> -       intel_uncore_write(uncore,
> -                          DISP_ARB_CTL,
> -                          intel_uncore_read(uncore, DISP_ARB_CTL) |
> -                          DISP_TILE_SURFACE_SWIZZLING);
> +       intel_uncore_rmw(uncore, DISP_ARB_CTL, 0, DISP_TILE_SURFACE_SWIZZLING);
>  
>         if (IS_GEN(i915, 5))
>                 return;
>  
> -       intel_uncore_write(uncore,
> -                          TILECTL,
> -                          intel_uncore_read(uncore, TILECTL) | TILECTL_SWZCTL);
> +       intel_uncore_rmw(uncore, TILECTL, 0, TILECTL_SWZCTL);

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_gem_fence_reg.c b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
index dd09790c420d..bcac359ec661 100644
--- a/drivers/gpu/drm/i915/i915_gem_fence_reg.c
+++ b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
@@ -844,17 +844,12 @@  void intel_gt_init_swizzling(struct intel_gt *gt)
 	    i915->mm.bit_6_swizzle_x == I915_BIT_6_SWIZZLE_NONE)
 		return;
 
-	intel_uncore_write(uncore,
-			   DISP_ARB_CTL,
-			   intel_uncore_read(uncore, DISP_ARB_CTL) |
-			   DISP_TILE_SURFACE_SWIZZLING);
+	intel_uncore_rmw(uncore, DISP_ARB_CTL, 0, DISP_TILE_SURFACE_SWIZZLING);
 
 	if (IS_GEN(i915, 5))
 		return;
 
-	intel_uncore_write(uncore,
-			   TILECTL,
-			   intel_uncore_read(uncore, TILECTL) | TILECTL_SWZCTL);
+	intel_uncore_rmw(uncore, TILECTL, 0, TILECTL_SWZCTL);
 
 	if (IS_GEN(i915, 6))
 		intel_uncore_write(uncore,