Skip to contentSkip to conversation

disable more register safe/restore code for kms

PATCH In review Daniel Vetter 4 participants 9 messages Jan 25, 2013 – Jan 28, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover disable more register safe/restore code for kms

Hi all,

Jani's recent comment that this is a mess spurred me to pick this up again. An it looks like it'll simplify parts of the vlv display register rework, too (the 3rd patch to disable legacy VGA safe/restore).

Big move here is that I'm starting a i915_ums.c file to hide all this display-related non-kms stuff from our views.

Review and comments highly welcome.

Cheers, Daniel

Daniel Vetter (4):
drm/i915: move modeset checks out of save/restore_modeset_reg drm/i915: extract ums suspend/resume into i915_ums.c drm/i915: dont save/restore VGA state for kms drm/i915: move DP save/restore into i915_ums.c

 drivers/gpu/drm/i915/Makefile        |   1 +
 drivers/gpu/drm/i915/i915_drv.h      |   7 +-
 drivers/gpu/drm/i915/i915_suspend.c  | 540 ++---------------------------------
 drivers/gpu/drm/i915/i915_ums.c      | 503 ++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c |   2 +-
 5 files changed, 540 insertions(+), 513 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/i915_ums.c
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/4 drm/i915: move modeset checks out of save/restore_modeset_reg

That way the control flow is clearer, and it prepares the stage to extract these ums functions and hide them somewhere.

There's still tons of display stuff outside of these, but that requires more work.

---
 drivers/gpu/drm/i915/i915_suspend.c | 38 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/i915_suspend.c +15 -23
index 63d4d30..2e3a8a6 100644
@@ -240,9 +240,6 @@ static void i915_save_modeset_reg(struct drm_device *dev)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	int i;
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		return;
-
 	/* Cursor state */
 	dev_priv->regfile.saveCURACNTR = I915_READ(_CURACNTR);
 	dev_priv->regfile.saveCURAPOS = I915_READ(_CURAPOS);
@@ -410,8 +407,17 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
 	int dpll_b_reg, fpb0_reg, fpb1_reg;
 	int i;
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		return;
+	/* Display port ratios (must be done before clock is set) */
+	if (SUPPORTS_INTEGRATED_DP(dev)) {
+		I915_WRITE(_PIPEA_GMCH_DATA_M, dev_priv->regfile.savePIPEA_GMCH_DATA_M);
+		I915_WRITE(_PIPEB_GMCH_DATA_M, dev_priv->regfile.savePIPEB_GMCH_DATA_M);
+		I915_WRITE(_PIPEA_GMCH_DATA_N, dev_priv->regfile.savePIPEA_GMCH_DATA_N);
+		I915_WRITE(_PIPEB_GMCH_DATA_N, dev_priv->regfile.savePIPEB_GMCH_DATA_N);
+		I915_WRITE(_PIPEA_DP_LINK_M, dev_priv->regfile.savePIPEA_DP_LINK_M);
+		I915_WRITE(_PIPEB_DP_LINK_M, dev_priv->regfile.savePIPEB_DP_LINK_M);
+		I915_WRITE(_PIPEA_DP_LINK_N, dev_priv->regfile.savePIPEA_DP_LINK_N);
+		I915_WRITE(_PIPEB_DP_LINK_N, dev_priv->regfile.savePIPEB_DP_LINK_N);
+	}
 
 	/* Fences */
 	switch (INTEL_INFO(dev)->gen) {
@@ -624,7 +630,8 @@ static void i915_save_display(struct drm_device *dev)
 
 	/* This is only meaningful in non-KMS mode */
 	/* Don't regfile.save them in KMS mode */
-	i915_save_modeset_reg(dev);
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		i915_save_modeset_reg(dev);
 
 	/* LVDS state */
 	if (HAS_PCH_SPLIT(dev)) {
@@ -709,23 +716,8 @@ static void i915_restore_display(struct drm_device *dev)
 	/* Display arbitration */
 	I915_WRITE(DSPARB, dev_priv->regfile.saveDSPARB);
 
-	if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
-		/* Display port ratios (must be done before clock is set) */
-		if (SUPPORTS_INTEGRATED_DP(dev)) {
-			I915_WRITE(_PIPEA_GMCH_DATA_M, dev_priv->regfile.savePIPEA_GMCH_DATA_M);
-			I915_WRITE(_PIPEB_GMCH_DATA_M, dev_priv->regfile.savePIPEB_GMCH_DATA_M);
-			I915_WRITE(_PIPEA_GMCH_DATA_N, dev_priv->regfile.savePIPEA_GMCH_DATA_N);
-			I915_WRITE(_PIPEB_GMCH_DATA_N, dev_priv->regfile.savePIPEB_GMCH_DATA_N);
-			I915_WRITE(_PIPEA_DP_LINK_M, dev_priv->regfile.savePIPEA_DP_LINK_M);
-			I915_WRITE(_PIPEB_DP_LINK_M, dev_priv->regfile.savePIPEB_DP_LINK_M);
-			I915_WRITE(_PIPEA_DP_LINK_N, dev_priv->regfile.savePIPEA_DP_LINK_N);
-			I915_WRITE(_PIPEB_DP_LINK_N, dev_priv->regfile.savePIPEB_DP_LINK_N);
-		}
-	}
-
-	/* This is only meaningful in non-KMS mode */
-	/* Don't restore them in KMS mode */
-	i915_restore_modeset_reg(dev);
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		i915_restore_modeset_reg(dev);
 
 	/* LVDS state */
 	if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev))
Signature · 1 line
1.7.11.7
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] drm/i915: move modeset checks out of save/restore_modeset_reg

Quoted 68 lines · Daniel Vetter

That way the control flow is clearer, and it prepares the stage to extract these ums functions and hide them somewhere.

There's still tons of display stuff outside of these, but that requires more work.

---
 drivers/gpu/drm/i915/i915_suspend.c | 38 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/i915_suspend.c +13 -15
index 63d4d30..2e3a8a6 100644
@@ -240,9 +240,6 @@ static void i915_save_modeset_reg(struct drm_device *dev)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	int i;
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		return;
-
 	/* Cursor state */
 	dev_priv->regfile.saveCURACNTR = I915_READ(_CURACNTR);
 	dev_priv->regfile.saveCURAPOS = I915_READ(_CURAPOS);
@@ -410,8 +407,17 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
 	int dpll_b_reg, fpb0_reg, fpb1_reg;
 	int i;
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		return;
+	/* Display port ratios (must be done before clock is set) */
+	if (SUPPORTS_INTEGRATED_DP(dev)) {
+		I915_WRITE(_PIPEA_GMCH_DATA_M, dev_priv->regfile.savePIPEA_GMCH_DATA_M);
+		I915_WRITE(_PIPEB_GMCH_DATA_M, dev_priv->regfile.savePIPEB_GMCH_DATA_M);
+		I915_WRITE(_PIPEA_GMCH_DATA_N, dev_priv->regfile.savePIPEA_GMCH_DATA_N);
+		I915_WRITE(_PIPEB_GMCH_DATA_N, dev_priv->regfile.savePIPEB_GMCH_DATA_N);
+		I915_WRITE(_PIPEA_DP_LINK_M, dev_priv->regfile.savePIPEA_DP_LINK_M);
+		I915_WRITE(_PIPEB_DP_LINK_M, dev_priv->regfile.savePIPEB_DP_LINK_M);
+		I915_WRITE(_PIPEA_DP_LINK_N, dev_priv->regfile.savePIPEA_DP_LINK_N);
+		I915_WRITE(_PIPEB_DP_LINK_N, dev_priv->regfile.savePIPEB_DP_LINK_N);
+	}
 
 	/* Fences */
 	switch (INTEL_INFO(dev)->gen) {
@@ -624,7 +630,8 @@ static void i915_save_display(struct drm_device *dev)
 
 	/* This is only meaningful in non-KMS mode */
 	/* Don't regfile.save them in KMS mode */
-	i915_save_modeset_reg(dev);
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		i915_save_modeset_reg(dev);
 
 	/* LVDS state */
 	if (HAS_PCH_SPLIT(dev)) {
@@ -709,23 +716,8 @@ static void i915_restore_display(struct drm_device *dev)
 	/* Display arbitration */
 	I915_WRITE(DSPARB, dev_priv->regfile.saveDSPARB);
 
-	if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
-		/* Display port ratios (must be done before clock is set) */
-		if (SUPPORTS_INTEGRATED_DP(dev)) {
-			I915_WRITE(_PIPEA_GMCH_DATA_M, dev_priv->regfile.savePIPEA_GMCH_DATA_M);
-			I915_WRITE(_PIPEB_GMCH_DATA_M, dev_priv->regfile.savePIPEB_GMCH_DATA_M);
-			I915_WRITE(_PIPEA_GMCH_DATA_N, dev_priv->regfile.savePIPEA_GMCH_DATA_N);
-			I915_WRITE(_PIPEB_GMCH_DATA_N, dev_priv->regfile.savePIPEB_GMCH_DATA_N);
-			I915_WRITE(_PIPEA_DP_LINK_M, dev_priv->regfile.savePIPEA_DP_LINK_M);
-			I915_WRITE(_PIPEB_DP_LINK_M, dev_priv->regfile.savePIPEB_DP_LINK_M);

drivers/gpu/drm/i915/i915_suspend.c static void i915_restore_display(struct drm_device *dev) · line 720

Quoted 10 lines
drivers/gpu/drm/i915/i915_suspend.c +2 -8
-			I915_WRITE(_PIPEA_DP_LINK_N, dev_priv->regfile.savePIPEA_DP_LINK_N);
-			I915_WRITE(_PIPEB_DP_LINK_N, dev_priv->regfile.savePIPEB_DP_LINK_N);
-		}
-	}
-
-	/* This is only meaningful in non-KMS mode */
-	/* Don't restore them in KMS mode */
-	i915_restore_modeset_reg(dev);
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		i915_restore_modeset_reg(dev);

s/modeset/display/ as discussed on IRC. Also would be nice to use format-patch -C for things like patch 2/4 in the future, as that'd make reviewing easier imo. Otherwise on the series:

Quoted 3 lines
drivers/gpu/drm/i915/i915_suspend.c +0 -0
 	/* LVDS state */
 	if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev))
