Message ID | 5ab27d6a4366617ba273e526a46a505c3d3c3295.1717514638.git.jani.nikula@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915: finish the job of removing implicit dev_priv | expand |
On Tue, Jun 04, 2024 at 06:25:53PM +0300, Jani Nikula wrote: > Avoid the implicit dev_priv local variable use, and pass dev_priv > explicitly to the SWF3 register macro. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > Signed-off-by: Jani Nikula <jani.nikula@intel.com> > --- > drivers/gpu/drm/i915/i915_reg.h | 2 +- > drivers/gpu/drm/i915/i915_suspend.c | 12 ++++++++---- > 2 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h > index 81f1b491d7af..2f942882e7ed 100644 > --- a/drivers/gpu/drm/i915/i915_reg.h > +++ b/drivers/gpu/drm/i915/i915_reg.h > @@ -2292,7 +2292,7 @@ > */ > #define SWF0(dev_priv, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x70410 + (i) * 4) > #define SWF1(dev_priv, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x71410 + (i) * 4) > -#define SWF3(i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x72414 + (i) * 4) > +#define SWF3(dev_priv, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x72414 + (i) * 4) > #define SWF_ILK(i) _MMIO(0x4F000 + (i) * 4) > > /* Pipe B */ > diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c > index 8a71c1f52cb4..f8373a461f17 100644 > --- a/drivers/gpu/drm/i915/i915_suspend.c > +++ b/drivers/gpu/drm/i915/i915_suspend.c > @@ -46,7 +46,8 @@ static void intel_save_swf(struct drm_i915_private *dev_priv) > SWF1(dev_priv, i)); > } > for (i = 0; i < 3; i++) > - dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, SWF3(i)); > + dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, > + SWF3(dev_priv, i)); > } else if (GRAPHICS_VER(dev_priv) == 2) { > for (i = 0; i < 7; i++) > dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, > @@ -59,7 +60,8 @@ static void intel_save_swf(struct drm_i915_private *dev_priv) > SWF1(dev_priv, i)); > } > for (i = 0; i < 3; i++) > - dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, SWF3(i)); > + dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, > + SWF3(dev_priv, i)); > } > } > > @@ -76,7 +78,8 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv) > dev_priv->regfile.saveSWF1[i]); > } > for (i = 0; i < 3; i++) > - intel_de_write(dev_priv, SWF3(i), dev_priv->regfile.saveSWF3[i]); > + intel_de_write(dev_priv, SWF3(dev_priv, i), > + dev_priv->regfile.saveSWF3[i]); > } else if (GRAPHICS_VER(dev_priv) == 2) { > for (i = 0; i < 7; i++) > intel_de_write(dev_priv, SWF1(dev_priv, i), > @@ -89,7 +92,8 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv) > dev_priv->regfile.saveSWF1[i]); > } > for (i = 0; i < 3; i++) > - intel_de_write(dev_priv, SWF3(i), dev_priv->regfile.saveSWF3[i]); > + intel_de_write(dev_priv, SWF3(dev_priv, i), > + dev_priv->regfile.saveSWF3[i]); > } > } > > -- > 2.39.2 >
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 81f1b491d7af..2f942882e7ed 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -2292,7 +2292,7 @@ */ #define SWF0(dev_priv, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x70410 + (i) * 4) #define SWF1(dev_priv, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x71410 + (i) * 4) -#define SWF3(i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x72414 + (i) * 4) +#define SWF3(dev_priv, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x72414 + (i) * 4) #define SWF_ILK(i) _MMIO(0x4F000 + (i) * 4) /* Pipe B */ diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 8a71c1f52cb4..f8373a461f17 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c @@ -46,7 +46,8 @@ static void intel_save_swf(struct drm_i915_private *dev_priv) SWF1(dev_priv, i)); } for (i = 0; i < 3; i++) - dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, SWF3(i)); + dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, + SWF3(dev_priv, i)); } else if (GRAPHICS_VER(dev_priv) == 2) { for (i = 0; i < 7; i++) dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, @@ -59,7 +60,8 @@ static void intel_save_swf(struct drm_i915_private *dev_priv) SWF1(dev_priv, i)); } for (i = 0; i < 3; i++) - dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, SWF3(i)); + dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, + SWF3(dev_priv, i)); } } @@ -76,7 +78,8 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv) dev_priv->regfile.saveSWF1[i]); } for (i = 0; i < 3; i++) - intel_de_write(dev_priv, SWF3(i), dev_priv->regfile.saveSWF3[i]); + intel_de_write(dev_priv, SWF3(dev_priv, i), + dev_priv->regfile.saveSWF3[i]); } else if (GRAPHICS_VER(dev_priv) == 2) { for (i = 0; i < 7; i++) intel_de_write(dev_priv, SWF1(dev_priv, i), @@ -89,7 +92,8 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv) dev_priv->regfile.saveSWF1[i]); } for (i = 0; i < 3; i++) - intel_de_write(dev_priv, SWF3(i), dev_priv->regfile.saveSWF3[i]); + intel_de_write(dev_priv, SWF3(dev_priv, i), + dev_priv->regfile.saveSWF3[i]); } }
Avoid the implicit dev_priv local variable use, and pass dev_priv explicitly to the SWF3 register macro. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/i915_reg.h | 2 +- drivers/gpu/drm/i915/i915_suspend.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-)