Skip to contentSkip to conversation

drm/i915: 830M regression fixes

PATCH New [email protected] 1 participant 3 messages Jan 7, 2014

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

cover drm/i915: 830M regression fixes

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

Looks like I managed to break 830M in a few different ways recently. But I recently found one for myself so hopefully that'll not happen again.

I have a few other things lined up for 830M, but these are the quick fixes that should get us back to the state we had before.

Ville Syrjälä (2):
drm/i915: Don't grab crtc mutexes in intel_modeset_gem_init() drm/i915: Don't swap planes on 830M

 drivers/gpu/drm/i915/i915_irq.c      | 4 ++--
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 2 files changed, 5 insertions(+), 5 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/2 drm/i915: Don't grab crtc mutexes in intel_modeset_gem_init()

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

When the pipe A force quirk is applied the code will attempt to grab a crtc mutex during intel_modeset_setup_hw_state(). If we're already holding all crtc mutexes this will obviously deadlock every time.

So instead of using drm_modeset_lock_all() just grab the mode_config.mutex. This is enough to avoid the unlocked mutex warnings from certain lower level functions.

The regression was introduced in:

commit 027476642811f8559cbe00ef6cc54db230e48a20
Author: Ville Syrjälä <[email protected]>
Date: Mon Dec 2 11:08:06 2013 +0200

drm/i915: Take modeset locks around intel_modeset_setup_hw_state()

---
 drivers/gpu/drm/i915/intel_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -2
index 4d1357a..303b3b3 100644
@@ -11260,10 +11260,10 @@ void intel_modeset_gem_init(struct drm_device *dev)
 
 	intel_setup_overlay(dev);
 
-	drm_modeset_lock_all(dev);
+	mutex_lock(&dev->mode_config.mutex);
 	drm_mode_config_reset(dev);
 	intel_modeset_setup_hw_state(dev, false);
-	drm_modeset_unlock_all(dev);
+	mutex_unlock(&dev->mode_config.mutex);
 }
 
 void intel_modeset_cleanup(struct drm_device *dev)
Signature · 6 lines
1.8.3.2

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

PATCH 2/2 drm/i915: Don't swap planes on 830M

In reply to [email protected]

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

Looks like 830M doesn't quite like it when you try to move a plane from one pipe to another. It seems that the plane's old pipe has to be active even if the plane is already disabled, otherwise the relevant register just won't accept new values.

The following commit:

commit 1f1c2e2468f937cefd6bcb645c959c7b5d9821df
Author: Ville Syrjälä <[email protected]>
Date: Thu Nov 28 17:30:01 2013 +0200

drm/i915: Swap primary planes on gen2 for FBC

caused a regression on 830M. It will attempt to swap the planes when the driver is loaded, but at that time only pipe A might be active, so plane A gets disabled, but plane B won't get enabled since pipe B is not active when we try to move the plane over to pipe A.

There's no reason to swap planes on 830M since it doesn't support FBC. Change the logic a bit to limit the plane swapping to platforms which actually support FBC. This should avoid getting a black screen on 830M.

---
 drivers/gpu/drm/i915/i915_irq.c      | 4 ++--
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +2 -2
index 1d44c79..158cb30 100644
@@ -3220,7 +3220,7 @@ static irqreturn_t i8xx_irq_handler(int irq, void *arg)
 
 		for_each_pipe(pipe) {
 			int plane = pipe;
-			if (IS_MOBILE(dev))
+			if (I915_HAS_FBC(dev))
 				plane = !plane;
 
 			if (pipe_stats[pipe] & PIPE_VBLANK_INTERRUPT_STATUS &&
@@ -3421,7 +3421,7 @@ static irqreturn_t i915_irq_handler(int irq, void *arg)
 
 		for_each_pipe(pipe) {
 			int plane = pipe;
-			if (IS_MOBILE(dev))
+			if (I915_HAS_FBC(dev))
 				plane = !plane;
 
 			if (pipe_stats[pipe] & PIPE_VBLANK_INTERRUPT_STATUS &&
drivers/gpu/drm/i915/intel_display.c +1 -1
index 303b3b3..d3d33e9 100644
@@ -10160,7 +10160,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
 	 */
 	intel_crtc->pipe = pipe;
 	intel_crtc->plane = pipe;
-	if (IS_MOBILE(dev) && INTEL_INFO(dev)->gen < 4) {
+	if (I915_HAS_FBC(dev) && INTEL_INFO(dev)->gen < 4) {
 		DRM_DEBUG_KMS("swapping pipes & planes for FBC\n");
 		intel_crtc->plane = !pipe;
 	}
Signature · 6 lines
1.8.3.2

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