#3 lore raw

Re: [PATCH 1/4] drm/i915: move modeset checks out of save/restore_modeset_reg

Quoted 7 lines · Imre Deak
Quoted 6 lines · Daniel Vetter

That way the control flow is clearer, and it prepares the stage to extract these ums functions and hide them somewhere.

There's still tons of display stuff outside of these, but that requires more work.

Quoted 7 lines
Quoted 1 line

s/modeset/display/ as discussed on IRC. Also would be nice to use format-patch -C for things like patch 2/4 in the future, as that'd make reviewing easier imo. Otherwise on the series:

Ok, slurped in the entire series, with your suggestion applied to patch 2 (less conflicts that way to resolve). Thanks for the review. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw

PATCH 2/4 drm/i915: extract ums suspend/resume into i915_ums.c

In reply to Daniel Vetter

Similarly to how i915_dma.c is shaping up to be the dungeon hole for all things supporting dri1, create a new one to hide all the crazy things which are only really useful for ums support. Biggest part is the register suspend/resume support.

Unfortunately a lot of it is still intermingled with bits and pieces we might still need, so needs more analysis and needs to stay in i915_suspend.c for now.

---
 drivers/gpu/drm/i915/Makefile       |   1 +
 drivers/gpu/drm/i915/i915_drv.h     |   6 +-
 drivers/gpu/drm/i915/i915_suspend.c | 447 ---------------------------------
 drivers/gpu/drm/i915/i915_ums.c     | 479 ++++++++++++++++++++++++++++++++++++
 4 files changed, 483 insertions(+), 450 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/i915_ums.c
drivers/gpu/drm/i915/Makefile +1 -0
index 0f2c549..011fd8d 100644
@@ -14,6 +14,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \
 	  i915_gem_gtt.o \
 	  i915_gem_stolen.o \
 	  i915_gem_tiling.o \
+	  i915_ums.o \
 	  i915_sysfs.o \
 	  i915_trace_points.o \
 	  intel_display.o \
