[Intel-gfx] [PATCH 6/9] drm/i915/suspend: replace I915_READ()/WRITE() with intel_de_read()/write()

Rodrigo Vivi rodrigo.vivi at intel.com
Thu Nov 12 20:27:39 UTC 2020


On Thu, Nov 12, 2020 at 01:44:39PM +0200, Jani Nikula wrote:
> Another straggler with I915_READ() and I915_WRITE() uses gone.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>


Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

> ---
>  drivers/gpu/drm/i915/i915_suspend.c | 33 +++++++++++++++--------------
>  1 file changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index db2111fc809e..63212df33c9e 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -24,6 +24,7 @@
>   * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
>   */
>  
> +#include "display/intel_de.h"
>  #include "display/intel_fbc.h"
>  #include "display/intel_gmbus.h"
>  #include "display/intel_vga.h"
> @@ -39,21 +40,21 @@ static void intel_save_swf(struct drm_i915_private *dev_priv)
>  	/* Scratch space */
>  	if (IS_GEN(dev_priv, 2) && IS_MOBILE(dev_priv)) {
>  		for (i = 0; i < 7; i++) {
> -			dev_priv->regfile.saveSWF0[i] = I915_READ(SWF0(i));
> -			dev_priv->regfile.saveSWF1[i] = I915_READ(SWF1(i));
> +			dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, SWF0(i));
> +			dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, SWF1(i));
>  		}
>  		for (i = 0; i < 3; i++)
> -			dev_priv->regfile.saveSWF3[i] = I915_READ(SWF3(i));
> +			dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, SWF3(i));
>  	} else if (IS_GEN(dev_priv, 2)) {
>  		for (i = 0; i < 7; i++)
> -			dev_priv->regfile.saveSWF1[i] = I915_READ(SWF1(i));
> +			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] = I915_READ(SWF0(i));
> -			dev_priv->regfile.saveSWF1[i] = I915_READ(SWF1(i));
> +			dev_priv->regfile.saveSWF0[i] = intel_de_read(dev_priv, SWF0(i));
> +			dev_priv->regfile.saveSWF1[i] = intel_de_read(dev_priv, SWF1(i));
>  		}
>  		for (i = 0; i < 3; i++)
> -			dev_priv->regfile.saveSWF3[i] = I915_READ(SWF3(i));
> +			dev_priv->regfile.saveSWF3[i] = intel_de_read(dev_priv, SWF3(i));
>  	}
>  }
>  
> @@ -64,21 +65,21 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv)
>  	/* Scratch space */
>  	if (IS_GEN(dev_priv, 2) && IS_MOBILE(dev_priv)) {
>  		for (i = 0; i < 7; i++) {
> -			I915_WRITE(SWF0(i), dev_priv->regfile.saveSWF0[i]);
> -			I915_WRITE(SWF1(i), dev_priv->regfile.saveSWF1[i]);
> +			intel_de_write(dev_priv, SWF0(i), dev_priv->regfile.saveSWF0[i]);
> +			intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]);
>  		}
>  		for (i = 0; i < 3; i++)
> -			I915_WRITE(SWF3(i), dev_priv->regfile.saveSWF3[i]);
> +			intel_de_write(dev_priv, SWF3(i), dev_priv->regfile.saveSWF3[i]);
>  	} else if (IS_GEN(dev_priv, 2)) {
>  		for (i = 0; i < 7; i++)
> -			I915_WRITE(SWF1(i), dev_priv->regfile.saveSWF1[i]);
> +			intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]);
>  	} else if (HAS_GMCH(dev_priv)) {
>  		for (i = 0; i < 16; i++) {
> -			I915_WRITE(SWF0(i), dev_priv->regfile.saveSWF0[i]);
> -			I915_WRITE(SWF1(i), dev_priv->regfile.saveSWF1[i]);
> +			intel_de_write(dev_priv, SWF0(i), dev_priv->regfile.saveSWF0[i]);
> +			intel_de_write(dev_priv, SWF1(i), dev_priv->regfile.saveSWF1[i]);
>  		}
>  		for (i = 0; i < 3; i++)
> -			I915_WRITE(SWF3(i), dev_priv->regfile.saveSWF3[i]);
> +			intel_de_write(dev_priv, SWF3(i), dev_priv->regfile.saveSWF3[i]);
>  	}
>  }
>  
> @@ -88,7 +89,7 @@ void i915_save_display(struct drm_i915_private *dev_priv)
>  
>  	/* Display arbitration control */
>  	if (INTEL_GEN(dev_priv) <= 4)
> -		dev_priv->regfile.saveDSPARB = I915_READ(DSPARB);
> +		dev_priv->regfile.saveDSPARB = intel_de_read(dev_priv, DSPARB);
>  
>  	if (IS_GEN(dev_priv, 4))
>  		pci_read_config_word(pdev, GCDGMBUS,
> @@ -109,7 +110,7 @@ void i915_restore_display(struct drm_i915_private *dev_priv)
>  
>  	/* Display arbitration */
>  	if (INTEL_GEN(dev_priv) <= 4)
> -		I915_WRITE(DSPARB, dev_priv->regfile.saveDSPARB);
> +		intel_de_write(dev_priv, DSPARB, dev_priv->regfile.saveDSPARB);
>  
>  	/* only restore FBC info on the platform that supports FBC*/
>  	intel_fbc_global_disable(dev_priv);
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list