From 520ad335c959b0321d3aa65de4c02a40804087b4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 11 Aug 2013 22:30:25 -0700 Subject: [PATCH] 3.10-stable patches added patches: drm-ast-invalidate-page-tables-when-pinning-a-bo.patch drm-cirrus-invalidate-page-tables-when-pinning-a-bo.patch drm-don-t-pass-negative-delta-to-ktime_sub_ns.patch drm-mgag200-invalidate-page-tables-when-pinning-a-bo.patch drm-radeon-select-audio-dto-based-on-encoder-id-for-dce3.patch drm-radeon-stop-sending-invalid-uvd-destroy-msg.patch --- ...lidate-page-tables-when-pinning-a-bo.patch | 28 ++++++++++++ ...lidate-page-tables-when-pinning-a-bo.patch | 35 +++++++++++++++ ...-pass-negative-delta-to-ktime_sub_ns.patch | 43 ++++++++++++++++++ ...lidate-page-tables-when-pinning-a-bo.patch | 36 +++++++++++++++ ...dio-dto-based-on-encoder-id-for-dce3.patch | 45 +++++++++++++++++++ ...stop-sending-invalid-uvd-destroy-msg.patch | 32 +++++++++++++ queue-3.10/series | 6 +++ 7 files changed, 225 insertions(+) create mode 100644 queue-3.10/drm-ast-invalidate-page-tables-when-pinning-a-bo.patch create mode 100644 queue-3.10/drm-cirrus-invalidate-page-tables-when-pinning-a-bo.patch create mode 100644 queue-3.10/drm-don-t-pass-negative-delta-to-ktime_sub_ns.patch create mode 100644 queue-3.10/drm-mgag200-invalidate-page-tables-when-pinning-a-bo.patch create mode 100644 queue-3.10/drm-radeon-select-audio-dto-based-on-encoder-id-for-dce3.patch create mode 100644 queue-3.10/drm-radeon-stop-sending-invalid-uvd-destroy-msg.patch diff --git a/queue-3.10/drm-ast-invalidate-page-tables-when-pinning-a-bo.patch b/queue-3.10/drm-ast-invalidate-page-tables-when-pinning-a-bo.patch new file mode 100644 index 00000000000..689f7b589da --- /dev/null +++ b/queue-3.10/drm-ast-invalidate-page-tables-when-pinning-a-bo.patch @@ -0,0 +1,28 @@ +From 3ac65259328324de323dc006b52ff7c1a5b18d19 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Wed, 7 Aug 2013 10:01:56 +1000 +Subject: drm/ast: invalidate page tables when pinning a BO + +From: Dave Airlie + +commit 3ac65259328324de323dc006b52ff7c1a5b18d19 upstream. + +same fix as cirrus and mgag200. + +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/ast/ast_ttm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/ast/ast_ttm.c ++++ b/drivers/gpu/drm/ast/ast_ttm.c +@@ -348,6 +348,7 @@ int ast_bo_create(struct drm_device *dev + + astbo->gem.driver_private = NULL; + astbo->bo.bdev = &ast->ttm.bdev; ++ astbo->bo.bdev->dev_mapping = dev->dev_mapping; + + ast_ttm_placement(astbo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM); + diff --git a/queue-3.10/drm-cirrus-invalidate-page-tables-when-pinning-a-bo.patch b/queue-3.10/drm-cirrus-invalidate-page-tables-when-pinning-a-bo.patch new file mode 100644 index 00000000000..6e81cbe54a3 --- /dev/null +++ b/queue-3.10/drm-cirrus-invalidate-page-tables-when-pinning-a-bo.patch @@ -0,0 +1,35 @@ +From 109a51598869a39fdcec2d49672a9a39b6d89481 Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Tue, 6 Aug 2013 15:26:50 +0200 +Subject: drm/cirrus: Invalidate page tables when pinning a BO + +From: Michal Srb + +commit 109a51598869a39fdcec2d49672a9a39b6d89481 upstream. + +This is a cirrus version of Egbert Eich's patch for mgag200. + +Without bo.bdev->dev_mapping set, the ttm_bo_unmap_virtual_locked +called from ttm_bo_handle_move_mem returns with no effect. If any +application accessed the memory before it was moved, it will +access wrong memory next time. This causes crashes when changing +resolution down. + +Signed-off-by: Michal Srb +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/cirrus/cirrus_ttm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/cirrus/cirrus_ttm.c ++++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c +@@ -353,6 +353,7 @@ int cirrus_bo_create(struct drm_device * + + cirrusbo->gem.driver_private = NULL; + cirrusbo->bo.bdev = &cirrus->ttm.bdev; ++ cirrusbo->bo.bdev->dev_mapping = dev->dev_mapping; + + cirrus_ttm_placement(cirrusbo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM); + diff --git a/queue-3.10/drm-don-t-pass-negative-delta-to-ktime_sub_ns.patch b/queue-3.10/drm-don-t-pass-negative-delta-to-ktime_sub_ns.patch new file mode 100644 index 00000000000..a4e57033195 --- /dev/null +++ b/queue-3.10/drm-don-t-pass-negative-delta-to-ktime_sub_ns.patch @@ -0,0 +1,43 @@ +From e91abf80a0998f326107874c88d549f94839f13c Mon Sep 17 00:00:00 2001 +From: Michel Dänzer +Date: Wed, 12 Jun 2013 11:58:44 +0200 +Subject: drm: Don't pass negative delta to ktime_sub_ns() + +From: Michel Dänzer + +commit e91abf80a0998f326107874c88d549f94839f13c upstream. + +It takes an unsigned value. This happens not to blow up on 64-bit +architectures, but it does on 32-bit, causing +drm_calc_vbltimestamp_from_scanoutpos() to calculate totally bogus +timestamps for vblank events. Which in turn causes e.g. gnome-shell to +hang after a DPMS off cycle with current xf86-video-ati Git. + +[airlied: regression introduced in drm: use monotonic time in drm_calc_vbltimestamp_from_scanoutpos] + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59339 +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59836 +Tested-by: shui yangwei +Signed-off-by: Michel Dänzer +Reviewed-by: Imre Deak +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/drm_irq.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/drm_irq.c ++++ b/drivers/gpu/drm/drm_irq.c +@@ -708,7 +708,10 @@ int drm_calc_vbltimestamp_from_scanoutpo + /* Subtract time delta from raw timestamp to get final + * vblank_time timestamp for end of vblank. + */ +- etime = ktime_sub_ns(etime, delta_ns); ++ if (delta_ns < 0) ++ etime = ktime_add_ns(etime, -delta_ns); ++ else ++ etime = ktime_sub_ns(etime, delta_ns); + *vblank_time = ktime_to_timeval(etime); + + DRM_DEBUG("crtc %d : v %d p(%d,%d)@ %ld.%ld -> %ld.%ld [e %d us, %d rep]\n", diff --git a/queue-3.10/drm-mgag200-invalidate-page-tables-when-pinning-a-bo.patch b/queue-3.10/drm-mgag200-invalidate-page-tables-when-pinning-a-bo.patch new file mode 100644 index 00000000000..eb4b8c1c54d --- /dev/null +++ b/queue-3.10/drm-mgag200-invalidate-page-tables-when-pinning-a-bo.patch @@ -0,0 +1,36 @@ +From ecaac1c866bcda4780a963b3d18cd310d971aea3 Mon Sep 17 00:00:00 2001 +From: Egbert Eich +Date: Wed, 17 Jul 2013 17:40:56 +0200 +Subject: drm/mgag200: Invalidate page tables when pinning a BO + +From: Egbert Eich + +commit ecaac1c866bcda4780a963b3d18cd310d971aea3 upstream. + +When a BO gets pinned the placement may get changed. If the memory is +mapped into user space and user space has already accessed the mapped +range the page tables are set up but now point to the wrong memory. +Set bo.mdev->dev_mapping in mgag200_bo_create() to make sure that +ttm_bo_unmap_virtual() called from ttm_bo_handle_move_mem() will take +care of this. + +v2: Don't call ttm_bo_unmap_virtual() in mgag200_bo_pin(), fix comment. + +Signed-off-by: Egbert Eich +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/mgag200/mgag200_ttm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/mgag200/mgag200_ttm.c ++++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c +@@ -347,6 +347,7 @@ int mgag200_bo_create(struct drm_device + + mgabo->gem.driver_private = NULL; + mgabo->bo.bdev = &mdev->ttm.bdev; ++ mgabo->bo.bdev->dev_mapping = dev->dev_mapping; + + mgag200_ttm_placement(mgabo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM); + diff --git a/queue-3.10/drm-radeon-select-audio-dto-based-on-encoder-id-for-dce3.patch b/queue-3.10/drm-radeon-select-audio-dto-based-on-encoder-id-for-dce3.patch new file mode 100644 index 00000000000..0d3df556bdc --- /dev/null +++ b/queue-3.10/drm-radeon-select-audio-dto-based-on-encoder-id-for-dce3.patch @@ -0,0 +1,45 @@ +From e1accbf0543eecfdb161131208c3dfefee22d61f Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 29 Jul 2013 18:56:13 -0400 +Subject: drm/radeon: select audio dto based on encoder id for DCE3 + +From: Alex Deucher + +commit e1accbf0543eecfdb161131208c3dfefee22d61f upstream. + +There are two audio dtos on radeon asics that you can +select between. Normally, dto0 is used for hdmi and +dto1 for DP, but it seems that the dto is somehow +tied to the encoders on DCE3 asics. + +fixes: +https://bugs.freedesktop.org/show_bug.cgi?id=67435 + +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/r600_hdmi.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/radeon/r600_hdmi.c ++++ b/drivers/gpu/drm/radeon/r600_hdmi.c +@@ -242,9 +242,15 @@ void r600_audio_set_dto(struct drm_encod + /* according to the reg specs, this should DCE3.2 only, but in + * practice it seems to cover DCE3.0 as well. + */ +- WREG32(DCCG_AUDIO_DTO0_PHASE, base_rate * 100); +- WREG32(DCCG_AUDIO_DTO0_MODULE, clock * 100); +- WREG32(DCCG_AUDIO_DTO_SELECT, 0); /* select DTO0 */ ++ if (dig->dig_encoder == 0) { ++ WREG32(DCCG_AUDIO_DTO0_PHASE, base_rate * 100); ++ WREG32(DCCG_AUDIO_DTO0_MODULE, clock * 100); ++ WREG32(DCCG_AUDIO_DTO_SELECT, 0); /* select DTO0 */ ++ } else { ++ WREG32(DCCG_AUDIO_DTO1_PHASE, base_rate * 100); ++ WREG32(DCCG_AUDIO_DTO1_MODULE, clock * 100); ++ WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */ ++ } + } else { + /* according to the reg specs, this should be DCE2.0 and DCE3.0 */ + WREG32(AUDIO_DTO, AUDIO_DTO_PHASE(base_rate / 10) | diff --git a/queue-3.10/drm-radeon-stop-sending-invalid-uvd-destroy-msg.patch b/queue-3.10/drm-radeon-stop-sending-invalid-uvd-destroy-msg.patch new file mode 100644 index 00000000000..4b6ca2ae5c9 --- /dev/null +++ b/queue-3.10/drm-radeon-stop-sending-invalid-uvd-destroy-msg.patch @@ -0,0 +1,32 @@ +From 641a00593f7d07eab778fbabf546fb68fff3d5ce Mon Sep 17 00:00:00 2001 +From: Christian König +Date: Mon, 5 Aug 2013 14:10:56 +0200 +Subject: drm/radeon: stop sending invalid UVD destroy msg + +From: Christian König + +commit 641a00593f7d07eab778fbabf546fb68fff3d5ce upstream. + +We also need to check the handle. + +Signed-off-by: Christian König +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_uvd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/radeon/radeon_uvd.c ++++ b/drivers/gpu/drm/radeon/radeon_uvd.c +@@ -218,8 +218,8 @@ void radeon_uvd_free_handles(struct rade + { + int i, r; + for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) { +- if (rdev->uvd.filp[i] == filp) { +- uint32_t handle = atomic_read(&rdev->uvd.handles[i]); ++ uint32_t handle = atomic_read(&rdev->uvd.handles[i]); ++ if (handle != 0 && rdev->uvd.filp[i] == filp) { + struct radeon_fence *fence; + + r = radeon_uvd_get_destroy_msg(rdev, diff --git a/queue-3.10/series b/queue-3.10/series index 86eb0a22910..facb252ce09 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -36,3 +36,9 @@ virtio-console-fix-race-in-port_fops_open-and-port-unplug.patch virtio-console-clean-up-port-data-immediately-at-time-of-unplug.patch virtio-console-fix-raising-sigio-after-port-unplug.patch virtio-console-return-enodev-on-all-read-operations-after-unplug.patch +drm-cirrus-invalidate-page-tables-when-pinning-a-bo.patch +drm-mgag200-invalidate-page-tables-when-pinning-a-bo.patch +drm-ast-invalidate-page-tables-when-pinning-a-bo.patch +drm-don-t-pass-negative-delta-to-ktime_sub_ns.patch +drm-radeon-select-audio-dto-based-on-encoder-id-for-dce3.patch +drm-radeon-stop-sending-invalid-uvd-destroy-msg.patch -- 2.47.3