52
52
AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL
55
static bool avivo_is_in_vblank(struct radeon_device *rdev, int crtc)
57
if (RREG32(AVIVO_D1CRTC_STATUS + crtc_offsets[crtc]) & AVIVO_D1CRTC_V_BLANK)
63
static bool avivo_is_counter_moving(struct radeon_device *rdev, int crtc)
67
pos1 = RREG32(AVIVO_D1CRTC_STATUS_POSITION + crtc_offsets[crtc]);
68
pos2 = RREG32(AVIVO_D1CRTC_STATUS_POSITION + crtc_offsets[crtc]);
77
* avivo_wait_for_vblank - vblank wait asic callback.
79
* @rdev: radeon_device pointer
80
* @crtc: crtc to wait for vblank on
82
* Wait for vblank on the requested crtc (r5xx-r7xx).
55
84
void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc)
59
88
if (crtc >= rdev->num_crtc)
62
if (RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[crtc]) & AVIVO_CRTC_EN) {
63
for (i = 0; i < rdev->usec_timeout; i++) {
64
if (!(RREG32(AVIVO_D1CRTC_STATUS + crtc_offsets[crtc]) & AVIVO_D1CRTC_V_BLANK))
91
if (!(RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[crtc]) & AVIVO_CRTC_EN))
94
/* depending on when we hit vblank, we may be close to active; if so,
95
* wait for another frame.
97
while (avivo_is_in_vblank(rdev, crtc)) {
99
if (!avivo_is_counter_moving(rdev, crtc))
68
for (i = 0; i < rdev->usec_timeout; i++) {
69
if (RREG32(AVIVO_D1CRTC_STATUS + crtc_offsets[crtc]) & AVIVO_D1CRTC_V_BLANK)
104
while (!avivo_is_in_vblank(rdev, crtc)) {
105
if (i++ % 100 == 0) {
106
if (!avivo_is_counter_moving(rdev, crtc))