drivers/gpu/drm/i915/i915_drv.h +3 -3
index 56ece50..953060c 100644
@@ -1729,9 +1729,9 @@ void i915_debugfs_cleanup(struct drm_minor *minor);
 extern int i915_save_state(struct drm_device *dev);
 extern int i915_restore_state(struct drm_device *dev);
 
-/* i915_suspend.c */
-extern int i915_save_state(struct drm_device *dev);
-extern int i915_restore_state(struct drm_device *dev);
+/* i915_ums.c */
+void i915_save_modeset_reg(struct drm_device *dev);
+void i915_restore_modeset_reg(struct drm_device *dev);
 
 /* i915_sysfs.c */
 void i915_setup_sysfs(struct drm_device *dev_priv);
drivers/gpu/drm/i915/i915_suspend.c +0 -447

459 lines not on this page · raw message

drivers/gpu/drm/i915/i915_ums.c new file +479 -0

479 lines not on this page · raw message

Signature · 1 line
1.7.11.7
#5 lore raw

PATCH 3/4 drm/i915: dont save/restore VGA state for kms

In reply to Daniel Vetter

The only thing we really care about that it is off. To do so, reuse the recently created i915_redisable_vga function, which is already used to put obnoxious firmware into check on lid reopening.

---
 drivers/gpu/drm/i915/i915_drv.h      |  1 +
 drivers/gpu/drm/i915/i915_suspend.c  | 48 +++++++++++++++++++-----------------
 drivers/gpu/drm/i915/intel_display.c |  2 +-
 3 files changed, 28 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 953060c..0ce7c8a 100644
@@ -1788,6 +1788,7 @@ extern void intel_modeset_cleanup(struct drm_device *dev);
 extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
 extern void intel_modeset_setup_hw_state(struct drm_device *dev,
 					 bool force_restore);
+extern void i915_redisable_vga(struct drm_device *dev);
 extern bool intel_fbc_enabled(struct drm_device *dev);
 extern void intel_disable_fbc(struct drm_device *dev);
 extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
drivers/gpu/drm/i915/i915_suspend.c +26 -22

73 lines not on this page · raw message

drivers/gpu/drm/i915/intel_display.c +1 -1
index 886124a..e1b5977 100644
@@ -8911,7 +8911,7 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
 	 * the crtc fixup. */
 }
 
-static void i915_redisable_vga(struct drm_device *dev)
+void i915_redisable_vga(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 vga_reg;
Signature · 1 line
1.7.11.7
#6 lore raw

Re: [PATCH 3/4] drm/i915: dont save/restore VGA state for kms

Quoted 28 lines · Daniel Vetter

The only thing we really care about that it is off. To do so, reuse the recently created i915_redisable_vga function, which is already used to put obnoxious firmware into check on lid reopening.

---
 drivers/gpu/drm/i915/i915_drv.h      |  1 +
 drivers/gpu/drm/i915/i915_suspend.c  | 48 +++++++++++++++++++-----------------
 drivers/gpu/drm/i915/intel_display.c |  2 +-
 3 files changed, 28 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 953060c..0ce7c8a 100644
@@ -1788,6 +1788,7 @@ extern void intel_modeset_cleanup(struct drm_device *dev);
 extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
 extern void intel_modeset_setup_hw_state(struct drm_device *dev,
 					 bool force_restore);
+extern void i915_redisable_vga(struct drm_device *dev);
 extern bool intel_fbc_enabled(struct drm_device *dev);
 extern void intel_disable_fbc(struct drm_device *dev);
 extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
drivers/gpu/drm/i915/i915_suspend.c +0 -0
index 056bd12..edcbfaf 100644

drivers/gpu/drm/i915/i915_suspend.c static void i915_save_vga(struct drm_device *dev) · line 75

Quoted 7 lines
drivers/gpu/drm/i915/i915_suspend.c +4 -0
@@ -69,6 +69,15 @@ static void i915_save_vga(struct drm_device *dev)
 	int i;
 	u16 cr_index, cr_data, st01;
 
+	/* VGA state */
+	dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
+	dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
+	dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);

BTW these three don't seem to exist on PCH platforms at all. I guess gen <= 4 would be the most appropriate check since VLV doesn't have them either, but in this code it doesn't matter much if the check is for non-PCH instead. I'll include a patch for this in my IS_DISPLAYREG() series.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#7 lore raw

