提交 75104fa4 编写于 作者: A Alex Deucher

drm/radeon/r5xx-r7xx: don't use radeon_crtc for vblank callback (v2)

This might be called before we've allocated the radeon_crtcs

v2: fix typo in array size
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 94f768fd
...@@ -46,19 +46,27 @@ ...@@ -46,19 +46,27 @@
void rs600_gpu_init(struct radeon_device *rdev); void rs600_gpu_init(struct radeon_device *rdev);
int rs600_mc_wait_for_idle(struct radeon_device *rdev); int rs600_mc_wait_for_idle(struct radeon_device *rdev);
static const u32 crtc_offsets[2] =
{
0,
AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL
};
void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc) void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc)
{ {
struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc];
int i; int i;
if (RREG32(AVIVO_D1CRTC_CONTROL + radeon_crtc->crtc_offset) & AVIVO_CRTC_EN) { if (crtc >= rdev->num_crtc)
return;
if (RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[crtc]) & AVIVO_CRTC_EN) {
for (i = 0; i < rdev->usec_timeout; i++) { for (i = 0; i < rdev->usec_timeout; i++) {
if (!(RREG32(AVIVO_D1CRTC_STATUS + radeon_crtc->crtc_offset) & AVIVO_D1CRTC_V_BLANK)) if (!(RREG32(AVIVO_D1CRTC_STATUS + crtc_offsets[crtc]) & AVIVO_D1CRTC_V_BLANK))
break; break;
udelay(1); udelay(1);
} }
for (i = 0; i < rdev->usec_timeout; i++) { for (i = 0; i < rdev->usec_timeout; i++) {
if (RREG32(AVIVO_D1CRTC_STATUS + radeon_crtc->crtc_offset) & AVIVO_D1CRTC_V_BLANK) if (RREG32(AVIVO_D1CRTC_STATUS + crtc_offsets[crtc]) & AVIVO_D1CRTC_V_BLANK)
break; break;
udelay(1); udelay(1);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册