diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-09 04:41:32 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-09-13 06:25:46 -0400 |
commit | 356ad3cd616185631235ffb48b3efbf39f9923b3 (patch) | |
tree | 178d1949631bfa36944aa2861916155c3140240b /drivers | |
parent | e6db0da02ea753968d15ae3e835059c207647e78 (diff) |
drm: Only decouple the old_fb from the crtc is we call mode_set*
Otherwise when disabling the output we switch to the new fb (which is
likely NULL) and skip the call to mode_set -- leaking driver private
state on the old_fb.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29857
Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 4 |
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 4238a19c36db..de152a58967d 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -637,13 +637,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
637 | mode_changed = true; | 637 | mode_changed = true; |
638 | 638 | ||
639 | if (mode_changed) { | 639 | if (mode_changed) { |
640 | old_fb = set->crtc->fb; | ||
641 | set->crtc->fb = set->fb; | ||
642 | set->crtc->enabled = (set->mode != NULL); | 640 | set->crtc->enabled = (set->mode != NULL); |
643 | if (set->mode != NULL) { | 641 | if (set->mode != NULL) { |
644 | DRM_DEBUG_KMS("attempting to set mode from" | 642 | DRM_DEBUG_KMS("attempting to set mode from" |
645 | " userspace\n"); | 643 | " userspace\n"); |
646 | drm_mode_debug_printmodeline(set->mode); | 644 | drm_mode_debug_printmodeline(set->mode); |
645 | old_fb = set->crtc->fb; | ||
646 | set->crtc->fb = set->fb; | ||
647 | if (!drm_crtc_helper_set_mode(set->crtc, set->mode, | 647 | if (!drm_crtc_helper_set_mode(set->crtc, set->mode, |
648 | set->x, set->y, | 648 | set->x, set->y, |
649 | old_fb)) { | 649 | old_fb)) { |