diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-04-01 11:28:44 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-04-01 17:09:28 +0300 |
commit | 5e916a3ada5f0c3e8a97ee3bb674e81a9bf78a71 (patch) | |
tree | f1ac9e2e269a6765cd0631e11f0427eb319c34e6 /drivers/gpu/drm/radeon/radeon_legacy_crtc.c | |
parent | fc387a0b183150b5beb953d740441f19b49a1fb3 (diff) | |
download | linux-5e916a3ada5f0c3e8a97ee3bb674e81a9bf78a71.tar.xz |
drm/radeon: Only call drm_vblank_on/off between drm_vblank_init/cleanup
Prevents the
if (WARN_ON(pipe >= dev->num_crtcs))
in drm_vblank_on/off from triggering if acceleration fails to
initialize, in which case we call drm_vblank_cleanup.
Reported-and-Tested-by: Julian Margetson <runaway@candw.ms>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_legacy_crtc.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index 24152dfef199..478d4099b0d0 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c @@ -331,13 +331,15 @@ static void radeon_crtc_dpms(struct drm_crtc *crtc, int mode) RADEON_CRTC_DISP_REQ_EN_B)); WREG32_P(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl, ~(mask | crtc_ext_cntl)); } - drm_vblank_on(dev, radeon_crtc->crtc_id); + if (dev->num_crtcs > radeon_crtc->crtc_id) + drm_vblank_on(dev, radeon_crtc->crtc_id); radeon_crtc_load_lut(crtc); break; case DRM_MODE_DPMS_STANDBY: case DRM_MODE_DPMS_SUSPEND: case DRM_MODE_DPMS_OFF: - drm_vblank_off(dev, radeon_crtc->crtc_id); + if (dev->num_crtcs > radeon_crtc->crtc_id) + drm_vblank_off(dev, radeon_crtc->crtc_id); if (radeon_crtc->crtc_id) WREG32_P(RADEON_CRTC2_GEN_CNTL, mask, ~(RADEON_CRTC2_EN | mask)); else { |