diff options
author | Christian König <christian.koenig@amd.com> | 2014-05-27 10:49:20 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-06-02 10:25:11 -0400 |
commit | 157fa14dc4065ce7536473e643c95385d87bd580 (patch) | |
tree | 5b8dc7b22503c1e8009a9a01b39e54b1ece9bf1a /drivers/gpu/drm/radeon/r100.c | |
parent | 75f36d861957cb05b7889af24c8cd4a789398304 (diff) |
drm/radeon: split page flip and pending callback
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r100.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 840651f33610..52548f7bbb5a 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -152,9 +152,8 @@ void r100_wait_for_vblank(struct radeon_device *rdev, int crtc) | |||
152 | * During vblank we take the crtc lock and wait for the update_pending | 152 | * During vblank we take the crtc lock and wait for the update_pending |
153 | * bit to go high, when it does, we release the lock, and allow the | 153 | * bit to go high, when it does, we release the lock, and allow the |
154 | * double buffered update to take place. | 154 | * double buffered update to take place. |
155 | * Returns the current update pending status. | ||
156 | */ | 155 | */ |
157 | u32 r100_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) | 156 | void r100_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) |
158 | { | 157 | { |
159 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; | 158 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; |
160 | u32 tmp = ((u32)crtc_base) | RADEON_CRTC_OFFSET__OFFSET_LOCK; | 159 | u32 tmp = ((u32)crtc_base) | RADEON_CRTC_OFFSET__OFFSET_LOCK; |
@@ -176,8 +175,24 @@ u32 r100_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) | |||
176 | tmp &= ~RADEON_CRTC_OFFSET__OFFSET_LOCK; | 175 | tmp &= ~RADEON_CRTC_OFFSET__OFFSET_LOCK; |
177 | WREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset, tmp); | 176 | WREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset, tmp); |
178 | 177 | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * r100_page_flip_pending - check if page flip is still pending | ||
182 | * | ||
183 | * @rdev: radeon_device pointer | ||
184 | * @crtc_id: crtc to check | ||
185 | * | ||
186 | * Check if the last pagefilp is still pending (r1xx-r4xx). | ||
187 | * Returns the current update pending status. | ||
188 | */ | ||
189 | bool r100_page_flip_pending(struct radeon_device *rdev, int crtc_id) | ||
190 | { | ||
191 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; | ||
192 | |||
179 | /* Return current update_pending status: */ | 193 | /* Return current update_pending status: */ |
180 | return RREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset) & RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET; | 194 | return !!(RREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset) & |
195 | RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET); | ||
181 | } | 196 | } |
182 | 197 | ||
183 | /** | 198 | /** |