Re: [PATCH 3/4] drm/i915: dont save/restore VGA state for kms

Quoted 32 lines · Ville Syrjälä
Quoted 31 lines · Daniel Vetter

The only thing we really care about that it is off. To do so, reuse the recently created i915_redisable_vga function, which is already used to put obnoxious firmware into check on lid reopening.

---
 drivers/gpu/drm/i915/i915_drv.h      |  1 +
 drivers/gpu/drm/i915/i915_suspend.c  | 48 +++++++++++++++++++-----------------
 drivers/gpu/drm/i915/intel_display.c |  2 +-
 3 files changed, 28 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 953060c..0ce7c8a 100644
@@ -1788,6 +1788,7 @@ extern void intel_modeset_cleanup(struct drm_device *dev);
 extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
 extern void intel_modeset_setup_hw_state(struct drm_device *dev,
 					 bool force_restore);
+extern void i915_redisable_vga(struct drm_device *dev);
 extern bool intel_fbc_enabled(struct drm_device *dev);
 extern void intel_disable_fbc(struct drm_device *dev);
 extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
drivers/gpu/drm/i915/i915_suspend.c +0 -0
index 056bd12..edcbfaf 100644
@@ -69,6 +69,15 @@ static void i915_save_vga(struct drm_device *dev)
 	int i;
 	u16 cr_index, cr_data, st01;
 
Quoted 10 lines

drivers/gpu/drm/i915/i915_suspend.c static void i915_save_vga(struct drm_device *dev) · line 75

Quoted 4 lines
drivers/gpu/drm/i915/i915_suspend.c +4 -0
+	/* VGA state */
+	dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
+	dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
+	dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);

BTW these three don't seem to exist on PCH platforms at all. I guess gen <= 4 would be the most appropriate check since VLV doesn't have them either, but in this code it doesn't matter much if the check is for non-PCH instead. I'll include a patch for this in my IS_DISPLAYREG() series.

We refuse to load the driver if modesetting isn't enabled and we're on gen6+. And ums on ilk was only ever supported by rhel. So Imo we can just punt on this as not a problem, now that the legacy vga state is only saved/restored in ums mode.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#8 lore raw

PATCH 4/4 drm/i915: move DP save/restore into i915_ums.c

In reply to Daniel Vetter

Note that this slightly changes the order, but we only move it within the block of registers that restore encoder state. Specifically LVDS is now restored after DP, whereas previously it was done before.

Legacy vga is still restored afterwards, which seems to be the important thing (if there's anything important in this restore ordering at all).

---
 drivers/gpu/drm/i915/i915_suspend.c | 29 +----------------------------
 drivers/gpu/drm/i915/i915_ums.c     | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 28 deletions(-)
drivers/gpu/drm/i915/i915_suspend.c +1 -28
index edcbfaf..b6b8888 100644
@@ -239,24 +239,6 @@ static void i915_save_display(struct drm_device *dev)
 		dev_priv->regfile.savePP_DIVISOR = I915_READ(PP_DIVISOR);
 	}
 
