--- /dev/null
+From 927a2f119e8235238a2fc64871051b16c9bdae75 Mon Sep 17 00:00:00 2001
+From: Sean Paul <seanpaul@chromium.org>
+Date: Fri, 23 Mar 2012 08:52:58 -0400
+Subject: drm/i915: Add lock on drm_helper_resume_force_mode
+
+From: Sean Paul <seanpaul@chromium.org>
+
+commit 927a2f119e8235238a2fc64871051b16c9bdae75 upstream.
+
+i915_drm_thaw was not locking the mode_config lock when calling
+drm_helper_resume_force_mode. When there were multiple wake sources,
+this caused FDI training failure on SNB which in turn corrupted the
+display.
+
+Signed-off-by: Sean Paul <seanpaul@chromium.org>
+Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_drv.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/gpu/drm/i915/i915_drv.c
++++ b/drivers/gpu/drm/i915/i915_drv.c
+@@ -442,7 +442,9 @@ static int i915_drm_thaw(struct drm_devi
+ drm_irq_install(dev);
+
+ /* Resume the modeset for every activated CRTC */
++ mutex_lock(&dev->mode_config.mutex);
+ drm_helper_resume_force_mode(dev);
++ mutex_unlock(&dev->mode_config.mutex);
+
+ if (IS_IRONLAKE_M(dev))
+ ironlake_enable_rc6(dev);
--- /dev/null
+From 97effadb65ed08809e1720c8d3ee80b73a93665c Mon Sep 17 00:00:00 2001
+From: Anisse Astier <anisse@astier.eu>
+Date: Wed, 7 Mar 2012 18:36:35 +0100
+Subject: drm/i915: no-lvds quirk on MSI DC500
+
+From: Anisse Astier <anisse@astier.eu>
+
+commit 97effadb65ed08809e1720c8d3ee80b73a93665c upstream.
+
+This hardware doesn't have an LVDS, it's a desktop box. Fix incorrect
+LVDS detection.
+
+Signed-off-by: Anisse Astier <anisse@astier.eu>
+Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/gpu/drm/i915/intel_lvds.c
++++ b/drivers/gpu/drm/i915/intel_lvds.c
+@@ -743,6 +743,14 @@ static const struct dmi_system_id intel_
+ DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"),
+ },
+ },
++ {
++ .callback = intel_no_lvds_dmi_callback,
++ .ident = "MSI Wind Box DC500",
++ .matches = {
++ DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
++ DMI_MATCH(DMI_BOARD_NAME, "MS-7469"),
++ },
++ },
+
+ { } /* terminating entry */
+ };
--- /dev/null
+From 25e341cfc33d94435472983825163e97fe370a6c Mon Sep 17 00:00:00 2001
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+Date: Sat, 24 Mar 2012 23:51:30 +0100
+Subject: drm/i915: quirk away broken OpRegion VBT
+
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+
+commit 25e341cfc33d94435472983825163e97fe370a6c upstream.
+
+Somehow the BIOS manages to screw things up when copying the VBT
+around, because the one we scrap from the VBIOS rom actually works.
+
+Tested-by: Markus Heinz <markus.heinz@uni-dortmund.de>
+Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=28812
+Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/intel_bios.c | 23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/i915/intel_bios.c
++++ b/drivers/gpu/drm/i915/intel_bios.c
+@@ -24,6 +24,7 @@
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
++#include <linux/dmi.h>
+ #include <drm/drm_dp_helper.h>
+ #include "drmP.h"
+ #include "drm.h"
+@@ -592,6 +593,26 @@ init_vbt_defaults(struct drm_i915_privat
+ dev_priv->edp.bpp = 18;
+ }
+
++static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
++{
++ DRM_DEBUG_KMS("Falling back to manually reading VBT from "
++ "VBIOS ROM for %s\n",
++ id->ident);
++ return 1;
++}
++
++static const struct dmi_system_id intel_no_opregion_vbt[] = {
++ {
++ .callback = intel_no_opregion_vbt_callback,
++ .ident = "ThinkCentre A57",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "97027RG"),
++ },
++ },
++ { }
++};
++
+ /**
+ * intel_parse_bios - find VBT and initialize settings from the BIOS
+ * @dev: DRM device
+@@ -612,7 +633,7 @@ intel_parse_bios(struct drm_device *dev)
+ init_vbt_defaults(dev_priv);
+
+ /* XXX Should this validation be moved to intel_opregion.c? */
+- if (dev_priv->opregion.vbt) {
++ if (!dmi_check_system(intel_no_opregion_vbt) && dev_priv->opregion.vbt) {
+ struct vbt_header *vbt = dev_priv->opregion.vbt;
+ if (memcmp(vbt->signature, "$VBT", 4) == 0) {
+ DRM_DEBUG_DRIVER("Using VBT from OpRegion: %20s\n",
--- /dev/null
+From f47166d2b0001fcb752b40c5a2d4db986dfbea68 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu, 22 Mar 2012 15:00:50 +0000
+Subject: drm/i915: Sanitize BIOS debugging bits from PIPECONF
+
+From: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit f47166d2b0001fcb752b40c5a2d4db986dfbea68 upstream.
+
+Quoting the BSpec from time immemorial:
+
+ PIPEACONF, bits 28:27: Frame Start Delay (Debug)
+
+ Used to delay the frame start signal that is sent to the display planes.
+ Care must be taken to insure that there are enough lines during VBLANK
+ to support this setting.
+
+An instance of the BIOS leaving these bits set was found in the wild,
+where it caused our modesetting to go all squiffy and skewiff.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47271
+Reported-and-tested-by: Eva Wang <evawang@linpus.com>
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43012
+Reported-and-tested-by: Carl Richell <carl@system76.com>
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_reg.h | 1 +
+ drivers/gpu/drm/i915/intel_display.c | 6 ++++++
+ 2 files changed, 7 insertions(+)
+
+--- a/drivers/gpu/drm/i915/i915_reg.h
++++ b/drivers/gpu/drm/i915/i915_reg.h
+@@ -2274,6 +2274,7 @@
+ #define PIPECONF_DISABLE 0
+ #define PIPECONF_DOUBLE_WIDE (1<<30)
+ #define I965_PIPECONF_ACTIVE (1<<30)
++#define PIPECONF_FRAME_START_DELAY_MASK (3<<27)
+ #define PIPECONF_SINGLE_WIDE 0
+ #define PIPECONF_PIPE_UNLOCKED 0
+ #define PIPECONF_PIPE_LOCKED (1<<25)
+--- a/drivers/gpu/drm/i915/intel_display.c
++++ b/drivers/gpu/drm/i915/intel_display.c
+@@ -6580,6 +6580,12 @@ static void intel_sanitize_modesetting(s
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ u32 reg, val;
+
++ /* Clear any frame start delays used for debugging left by the BIOS */
++ for_each_pipe(pipe) {
++ reg = PIPECONF(pipe);
++ I915_WRITE(reg, I915_READ(reg) & ~PIPECONF_FRAME_START_DELAY_MASK);
++ }
++
+ if (HAS_PCH_SPLIT(dev))
+ return;
+
modpost-fix-all_init_data_sections.patch
genirq-adjust-irq-thread-affinity-on-irq_set_mask_ok_nocopy-return-value.patch
tracing-fix-ftrace-stack-trace-entries.patch
-tracing-fix-ent_size-in-trace-output.patch
m68k-mac-add-missing-platform-check-before-registering-platform-devices.patch
mac80211-fix-possible-tid_rx-reorder_timer-use-after-free.patch
drm-validate-requested-virtual-size-against-allocated-fb-size.patch
drm-radeon-kms-fix-fans-after-resume.patch
+drm-i915-no-lvds-quirk-on-msi-dc500.patch
+drm-i915-sanitize-bios-debugging-bits-from-pipeconf.patch
+drm-i915-add-lock-on-drm_helper_resume_force_mode.patch
+drm-i915-quirk-away-broken-opregion-vbt.patch
+++ /dev/null
-From 12b5da349a8b94c9dbc3430a6bc42eabd9eaf50b Mon Sep 17 00:00:00 2001
-From: Steven Rostedt <srostedt@redhat.com>
-Date: Tue, 27 Mar 2012 10:43:28 -0400
-Subject: tracing: Fix ent_size in trace output
-
-From: Steven Rostedt <srostedt@redhat.com>
-
-commit 12b5da349a8b94c9dbc3430a6bc42eabd9eaf50b upstream.
-
-When reading the trace file, the records of each of the per_cpu buffers
-are examined to find the next event to print out. At the point of looking
-at the event, the size of the event is recorded. But if the first event is
-chosen, the other events in the other CPU buffers will reset the event size
-that is stored in the iterator descriptor, causing the event size passed to
-the output functions to be incorrect.
-
-In most cases this is not a problem, but for the case of stack traces, it
-is. With the change to the stack tracing to record a dynamic number of
-back traces, the output depends on the size of the entry instead of the
-fixed 8 back traces. When the entry size is not correct, the back traces
-would not be fully printed.
-
-Note, reading from the per-cpu trace files were not affected.
-
-Reported-by: Thomas Gleixner <tglx@linutronix.de>
-Tested-by: Thomas Gleixner <tglx@linutronix.de>
-Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- kernel/trace/trace.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/kernel/trace/trace.c
-+++ b/kernel/trace/trace.c
-@@ -1549,6 +1549,7 @@ __find_next_entry(struct trace_iterator
- int cpu_file = iter->cpu_file;
- u64 next_ts = 0, ts;
- int next_cpu = -1;
-+ int next_size = 0;
- int cpu;
-
- /*
-@@ -1580,9 +1581,12 @@ __find_next_entry(struct trace_iterator
- next_cpu = cpu;
- next_ts = ts;
- next_lost = lost_events;
-+ next_size = iter->ent_size;
- }
- }
-
-+ iter->ent_size = next_size;
-+
- if (ent_cpu)
- *ent_cpu = next_cpu;
-