summaryrefslogtreecommitdiff
path: root/src/radeon_driver.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2008-10-01 14:38:27 -0400
committerAlex Deucher <alexdeucher@gmail.com>2008-10-01 14:38:27 -0400
commit346228b20c69a965c9e7d67157f42c1d36a5b6c3 (patch)
tree5ea859ae9f108fb989f67653471b4bc8deb441b0 /src/radeon_driver.c
parentc359c2a31caf9f75b9fc6b6bcbc3e9dc1fe404ba (diff)
Workaround to make initial rotation work
Acceleration needs to be initialized before setting the mode for initial rotation to work. Changing the order in RADEONScreenInit() doesn't work because RADEONDRIKernelInit() hangs in the ioctl to initialize the CP if the mode is not set prior (even if the heads are turned off after setting the mode). The workaround is to set the modes twice, once before accel and once after. This needs to be looked into further.
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r--src/radeon_driver.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 67f70cb5..9b36ca4d 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3311,7 +3311,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
RADEONInitMemoryMap(pScrn);
/* empty the surfaces */
- {
+ if (info->ChipFamily < CHIP_FAMILY_R600) {
unsigned char *RADEONMMIO = info->MMIO;
unsigned int j;
for (j = 0; j < 8; j++) {
@@ -3449,13 +3449,13 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"[drm] failed to enable new memory map\n");
RADEONDRICloseScreen(pScreen);
- info->directRenderingEnabled = FALSE;
+ info->directRenderingEnabled = FALSE;
}
}
#endif
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing fb layer\n");
-
+
if (info->r600_shadow_fb) {
info->fb_shadow = xcalloc(1,
pScrn->displayWidth * pScrn->virtualY *
@@ -3509,16 +3509,27 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
else if (strcmp(s, "BGR") == 0) subPixelOrder = SubPixelHorizontalBGR;
else if (strcmp(s, "NONE") == 0) subPixelOrder = SubPixelNone;
PictureSetSubpixelOrder (pScreen, subPixelOrder);
- }
+ }
#endif
pScrn->vtSema = TRUE;
- /* xf86CrtcRotate() accesses pScrn->pScreen */
- pScrn->pScreen = pScreen;
-
- if (!xf86SetDesiredModes (pScrn))
- return FALSE;
+ /* XXX
+ * Unless we set an initial mode here, RADEONDRIKernelInit() hangs in the ioctl
+ * to initialize the CP. However, we need to init the CP for accel or initial
+ * rotation fails so we set the mode now, then call xf86SetDesiredModes() after
+ * accel is initialized to set the proper rotation, etc.
+ */
+ {
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int i;
+ for (i = 0; i < config->num_crtc; i++) {
+ xf86CrtcPtr crtc = config->crtc[i];
+ if (crtc->enabled)
+ xf86CrtcSetMode (crtc, &crtc->desiredMode, RR_Rotate_0,
+ crtc->desiredX, crtc->desiredY);
+ }
+ }
RADEONSaveScreen(pScreen, SCREEN_SAVER_ON);
@@ -3652,6 +3663,10 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
}
}
+ /* set the modes with desired rotation, etc. */
+ if (!xf86SetDesiredModes (pScrn))
+ return FALSE;
+
/* Provide SaveScreen & wrap BlockHandler and CloseScreen */
/* Wrap CloseScreen */
info->CloseScreen = pScreen->CloseScreen;