-	if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
-		/* Display Port state */
-		if (SUPPORTS_INTEGRATED_DP(dev)) {
-			dev_priv->regfile.saveDP_B = I915_READ(DP_B);
-			dev_priv->regfile.saveDP_C = I915_READ(DP_C);
-			dev_priv->regfile.saveDP_D = I915_READ(DP_D);
-			dev_priv->regfile.savePIPEA_GMCH_DATA_M = I915_READ(_PIPEA_GMCH_DATA_M);
-			dev_priv->regfile.savePIPEB_GMCH_DATA_M = I915_READ(_PIPEB_GMCH_DATA_M);
-			dev_priv->regfile.savePIPEA_GMCH_DATA_N = I915_READ(_PIPEA_GMCH_DATA_N);
-			dev_priv->regfile.savePIPEB_GMCH_DATA_N = I915_READ(_PIPEB_GMCH_DATA_N);
-			dev_priv->regfile.savePIPEA_DP_LINK_M = I915_READ(_PIPEA_DP_LINK_M);
-			dev_priv->regfile.savePIPEB_DP_LINK_M = I915_READ(_PIPEB_DP_LINK_M);
-			dev_priv->regfile.savePIPEA_DP_LINK_N = I915_READ(_PIPEA_DP_LINK_N);
-			dev_priv->regfile.savePIPEB_DP_LINK_N = I915_READ(_PIPEB_DP_LINK_N);
-		}
-		/* FIXME: regfile.save TV & SDVO state */
-	}
-
 	/* Only regfile.save FBC state on the platform that supports FBC */
 	if (I915_HAS_FBC(dev)) {
 		if (HAS_PCH_SPLIT(dev)) {
@@ -321,16 +303,6 @@ static void i915_restore_display(struct drm_device *dev)
 		I915_WRITE(PP_CONTROL, dev_priv->regfile.savePP_CONTROL);
 	}
 
-	if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
-		/* Display Port state */
-		if (SUPPORTS_INTEGRATED_DP(dev)) {
-			I915_WRITE(DP_B, dev_priv->regfile.saveDP_B);
-			I915_WRITE(DP_C, dev_priv->regfile.saveDP_C);
-			I915_WRITE(DP_D, dev_priv->regfile.saveDP_D);
-		}
-		/* FIXME: restore TV & SDVO state */
-	}
-
 	/* only restore FBC info on the platform that supports FBC*/
 	intel_disable_fbc(dev);
 	if (I915_HAS_FBC(dev)) {
@@ -345,6 +317,7 @@ static void i915_restore_display(struct drm_device *dev)
 			I915_WRITE(FBC_CONTROL, dev_priv->regfile.saveFBC_CONTROL);
 		}
 	}
+
 	if (!drm_core_check_feature(dev, DRIVER_MODESET))
 		i915_restore_vga(dev);
 	else
drivers/gpu/drm/i915/i915_ums.c +24 -0
index ed39d60..83928fe 100644
@@ -254,6 +254,22 @@ void i915_save_modeset_reg(struct drm_device *dev)
 	else
 		dev_priv->regfile.saveADPA = I915_READ(ADPA);
 
+	/* Display Port state */
+	if (SUPPORTS_INTEGRATED_DP(dev)) {
+		dev_priv->regfile.saveDP_B = I915_READ(DP_B);
+		dev_priv->regfile.saveDP_C = I915_READ(DP_C);
+		dev_priv->regfile.saveDP_D = I915_READ(DP_D);
+		dev_priv->regfile.savePIPEA_GMCH_DATA_M = I915_READ(_PIPEA_GMCH_DATA_M);
+		dev_priv->regfile.savePIPEB_GMCH_DATA_M = I915_READ(_PIPEB_GMCH_DATA_M);
+		dev_priv->regfile.savePIPEA_GMCH_DATA_N = I915_READ(_PIPEA_GMCH_DATA_N);
+		dev_priv->regfile.savePIPEB_GMCH_DATA_N = I915_READ(_PIPEB_GMCH_DATA_N);
+		dev_priv->regfile.savePIPEA_DP_LINK_M = I915_READ(_PIPEA_DP_LINK_M);
+		dev_priv->regfile.savePIPEB_DP_LINK_M = I915_READ(_PIPEB_DP_LINK_M);
+		dev_priv->regfile.savePIPEA_DP_LINK_N = I915_READ(_PIPEA_DP_LINK_N);
+		dev_priv->regfile.savePIPEB_DP_LINK_N = I915_READ(_PIPEB_DP_LINK_N);
+	}
+	/* FIXME: regfile.save TV & SDVO state */
+
 	return;
 }
 
@@ -475,5 +491,13 @@ void i915_restore_modeset_reg(struct drm_device *dev)
 	else
 		I915_WRITE(ADPA, dev_priv->regfile.saveADPA);
 
+	/* Display Port state */
+	if (SUPPORTS_INTEGRATED_DP(dev)) {
+		I915_WRITE(DP_B, dev_priv->regfile.saveDP_B);
+		I915_WRITE(DP_C, dev_priv->regfile.saveDP_C);
+		I915_WRITE(DP_D, dev_priv->regfile.saveDP_D);
+	}
+	/* FIXME: restore TV & SDVO state */
+
 	return;
 }
Signature · 1 line
1.7.11.7