Skip to contentSkip to conversation

drm/i915: A few small fixes for older platforms

PATCH In review [email protected] 3 participants 6 messages Jan 10, 2014

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

cover drm/i915: A few small fixes for older platforms

From: Ville Syrjälä <[email protected]>

I spotted a few small issues while reading the code w/ older platforms in mind. The panel fitter/LVDS port patches probably have no real impact since it looks like those non-existing registers always return 0. But might as well avoid reading them.

The 915GM SR fix is untested as I have no such hardware, but if the docs are correct it should affect something.

Ville Syrjälä (3):
drm/i915: No panel fitter on 830M or non-mobile gen2/3 platforms drm/i915: 830M doesn't have an LVDS port
drm/i915: Fix 915GM self-refresh enable/disable

 drivers/gpu/drm/i915/intel_display.c | 5 ++++-
 drivers/gpu/drm/i915/intel_overlay.c | 2 +-
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/3 drm/i915: No panel fitter on 830M or non-mobile gen2/3 platforms

From: Ville Syrjälä <[email protected]>

PFIT_CONTROL doesn't exist on 830M, so avoid reading it in i9xx_get_pfit_config().

Also assume that only mobile gen2/3 chipsets have a panel fitter. This matches the documentation, but I didn't have real hardware to verify.

Gen4 docmentation is a bit inconsistent, but experimenetation on my LPT machine suggests that the panel fitter is available on non-mobile gen4 platforms. At least on this machine panel fitter appears works just fine even on VGA output.

---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 drivers/gpu/drm/i915/intel_overlay.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +3 -0
index a51e105..9f8c5b5 100644
@@ -5428,6 +5428,9 @@ static void i9xx_get_pfit_config(struct intel_crtc *crtc,
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	uint32_t tmp;
 
+	if (INTEL_INFO(dev)->gen <= 3 && (IS_I830(dev) || !IS_MOBILE(dev)))
+		return;
+
 	tmp = I915_READ(PFIT_CONTROL);
 	if (!(tmp & PFIT_ENABLE))
 		return;
drivers/gpu/drm/i915/intel_overlay.c +1 -1
index a1397b1..424f094 100644
@@ -1005,7 +1005,7 @@ static int intel_panel_fitter_pipe(struct drm_device *dev)
 	u32  pfit_control;
 
 	/* i830 doesn't have a panel fitter */
-	if (IS_I830(dev))
+	if (INTEL_INFO(dev)->gen <= 3 && (IS_I830(dev) || !IS_MOBILE(dev)))
 		return -1;
 
 	pfit_control = I915_READ(PFIT_CONTROL);
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Re: [PATCH 1/3] drm/i915: No panel fitter on 830M or non-mobile gen2/3 platforms

Quoted 38 lines · On Fri, Jan 10, 2014 at 02:06:45PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

PFIT_CONTROL doesn't exist on 830M, so avoid reading it in i9xx_get_pfit_config().

Also assume that only mobile gen2/3 chipsets have a panel fitter. This matches the documentation, but I didn't have real hardware to verify.

Gen4 docmentation is a bit inconsistent, but experimenetation on my LPT machine suggests that the panel fitter is available on non-mobile gen4 platforms. At least on this machine panel fitter appears works just fine even on VGA output.

---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 drivers/gpu/drm/i915/intel_overlay.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +3 -0
index a51e105..9f8c5b5 100644
@@ -5428,6 +5428,9 @@ static void i9xx_get_pfit_config(struct intel_crtc *crtc,
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	uint32_t tmp;
 
+	if (INTEL_INFO(dev)->gen <= 3 && (IS_I830(dev) || !IS_MOBILE(dev)))
+		return;
+
 	tmp = I915_READ(PFIT_CONTROL);
 	if (!(tmp & PFIT_ENABLE))
 		return;
drivers/gpu/drm/i915/intel_overlay.c +0 -0
index a1397b1..424f094 100644

drivers/gpu/drm/i915/intel_overlay.c static int intel_panel_fitter_pipe(struct drm_device *dev) · line 1008

Quoted 5 lines
drivers/gpu/drm/i915/intel_overlay.c +1 -1
@@ -1005,7 +1005,7 @@ static int intel_panel_fitter_pipe(struct drm_device *dev)
 	u32  pfit_control;
 
 	/* i830 doesn't have a panel fitter */
-	if (IS_I830(dev))
+	if (INTEL_INFO(dev)->gen <= 3 && (IS_I830(dev) || !IS_MOBILE(dev)))

Hm, we could switch that code to the pipe config. Like we've already done for the double-wide stuff. Like we've done for the double-wide checks already ...
-Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_overlay.c +0 -0
 		return -1;
 
 	pfit_control = I915_READ(PFIT_CONTROL);
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw

PATCH 2/3 drm/i915: 830M doesn't have an LVDS port

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

There's no LVDS port on 830M so don't go reading the LVDS control register.

---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 9f8c5b5..e29d24f 100644
@@ -7963,7 +7963,7 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
 		else
 			i9xx_clock(refclk, &clock);
 	} else {
-		u32 lvds = I915_READ(LVDS);
+		u32 lvds = IS_I830(dev) ? 0 : I915_READ(LVDS);
 		bool is_lvds = (pipe == 1) && (lvds & LVDS_PORT_EN);
 
 		if (is_lvds) {
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH 3/3 drm/i915: Fix 915GM self-refresh enable/disable

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

INSTPM is a masked register so use the _MASKED_BIT_{ENABLE,DISABLE} macros when enabling/disabling self-refresh on 915GM.

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +2 -2
index 99d6550..c4e5e24 100644
@@ -1563,7 +1563,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
 	if (IS_I945G(dev) || IS_I945GM(dev))
 		I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN_MASK | 0);
 	else if (IS_I915GM(dev))
-		I915_WRITE(INSTPM, I915_READ(INSTPM) & ~INSTPM_SELF_EN);
+		I915_WRITE(INSTPM, _MASKED_BIT_DISABLE(INSTPM_SELF_EN));
 
 	/* Calc sr entries for one plane configs */
 	if (HAS_FW_BLC(dev) && enabled) {
@@ -1615,7 +1615,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
 				I915_WRITE(FW_BLC_SELF,
 					   FW_BLC_SELF_EN_MASK | FW_BLC_SELF_EN);
 			else if (IS_I915GM(dev))
-				I915_WRITE(INSTPM, I915_READ(INSTPM) | INSTPM_SELF_EN);
+				I915_WRITE(INSTPM, _MASKED_BIT_ENABLE(INSTPM_SELF_EN));
 			DRM_DEBUG_KMS("memory self refresh enabled\n");
 		} else
 			DRM_DEBUG_KMS("memory self refresh disabled\n");
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on the v1 series
#5 lore raw
In reply to [email protected]
Quoted 9 lines · On Fri, Jan 10, 2014 at 02:06:44PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

I spotted a few small issues while reading the code w/ older platforms in mind. The panel fitter/LVDS port patches probably have no real impact since it looks like those non-existing registers always return 0. But might as well avoid reading them.

The 915GM SR fix is untested as I have no such hardware, but if the docs are correct it should affect something.

They all look self-consistent.

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre