--- /dev/null
+From 097354eb14fa94d31a09c64d640643f58e4a5a9a Mon Sep 17 00:00:00 2001
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+Date: Sun, 27 Nov 2011 18:58:17 +0100
+Subject: drm/i915: check ACTHD of all rings
+
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+
+commit 097354eb14fa94d31a09c64d640643f58e4a5a9a upstream.
+
+Otherwise hangcheck spuriously fires when running blitter/bsd-only
+workloads.
+
+Contrary to a similar patch by Ben Widawsky this does not check
+INSTDONE of the other rings. Chris Wilson implied that in a failure to
+detect a hang, most likely because INSTDONE was fluctuating. Thus only
+check ACTHD, which as far as I know is rather reliable. Also, blitter
+and bsd rings can't launch complex tasks from a single instruction
+(like 3D_PRIM on the render with complex or even infinite shaders).
+
+This fixes spurious gpu hang detection when running
+tests/gem_hangcheck_forcewake on snb/ivb.
+
+Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+---
+ drivers/gpu/drm/i915/i915_drv.h | 2 ++
+ drivers/gpu/drm/i915/i915_irq.c | 13 ++++++++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/i915/i915_drv.h
++++ b/drivers/gpu/drm/i915/i915_drv.h
+@@ -325,6 +325,8 @@ typedef struct drm_i915_private {
+ struct timer_list hangcheck_timer;
+ int hangcheck_count;
+ uint32_t last_acthd;
++ uint32_t last_acthd_bsd;
++ uint32_t last_acthd_blt;
+ uint32_t last_instdone;
+ uint32_t last_instdone1;
+
+--- a/drivers/gpu/drm/i915/i915_irq.c
++++ b/drivers/gpu/drm/i915/i915_irq.c
+@@ -1665,7 +1665,7 @@ void i915_hangcheck_elapsed(unsigned lon
+ {
+ struct drm_device *dev = (struct drm_device *)data;
+ drm_i915_private_t *dev_priv = dev->dev_private;
+- uint32_t acthd, instdone, instdone1;
++ uint32_t acthd, instdone, instdone1, acthd_bsd, acthd_blt;
+ bool err = false;
+
+ /* If all work is done then ACTHD clearly hasn't advanced. */
+@@ -1679,16 +1679,21 @@ void i915_hangcheck_elapsed(unsigned lon
+ }
+
+ if (INTEL_INFO(dev)->gen < 4) {
+- acthd = I915_READ(ACTHD);
+ instdone = I915_READ(INSTDONE);
+ instdone1 = 0;
+ } else {
+- acthd = I915_READ(ACTHD_I965);
+ instdone = I915_READ(INSTDONE_I965);
+ instdone1 = I915_READ(INSTDONE1);
+ }
++ acthd = intel_ring_get_active_head(&dev_priv->ring[RCS]);
++ acthd_bsd = HAS_BSD(dev) ?
++ intel_ring_get_active_head(&dev_priv->ring[VCS]) : 0;
++ acthd_blt = HAS_BLT(dev) ?
++ intel_ring_get_active_head(&dev_priv->ring[BCS]) : 0;
+
+ if (dev_priv->last_acthd == acthd &&
++ dev_priv->last_acthd_bsd == acthd_bsd &&
++ dev_priv->last_acthd_blt == acthd_blt &&
+ dev_priv->last_instdone == instdone &&
+ dev_priv->last_instdone1 == instdone1) {
+ if (dev_priv->hangcheck_count++ > 1) {
+@@ -1720,6 +1725,8 @@ void i915_hangcheck_elapsed(unsigned lon
+ dev_priv->hangcheck_count = 0;
+
+ dev_priv->last_acthd = acthd;
++ dev_priv->last_acthd_bsd = acthd_bsd;
++ dev_priv->last_acthd_blt = acthd_blt;
+ dev_priv->last_instdone = instdone;
+ dev_priv->last_instdone1 = instdone1;
+ }
--- /dev/null
+From 832afda6a7d7235ef0e09f4ec46736861540da6d Mon Sep 17 00:00:00 2001
+From: Wu Fengguang <fengguang.wu@intel.com>
+Date: Fri, 9 Dec 2011 20:42:21 +0800
+Subject: drm/i915: DisplayPort hot remove notification to audio driver
+
+From: Wu Fengguang <fengguang.wu@intel.com>
+
+commit 832afda6a7d7235ef0e09f4ec46736861540da6d upstream.
+
+On DP monitor hot remove, clear DP_AUDIO_OUTPUT_ENABLE accordingly,
+so that the audio driver will receive hot plug events and take action
+to refresh its device state and ELD contents.
+
+Note that the DP_AUDIO_OUTPUT_ENABLE bit may be enabled or disabled
+only when the link training is complete and set to "Normal".
+
+Tested OK for both hot plug/remove and DPMS on/off.
+
+Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/intel_dp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/gpu/drm/i915/intel_dp.c
++++ b/drivers/gpu/drm/i915/intel_dp.c
+@@ -1554,6 +1554,7 @@ intel_dp_link_down(struct intel_dp *inte
+ intel_wait_for_vblank(dev, to_intel_crtc(crtc)->pipe);
+ }
+
++ DP &= ~DP_AUDIO_OUTPUT_ENABLE;
+ I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN);
+ POSTING_READ(intel_dp->output_reg);
+ }
--- /dev/null
+From 23bd15ec662344dc10e9918fdd0dbc58bc71526d Mon Sep 17 00:00:00 2001
+From: Rodrigo Vivi <rodrigo.vivi@gmail.com>
+Date: Wed, 14 Dec 2011 21:10:06 -0200
+Subject: drm/i915: Fix TV Out refresh rate.
+
+From: Rodrigo Vivi <rodrigo.vivi@gmail.com>
+
+commit 23bd15ec662344dc10e9918fdd0dbc58bc71526d upstream.
+
+TV Out refresh rate was half of the specification for almost all modes.
+Due to this reason pixel clock was so low for some modes causing flickering screen.
+
+Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
+Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/intel_tv.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/drivers/gpu/drm/i915/intel_tv.c
++++ b/drivers/gpu/drm/i915/intel_tv.c
+@@ -417,7 +417,7 @@ static const struct tv_mode tv_modes[] =
+ {
+ .name = "NTSC-M",
+ .clock = 108000,
+- .refresh = 29970,
++ .refresh = 59940,
+ .oversample = TV_OVERSAMPLE_8X,
+ .component_only = 0,
+ /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */
+@@ -460,7 +460,7 @@ static const struct tv_mode tv_modes[] =
+ {
+ .name = "NTSC-443",
+ .clock = 108000,
+- .refresh = 29970,
++ .refresh = 59940,
+ .oversample = TV_OVERSAMPLE_8X,
+ .component_only = 0,
+ /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 4.43MHz */
+@@ -502,7 +502,7 @@ static const struct tv_mode tv_modes[] =
+ {
+ .name = "NTSC-J",
+ .clock = 108000,
+- .refresh = 29970,
++ .refresh = 59940,
+ .oversample = TV_OVERSAMPLE_8X,
+ .component_only = 0,
+
+@@ -545,7 +545,7 @@ static const struct tv_mode tv_modes[] =
+ {
+ .name = "PAL-M",
+ .clock = 108000,
+- .refresh = 29970,
++ .refresh = 59940,
+ .oversample = TV_OVERSAMPLE_8X,
+ .component_only = 0,
+
+@@ -589,7 +589,7 @@ static const struct tv_mode tv_modes[] =
+ /* 625 Lines, 50 Fields, 15.625KHz line, Sub-Carrier 4.434MHz */
+ .name = "PAL-N",
+ .clock = 108000,
+- .refresh = 25000,
++ .refresh = 50000,
+ .oversample = TV_OVERSAMPLE_8X,
+ .component_only = 0,
+
+@@ -634,7 +634,7 @@ static const struct tv_mode tv_modes[] =
+ /* 625 Lines, 50 Fields, 15.625KHz line, Sub-Carrier 4.434MHz */
+ .name = "PAL",
+ .clock = 108000,
+- .refresh = 25000,
++ .refresh = 50000,
+ .oversample = TV_OVERSAMPLE_8X,
+ .component_only = 0,
+
+@@ -821,7 +821,7 @@ static const struct tv_mode tv_modes[] =
+ {
+ .name = "1080i@50Hz",
+ .clock = 148800,
+- .refresh = 25000,
++ .refresh = 50000,
+ .oversample = TV_OVERSAMPLE_2X,
+ .component_only = 1,
+
+@@ -847,7 +847,7 @@ static const struct tv_mode tv_modes[] =
+ {
+ .name = "1080i@60Hz",
+ .clock = 148800,
+- .refresh = 30000,
++ .refresh = 60000,
+ .oversample = TV_OVERSAMPLE_2X,
+ .component_only = 1,
+
--- /dev/null
+From 07c1e8c1462fa7324de4c36ae9e55da2abd79cee Mon Sep 17 00:00:00 2001
+From: Eugeni Dodonov <eugeni.dodonov@intel.com>
+Date: Sat, 7 Jan 2012 23:40:35 -0200
+Subject: drm/i915: handle 3rd pipe
+
+From: Eugeni Dodonov <eugeni.dodonov@intel.com>
+
+commit 07c1e8c1462fa7324de4c36ae9e55da2abd79cee upstream.
+
+We don't need to check 3rd pipe specifically, as it shares PLL with some
+other one.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41977
+Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
+Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_suspend.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/gpu/drm/i915/i915_suspend.c
++++ b/drivers/gpu/drm/i915/i915_suspend.c
+@@ -34,6 +34,10 @@ static bool i915_pipe_enabled(struct drm
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ u32 dpll_reg;
+
++ /* On IVB, 3rd pipe shares PLL with another one */
++ if (pipe > 1)
++ return false;
++
+ if (HAS_PCH_SPLIT(dev))
+ dpll_reg = (pipe == PIPE_A) ? _PCH_DPLL_A : _PCH_DPLL_B;
+ else
asoc-ensure-we-generate-a-driver-name.patch
udf-mark-lvid-buffer-as-uptodate-before-marking-it-dirty.patch
drm-i915-hdmi-hot-remove-notification-to-audio-driver.patch
+drm-i915-displayport-hot-remove-notification-to-audio-driver.patch
+drm-i915-check-acthd-of-all-rings.patch
+drm-i915-fix-tv-out-refresh-rate.patch
+drm-i915-handle-3rd-pipe.patch