diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2012-08-15 21:10:32 (GMT) |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-09-20 17:10:32 (GMT) |
commit | 46437057bd2a178b12d3a55bac06cbbd46eea4be (patch) | |
tree | db01cb517b887239fb239ca100b94ca1f9314ad4 /drivers/gpu/drm | |
parent | 4a15903db02026728d0cf2755c6fabae16b8db6a (diff) | |
download | linux-46437057bd2a178b12d3a55bac06cbbd46eea4be.tar.xz |
drm/radeon: clean up evergreen_get_vblank_counter
Use the new offset array rather than open coding it.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 0c79d9e..585c117 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -2345,22 +2345,10 @@ int evergreen_asic_reset(struct radeon_device *rdev) u32 evergreen_get_vblank_counter(struct radeon_device *rdev, int crtc) { - switch (crtc) { - case 0: - return RREG32(CRTC_STATUS_FRAME_COUNT + EVERGREEN_CRTC0_REGISTER_OFFSET); - case 1: - return RREG32(CRTC_STATUS_FRAME_COUNT + EVERGREEN_CRTC1_REGISTER_OFFSET); - case 2: - return RREG32(CRTC_STATUS_FRAME_COUNT + EVERGREEN_CRTC2_REGISTER_OFFSET); - case 3: - return RREG32(CRTC_STATUS_FRAME_COUNT + EVERGREEN_CRTC3_REGISTER_OFFSET); - case 4: - return RREG32(CRTC_STATUS_FRAME_COUNT + EVERGREEN_CRTC4_REGISTER_OFFSET); - case 5: - return RREG32(CRTC_STATUS_FRAME_COUNT + EVERGREEN_CRTC5_REGISTER_OFFSET); - default: + if (crtc >= rdev->num_crtc) return 0; - } + else + return RREG32(CRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]); } void evergreen_disable_interrupt_state(struct radeon_device *rdev) |