mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 07:08:07 +00:00
drm/radeon/dce4+: optimize pageflip (v2)
Taking the grph update lock is only necessary when updating the the secondary address (for single pipe stereo). v2: fix comment as per Michel's suggestion Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
ce055fe332
commit
cbd3e2493c
1 changed files with 4 additions and 28 deletions
|
@ -1404,44 +1404,20 @@ void dce4_wait_for_vblank(struct radeon_device *rdev, int crtc)
|
||||||
* @crtc_id: crtc to cleanup pageflip on
|
* @crtc_id: crtc to cleanup pageflip on
|
||||||
* @crtc_base: new address of the crtc (GPU MC address)
|
* @crtc_base: new address of the crtc (GPU MC address)
|
||||||
*
|
*
|
||||||
* Does the actual pageflip (evergreen+).
|
* Triggers the actual pageflip by updating the primary
|
||||||
* During vblank we take the crtc lock and wait for the update_pending
|
* surface base address (evergreen+).
|
||||||
* bit to go high, when it does, we release the lock, and allow the
|
|
||||||
* double buffered update to take place.
|
|
||||||
* Returns the current update pending status.
|
|
||||||
*/
|
*/
|
||||||
void evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
|
void evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
|
||||||
{
|
{
|
||||||
struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
|
struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
|
||||||
u32 tmp = RREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset);
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* Lock the graphics update lock */
|
|
||||||
tmp |= EVERGREEN_GRPH_UPDATE_LOCK;
|
|
||||||
WREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset, tmp);
|
|
||||||
|
|
||||||
/* update the scanout addresses */
|
/* update the scanout addresses */
|
||||||
WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + radeon_crtc->crtc_offset,
|
|
||||||
upper_32_bits(crtc_base));
|
|
||||||
WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset,
|
|
||||||
(u32)crtc_base);
|
|
||||||
|
|
||||||
WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH + radeon_crtc->crtc_offset,
|
WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH + radeon_crtc->crtc_offset,
|
||||||
upper_32_bits(crtc_base));
|
upper_32_bits(crtc_base));
|
||||||
WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset,
|
WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset,
|
||||||
(u32)crtc_base);
|
(u32)crtc_base);
|
||||||
|
/* post the write */
|
||||||
/* Wait for update_pending to go high. */
|
RREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset);
|
||||||
for (i = 0; i < rdev->usec_timeout; i++) {
|
|
||||||
if (RREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset) & EVERGREEN_GRPH_SURFACE_UPDATE_PENDING)
|
|
||||||
break;
|
|
||||||
udelay(1);
|
|
||||||
}
|
|
||||||
DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
|
|
||||||
|
|
||||||
/* Unlock the lock, so double-buffering can take place inside vblank */
|
|
||||||
tmp &= ~EVERGREEN_GRPH_UPDATE_LOCK;
|
|
||||||
WREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset, tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue