drm/i915/suspend: replace I915_READ()/WRITE() with intel_de_read()/write()
authorJani Nikula <jani.nikula@intel.com>
Mon, 30 Nov 2020 11:15:57 +0000 (13:15 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 1 Dec 2020 15:56:36 +0000 (17:56 +0200)
Another straggler with I915_READ() and I915_WRITE() uses gone.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201130111601.2817-6-jani.nikula@intel.com
drivers/gpu/drm/i915/i915_suspend.c

index db2111fc809e16fda37537448005db34c14d686f..63212df33c9ecee552d3ce501ef5dbee2bb49790 100644 (file)
@@ -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);