--- /dev/null
+From 7810cc1e7721220f1ed2a23ca95113d6434f6dcd Mon Sep 17 00:00:00 2001
+From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
+Date: Fri, 25 Jan 2013 16:54:20 +0200
+Subject: digsig: Fix memory leakage in digsig_verify_rsa()
+
+From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
+
+commit 7810cc1e7721220f1ed2a23ca95113d6434f6dcd upstream.
+
+digsig_verify_rsa() does not free kmalloc'ed buffer returned by
+mpi_get_buffer().
+
+Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
+Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
+Signed-off-by: James Morris <james.l.morris@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/digsig.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/lib/digsig.c
++++ b/lib/digsig.c
+@@ -162,6 +162,8 @@ static int digsig_verify_rsa(struct key
+ memset(out1, 0, head);
+ memcpy(out1 + head, p, l);
+
++ kfree(p);
++
+ err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len);
+ if (err)
+ goto err;
--- /dev/null
+From 9200ee4941a6e5d1ec5df88982243686882dff3f Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Tue, 29 Jan 2013 16:36:47 -0500
+Subject: drm/radeon: add quirk for RV100 board
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit 9200ee4941a6e5d1ec5df88982243686882dff3f upstream.
+
+vbios says external TMDS while the board is actually
+internal TMDS.
+
+fixes:
+https://bugs.freedesktop.org/show_bug.cgi?id=60037
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/radeon_combios.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/gpu/drm/radeon/radeon_combios.c
++++ b/drivers/gpu/drm/radeon/radeon_combios.c
+@@ -2338,6 +2338,14 @@ bool radeon_get_legacy_connector_info_fr
+ 1),
+ ATOM_DEVICE_CRT1_SUPPORT);
+ }
++ /* RV100 board with external TDMS bit mis-set.
++ * Actually uses internal TMDS, clear the bit.
++ */
++ if (dev->pdev->device == 0x5159 &&
++ dev->pdev->subsystem_vendor == 0x1014 &&
++ dev->pdev->subsystem_device == 0x029A) {
++ tmp &= ~(1 << 4);
++ }
+ if ((tmp >> 4) & 0x1) {
+ devices |= ATOM_DEVICE_DFP2_SUPPORT;
+ radeon_add_legacy_encoder(dev,
--- /dev/null
+From 674a16f2b4724880d07389abbb95abf320b924aa Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Sun, 27 Jan 2013 21:57:51 -0500
+Subject: drm/radeon: add WAIT_UNTIL to the non-VM safe regs list for cayman/TN
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit 674a16f2b4724880d07389abbb95abf320b924aa upstream.
+
+Newer versions of mesa emit this.
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/reg_srcs/cayman | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/gpu/drm/radeon/reg_srcs/cayman
++++ b/drivers/gpu/drm/radeon/reg_srcs/cayman
+@@ -1,5 +1,6 @@
+ cayman 0x9400
+ 0x0000802C GRBM_GFX_INDEX
++0x00008040 WAIT_UNTIL
+ 0x000084FC CP_STRMOUT_CNTL
+ 0x000085F0 CP_COHER_CNTL
+ 0x000085F4 CP_COHER_SIZE
--- /dev/null
+From f2d68cf4daa4de97d400d94836b907e35228e54f Mon Sep 17 00:00:00 2001
+From: liu chuansheng <chuansheng.liu@intel.com>
+Date: Thu, 31 Jan 2013 22:13:00 +0800
+Subject: drm/radeon: Calling object_unrefer() when creating fb failure
+
+From: liu chuansheng <chuansheng.liu@intel.com>
+
+commit f2d68cf4daa4de97d400d94836b907e35228e54f upstream.
+
+When kzalloc() failed in radeon_user_framebuffer_create(), need to
+call object_unreference() to match the object_reference().
+
+Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
+Signed-off-by: xueminsu <xuemin.su@intel.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/radeon_display.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_display.c
++++ b/drivers/gpu/drm/radeon/radeon_display.c
+@@ -1129,8 +1129,10 @@ radeon_user_framebuffer_create(struct dr
+ }
+
+ radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL);
+- if (radeon_fb == NULL)
++ if (radeon_fb == NULL) {
++ drm_gem_object_unreference_unlocked(obj);
+ return ERR_PTR(-ENOMEM);
++ }
+
+ ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj);
+ if (ret) {
--- /dev/null
+From ed39fadd6df01095378e499fac3674883f16b853 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Thu, 31 Jan 2013 09:00:52 -0500
+Subject: drm/radeon/evergreen+: wait for the MC to settle after MC blackout
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit ed39fadd6df01095378e499fac3674883f16b853 upstream.
+
+Some chips seem to need a little delay after blacking out
+the MC before the requests actually stop.
+
+May fix:
+https://bugs.freedesktop.org/show_bug.cgi?id=56139
+https://bugs.freedesktop.org/show_bug.cgi?id=57567
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/evergreen.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/gpu/drm/radeon/evergreen.c
++++ b/drivers/gpu/drm/radeon/evergreen.c
+@@ -1179,6 +1179,8 @@ void evergreen_mc_stop(struct radeon_dev
+ blackout &= ~BLACKOUT_MODE_MASK;
+ WREG32(MC_SHARED_BLACKOUT_CNTL, blackout | 1);
+ }
++ /* wait for the MC to settle */
++ udelay(100);
+ }
+
+ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save)
--- /dev/null
+From bb588820ef421c6098dca1fec29c3b347f1c8c19 Mon Sep 17 00:00:00 2001
+From: Christopher Staite <chris@yourdreamnet.co.uk>
+Date: Sat, 26 Jan 2013 11:10:58 -0500
+Subject: drm/radeon: fix MC blackout on evergreen+
+
+From: Christopher Staite <chris@yourdreamnet.co.uk>
+
+commit bb588820ef421c6098dca1fec29c3b347f1c8c19 upstream.
+
+Force the crtc mem requests on/off immediately rather
+than waiting for the double buffered updates to kick in.
+Seems we miss the update in certain conditions. Also
+handle the DCE6 case.
+
+Signed-off-by: Christopher Staite <chris@yourdreamnet.co.uk>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/evergreen.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/gpu/drm/radeon/evergreen.c
++++ b/drivers/gpu/drm/radeon/evergreen.c
+@@ -1147,14 +1147,18 @@ void evergreen_mc_stop(struct radeon_dev
+ if (!(tmp & EVERGREEN_CRTC_BLANK_DATA_EN)) {
+ radeon_wait_for_vblank(rdev, i);
+ tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
++ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
+ WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
++ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
+ }
+ } else {
+ tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
+ if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) {
+ radeon_wait_for_vblank(rdev, i);
+ tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
++ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
+ WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
++ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
+ }
+ }
+ /* wait for the next frame */
+@@ -1214,11 +1218,15 @@ void evergreen_mc_resume(struct radeon_d
+ if (ASIC_IS_DCE6(rdev)) {
+ tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]);
+ tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
++ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
+ WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
++ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
+ } else {
+ tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
+ tmp &= ~EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
++ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
+ WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
++ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
+ }
+ /* wait for the next frame */
+ frame_count = radeon_get_vblank_counter(rdev, i);
--- /dev/null
+From fd5d93a0015ce1a7db881382022b2fcdfdc61760 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Wed, 30 Jan 2013 14:24:09 -0500
+Subject: drm/radeon: prevent crash in the ring space allocation
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit fd5d93a0015ce1a7db881382022b2fcdfdc61760 upstream.
+
+If the requested number of DWs on the ring is larger than
+the size of the ring itself, return an error.
+
+In testing with large VM updates, we've seen crashes when we
+try and allocate more space on the ring than the total size
+of the ring without checking.
+
+This prevents the crash but for large VM updates or bo moves
+of very large buffers, we will need to break the transaction
+down into multiple batches. I have patches to use IBs for
+the next kernel.
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/radeon_ring.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/gpu/drm/radeon/radeon_ring.c
++++ b/drivers/gpu/drm/radeon/radeon_ring.c
+@@ -311,6 +311,9 @@ int radeon_ring_alloc(struct radeon_devi
+ {
+ int r;
+
++ /* make sure we aren't trying to allocate more space than there is on the ring */
++ if (ndw > (ring->ring_size / 4))
++ return -ENOMEM;
+ /* Align requested size with padding so unlock_commit can
+ * pad safely */
+ ndw = (ndw + ring->align_mask) & ~ring->align_mask;
--- /dev/null
+digsig-fix-memory-leakage-in-digsig_verify_rsa.patch
+drm-radeon-evergreen-wait-for-the-mc-to-settle-after-mc-blackout.patch
+drm-radeon-add-wait_until-to-the-non-vm-safe-regs-list-for-cayman-tn.patch
+drm-radeon-add-quirk-for-rv100-board.patch
+drm-radeon-fix-mc-blackout-on-evergreen.patch
+drm-radeon-prevent-crash-in-the-ring-space-allocation.patch
+drm-radeon-calling-object_unrefer-when-creating-fb-failure.patch