Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 356ad3cd authored by Chris Wilson's avatar Chris Wilson Committed by Dave Airlie
Browse files

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: default avatarSitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
Cc: stable@kernel.org
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent e6db0da0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -637,13 +637,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
		mode_changed = true;
		mode_changed = true;


	if (mode_changed) {
	if (mode_changed) {
		old_fb = set->crtc->fb;
		set->crtc->fb = set->fb;
		set->crtc->enabled = (set->mode != NULL);
		set->crtc->enabled = (set->mode != NULL);
		if (set->mode != NULL) {
		if (set->mode != NULL) {
			DRM_DEBUG_KMS("attempting to set mode from"
			DRM_DEBUG_KMS("attempting to set mode from"
					" userspace\n");
					" userspace\n");
			drm_mode_debug_printmodeline(set->mode);
			drm_mode_debug_printmodeline(set->mode);
			old_fb = set->crtc->fb;
			set->crtc->fb = set->fb;
			if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
			if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
						      set->x, set->y,
						      set->x, set->y,
						      old_fb)) {
						      old_fb)) {