]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
i915: ensure that VGA plane is disabled
authorKrzysztof Mazur <krzysiek@podlesie.net>
Wed, 19 Dec 2012 10:03:41 +0000 (11:03 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 16 Jan 2013 01:13:11 +0000 (01:13 +0000)
commit 0fde901f1ddd2ce0e380a6444f1fb7ca555859e9 upstream.

Some broken systems (like HP nc6120) in some cases, usually after LID
close/open, enable VGA plane, making display unusable (black screen on LVDS,
some strange mode on VGA output). We used to disable VGA plane only once at
startup. Now we also check, if VGA plane is still disabled while changing
mode, and fix that if something changed it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57434
Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[bwh: Backported to 3.2: intel_modeset_setup_hw_state() does not
 exist, so call i915_redisable_vga() directly from intel_lid_notify()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_lvds.c

index 791df46d6cd810dd28fe9aae369240b20004cbf8..012a9d2326d97d48d10265d9dedbbe6c3f4eb866 100644 (file)
@@ -1305,6 +1305,7 @@ static inline void intel_unregister_dsm_handler(void) { return; }
 #endif /* CONFIG_ACPI */
 
 /* modesetting */
+extern void i915_redisable_vga(struct drm_device *dev);
 extern void intel_modeset_init(struct drm_device *dev);
 extern void intel_modeset_gem_init(struct drm_device *dev);
 extern void intel_modeset_cleanup(struct drm_device *dev);
index 54acad3f0f6ad305c4ee914b594cc7b76d898194..fa9639b26f62a2d23f47a82326b08b06a4fd789f 100644 (file)
@@ -8898,6 +8898,23 @@ static void i915_disable_vga(struct drm_device *dev)
        POSTING_READ(vga_reg);
 }
 
+void i915_redisable_vga(struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       u32 vga_reg;
+
+       if (HAS_PCH_SPLIT(dev))
+               vga_reg = CPU_VGACNTRL;
+       else
+               vga_reg = VGACNTRL;
+
+       if (I915_READ(vga_reg) != VGA_DISP_DISABLE) {
+               DRM_DEBUG_KMS("Something enabled VGA plane, disabling it\n");
+               I915_WRITE(vga_reg, VGA_DISP_DISABLE);
+               POSTING_READ(vga_reg);
+       }
+}
+
 void intel_modeset_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
index cf5ea3de88cf2ba8476b2caa1bea38d1d65a78e3..c6d09663602bf597181eb02d46e55432a9b79447 100644 (file)
@@ -535,6 +535,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
 
        mutex_lock(&dev->mode_config.mutex);
        drm_helper_resume_force_mode(dev);
+       i915_redisable_vga(dev);
        mutex_unlock(&dev->mode_config.mutex);
 
        return NOTIFY_OK;