Commit 2de3b484 authored by Jerome Glisse's avatar Jerome Glisse Committed by Dave Airlie
Browse files

drm/radeon/kms: fix oops when set_base is call with no FB



Just do nothing if crct_set_base() is called with no FB.

The oops happens when the user switches between X & vt or in some case
when changing mode.

Signed-off-by: default avatarJerome Glisse <jglisse@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent fd874ad0
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -578,8 +578,11 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
	uint64_t fb_location;
	uint32_t fb_format, fb_pitch_pixels, tiling_flags;

	if (!crtc->fb)
		return -EINVAL;
	/* no fb bound */
	if (!crtc->fb) {
		DRM_DEBUG("No FB bound\n");
		return 0;
	}

	radeon_fb = to_radeon_framebuffer(crtc->fb);

+5 −0
Original line number Diff line number Diff line
@@ -408,6 +408,11 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
	uint32_t gen_cntl_reg, gen_cntl_val;

	DRM_DEBUG("\n");
	/* no fb bound */
	if (!crtc->fb) {
		DRM_DEBUG("No FB bound\n");
		return 0;
	}

	radeon_fb = to_radeon_framebuffer(crtc->fb);