summaryrefslogtreecommitdiff
path: root/src/radeon_driver.c
diff options
context:
space:
mode:
authorAlex Deucher <alex@t41p.hsd1.va.comcast.net>2008-01-04 20:00:48 -0500
committerAlex Deucher <alex@t41p.hsd1.va.comcast.net>2008-01-04 20:00:48 -0500
commit3ba7f393d0669df36848715799de8affc10a5534 (patch)
treee397d2339b6c44701cf850352dcbec7dad475570 /src/radeon_driver.c
parenta0de9c0844f9e066e0f02e8cd8045bdd278e6494 (diff)
RADEON: further fixup for pScrn->pScreen issue
the previous fix seems to cause the driver to hang on some cards.
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r--src/radeon_driver.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 1f12e87..176e80d 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3181,7 +3181,9 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
RADEONInfoPtr info = RADEONPTR(pScrn);
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
int hasDRI = 0;
+ int i;
#ifdef RENDER
int subPixelOrder = SubPixelUnknown;
char* s;
@@ -3481,6 +3483,34 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
pScrn->vtSema = TRUE;
+ /* xf86CrtcRotate() accesses pScrn->pScreen */
+ pScrn->pScreen = pScreen;
+
+#if 1
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
+
+ /* Mark that we'll need to re-set the mode for sure */
+ memset(&crtc->mode, 0, sizeof(crtc->mode));
+ if (!crtc->desiredMode.CrtcHDisplay) {
+ crtc->desiredMode = *RADEONCrtcFindClosestMode (crtc, pScrn->currentMode);
+ crtc->desiredRotation = RR_Rotate_0;
+ crtc->desiredX = 0;
+ crtc->desiredY = 0;
+ }
+
+ if (!xf86CrtcSetMode (crtc, &crtc->desiredMode, crtc->desiredRotation, crtc->desiredX, crtc->desiredY))
+ return FALSE;
+
+ }
+#else
+ /* seems to do the wrong thing on some cards??? */
+ if (!xf86SetDesiredModes (pScrn))
+ return FALSE;
+#endif
+
+ RADEONSaveScreen(pScreen, SCREEN_SAVER_ON);
+
/* Backing store setup */
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing backing store\n");
@@ -3623,6 +3653,9 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
info->CreateScreenResources = pScreen->CreateScreenResources;
pScreen->CreateScreenResources = RADEONCreateScreenResources;
+ if (!xf86CrtcScreenInit (pScreen))
+ return FALSE;
+
/* Wrap pointer motion to flip touch screen around */
info->PointerMoved = pScrn->PointerMoved;
pScrn->PointerMoved = RADEONPointerMoved;
@@ -3639,16 +3672,6 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
#endif
| CMAP_RELOAD_ON_MODE_SWITCH)) return FALSE;
-#if 1
- /* xf86CrtcRotate() accesses pScrn->pScreen */
- pScrn->pScreen = pScreen;
-
- if (!xf86CrtcScreenInit (pScreen))
- return FALSE;
- if (!xf86SetDesiredModes (pScrn))
- return FALSE;
-#endif
-
/* Note unused options */
if (serverGeneration == 1)
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);