diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-07-08 13:42:14 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-07-08 13:42:14 +0000 |
commit | a5794cfc4199ee5459b217588253f96f748c1ff6 (patch) | |
tree | 3d0623c1dafd5d685dc47d2fb76fe2695e43411b /driver/xf86-video-ati/src/radeon_driver.c | |
parent | b5e0171cff25c42b562c55ec774bbaac376c31b5 (diff) |
Brown paperbag commit.
Prodded by espie@ I reviewed the history of
OpenBSD local changes carefully and found a number of merge errors
accumulated over the complicated CVS history of this driver.
This the 6.14.4 code + OpenBSD local fixes as it should be.
Diffstat (limited to 'driver/xf86-video-ati/src/radeon_driver.c')
-rw-r--r-- | driver/xf86-video-ati/src/radeon_driver.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/driver/xf86-video-ati/src/radeon_driver.c b/driver/xf86-video-ati/src/radeon_driver.c index 2f22fe375..7f8df9c64 100644 --- a/driver/xf86-video-ati/src/radeon_driver.c +++ b/driver/xf86-video-ati/src/radeon_driver.c @@ -384,6 +384,9 @@ void RADEONFreeRec(ScrnInfoPtr pScrn) for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) { if (info->encoders[i]) { + info->encoders[i]->ref_count--; + if (info->encoders[i]->ref_count != 0) + continue; if (info->encoders[i]->dev_priv) { free(info->encoders[i]->dev_priv); info->encoders[i]->dev_priv = NULL; @@ -3513,7 +3516,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, info->MaxSurfaceWidth); info->allowColorTiling = FALSE; } - if (info->allowColorTiling) { + if (info->allowColorTiling && pScrn->currentMode != NULL) { info->tilingEnabled = (pScrn->currentMode->Flags & (V_DBLSCAN | V_INTERLACE)) ? FALSE : TRUE; } @@ -3883,12 +3886,13 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, } } + /* xf86SetDesiredModes() accesses pScrn->pScreen */ + pScrn->pScreen = pScreen; + /* Clear the framebuffer */ memset(info->FB + pScrn->fbOffset, 0, pScrn->virtualY * pScrn->displayWidth * info->CurrentLayout.pixel_bytes); - pScrn->pScreen = pScreen; - /* set the modes with desired rotation, etc. */ if (!xf86SetDesiredModes (pScrn)) return FALSE; @@ -3903,7 +3907,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, info->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = RADEONCreateScreenResources; - if (!xf86CrtcScreenInit (pScreen)) + if (!xf86CrtcScreenInit (pScreen)) return FALSE; /* Colormap setup */ @@ -5885,7 +5889,7 @@ static void RADEONRestore(ScrnInfoPtr pScrn) * corrupted. This hack solves the problem 99% of the time. A * correct fix is being worked on. */ - usleep(1000000); + usleep(100000); #endif if (info->ChipFamily < CHIP_FAMILY_R600) |