aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-28 06:53:03 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-31 07:35:51 -0500
commit9334ef755f060e251f3f395caeda1a58b6834ea3 (patch)
tree8032fbc2dbfd7675b6dd96275fbadb214ba5faa4
parent5d1d0cc87fc0887921993ea0742932e0c8adeda0 (diff)
drm: Don't switch fb when disabling an output
In drm_crtc_helper_set_config, we call drm_crtc_helper_set_mode which may return early and do no operation if the crtc is to be disabled. In this case we merrily swap to the new fb, discarding the old_fb believing that it has been cleaned up. However, due to the early return, the old_fb was not presented to the backend for correct reaping, and nor was the new one - which is about to be reaped via the drm_helper_disable_unused_functions(), leading to incorrect refcounting of the pinned objects. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=27722 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29857 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29230 Tested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 952b3d4fb2a6..468e8e16c806 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -649,8 +649,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
649 mode_changed = true; 649 mode_changed = true;
650 650
651 if (mode_changed) { 651 if (mode_changed) {
652 set->crtc->enabled = (set->mode != NULL); 652 set->crtc->enabled = drm_helper_crtc_in_use(set->crtc);
653 if (set->mode != NULL) { 653 if (set->crtc->enabled) {
654 DRM_DEBUG_KMS("attempting to set mode from" 654 DRM_DEBUG_KMS("attempting to set mode from"
655 " userspace\n"); 655 " userspace\n");
656 drm_mode_debug_printmodeline(set->mode); 656 drm_mode_debug_printmodeline(set->mode);