Message ID | df957a1dfeddc14e4b62d6e2a1bf8104d506be87.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:51PM +0300, Jani Nikula wrote: > Avoid the implicit dev_priv local variable use, and pass dev_priv > explicitly to the SWF0 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 8aa35bbb2e1b..8b379ff60070 100644 > --- a/drivers/gpu/drm/i915/i915_reg.h > +++ b/drivers/gpu/drm/i915/i915_reg.h > @@ -2290,7 +2290,7 @@ > * [10:1f] all > * [30:32] all > */ > -#define SWF0(i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x70410 + (i) * 4) > +#define SWF0(dev_priv, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x70410 + (i) * 4) > #define SWF1(i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x71410 + (i) * 4) > #define SWF3(i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x72414 + (i) * 4) > #define SWF_ILK(i) _MMIO(0x4F000 + (i) * 4) > diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c > index bc449613c848..ac8221ae97f3 100644 > --- a/drivers/gpu/drm/i915/i915_suspend.c > +++ b/drivers/gpu/drm/i915/i915_suspend.c > @@ -40,7 +40,8 @@ static void intel_save_swf(struct drm_i915_private *dev_priv) > /* Scratch space */ > if (GRAPHICS_VER(dev_priv) == 2 && IS_MOBILE(dev_priv)) { > for (i = 0; i < 7; i++) { > - dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, SWF0(i)); > + dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, > + SWF0(dev_priv, i)); > dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, SWF1(i)); > } > for (i = 0; i < 3; i++) > @@ -50,7 +51,8 @@ static void intel_save_swf(struct drm_i915_private *dev_priv) > dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, SWF1(i)); > } else if (HAS_GMCH(dev_priv)) { > for (i = 0; i < 16; i++) { > - dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, SWF0(i)); > + dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, > + SWF0(dev_priv, i)); > dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, SWF1(i)); > } > for (i = 0; i < 3; i++) > @@ -65,7 +67,8 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv) > /* Scratch space */ > if (GRAPHICS_VER(dev_priv) == 2 && IS_MOBILE(dev_priv)) { > for (i = 0; i < 7; i++) { > - intel_de_write(dev_priv, SWF0(i), dev_priv->regfile.saveSWF0[i]); > + intel_de_write(dev_priv, SWF0(dev_priv, i), > + dev_priv->regfile.saveSWF0[i]); > intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]); > } > for (i = 0; i < 3; i++) > @@ -75,7 +78,8 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv) > intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]); > } else if (HAS_GMCH(dev_priv)) { > for (i = 0; i < 16; i++) { > - intel_de_write(dev_priv, SWF0(i), dev_priv->regfile.saveSWF0[i]); > + intel_de_write(dev_priv, SWF0(dev_priv, i), > + dev_priv->regfile.saveSWF0[i]); > intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]); > } > for (i = 0; i < 3; i++) > -- > 2.39.2 >
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 8aa35bbb2e1b..8b379ff60070 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -2290,7 +2290,7 @@ * [10:1f] all * [30:32] all */ -#define SWF0(i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x70410 + (i) * 4) +#define SWF0(dev_priv, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x70410 + (i) * 4) #define SWF1(i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x71410 + (i) * 4) #define SWF3(i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x72414 + (i) * 4) #define SWF_ILK(i) _MMIO(0x4F000 + (i) * 4) diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index bc449613c848..ac8221ae97f3 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c @@ -40,7 +40,8 @@ static void intel_save_swf(struct drm_i915_private *dev_priv) /* Scratch space */ if (GRAPHICS_VER(dev_priv) == 2 && IS_MOBILE(dev_priv)) { for (i = 0; i < 7; i++) { - dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, SWF0(i)); + dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, + SWF0(dev_priv, i)); dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, SWF1(i)); } for (i = 0; i < 3; i++) @@ -50,7 +51,8 @@ static void intel_save_swf(struct drm_i915_private *dev_priv) dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, SWF1(i)); } else if (HAS_GMCH(dev_priv)) { for (i = 0; i < 16; i++) { - dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, SWF0(i)); + dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, + SWF0(dev_priv, i)); dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, SWF1(i)); } for (i = 0; i < 3; i++) @@ -65,7 +67,8 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv) /* Scratch space */ if (GRAPHICS_VER(dev_priv) == 2 && IS_MOBILE(dev_priv)) { for (i = 0; i < 7; i++) { - intel_de_write(dev_priv, SWF0(i), dev_priv->regfile.saveSWF0[i]); + intel_de_write(dev_priv, SWF0(dev_priv, i), + dev_priv->regfile.saveSWF0[i]); intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]); } for (i = 0; i < 3; i++) @@ -75,7 +78,8 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv) intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]); } else if (HAS_GMCH(dev_priv)) { for (i = 0; i < 16; i++) { - intel_de_write(dev_priv, SWF0(i), dev_priv->regfile.saveSWF0[i]); + intel_de_write(dev_priv, SWF0(dev_priv, i), + dev_priv->regfile.saveSWF0[i]); intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]); } for (i = 0; i < 3; i++)
Avoid the implicit dev_priv local variable use, and pass dev_priv explicitly to the SWF0 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(-)