From: Alex Deucher Date: Wed, 15 Aug 2012 20:58:30 +0000 (-0400) Subject: drm/radeon/r1xx-r4xx: don't use radeon_crtc for vblank callback X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=94f768fd7458e5e8372b8b7565b594284afb6b89;p=linux-beck.git drm/radeon/r1xx-r4xx: don't use radeon_crtc for vblank callback This might be called before we've allocated the radeon_crtcs Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 8d7e33a0b243..163c33e1a1d6 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -80,10 +80,12 @@ MODULE_FIRMWARE(FIRMWARE_R520); */ void r100_wait_for_vblank(struct radeon_device *rdev, int crtc) { - struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc]; int i; - if (radeon_crtc->crtc_id == 0) { + if (crtc >= rdev->num_crtc) + return; + + if (crtc == 0) { if (RREG32(RADEON_CRTC_GEN_CNTL) & RADEON_CRTC_EN) { for (i = 0; i < rdev->usec_timeout; i++) { if (!(RREG32(RADEON_CRTC_STATUS) & RADEON_CRTC_VBLANK_CUR))