aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2012-01-11 18:20:18 -0600
committerRob Clark <rob@ti.com>2012-01-13 11:22:43 -0600
commitdc9dfae85f40fa3c981c45f8db68d3ce6d7b0ca6 (patch)
treef4e9961e02a877dc9b61eff86ab20f127a323d44
parente450d4195cf84c7a9e0bc4a8061d3b53d06f80e7 (diff)
fix issue initialization order vs damage
Damage must be initialized after EXA, otherwise they end up wrapping the ScreenPtr fxns in wrong order, which ends up resulting in GCOps fxns getting wrapped in the wrong order. And since Damage gets indirectly initialized from miDCInitialize() this must happen after EXA initialization. Otherwise only sw fallback operations will generate damage.
-rw-r--r--src/omap_driver.c88
1 files changed, 49 insertions, 39 deletions
diff --git a/src/omap_driver.c b/src/omap_driver.c
index 1705eee..e702dbc 100644
--- a/src/omap_driver.c
+++ b/src/omap_driver.c
@@ -607,6 +607,49 @@ fail:
}
+/**
+ * Initialize EXA and DRI2
+ */
+static void
+OMAPAccelInit(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ OMAPPtr pOMAP = OMAPPTR(pScrn);
+
+ if (!pOMAP->NoAccel) {
+ switch (pOMAP->chipset) {
+ case 0x3430:
+ case 0x3630:
+ case 0x4430:
+ case 0x4460:
+ INFO_MSG("Initializing the \"%s\" sub-module ...", SUB_MODULE_PVR);
+ pOMAP->pOMAPEXA = InitPowerVREXA(pScreen, pScrn);
+ if (pOMAP->pOMAPEXA) {
+ INFO_MSG("Successfully initialized the \"%s\" sub-module",
+ SUB_MODULE_PVR);
+ } else {
+ INFO_MSG("Could not initialize the \"%s\" sub-module",
+ SUB_MODULE_PVR);
+ pOMAP->NoAccel = TRUE;
+ }
+ break;
+ default:
+ ERROR_MSG("Unsupported chipset: %d", pOMAP->chipset);
+ pOMAP->NoAccel = TRUE;
+ break;
+ }
+ }
+
+ if (!pOMAP->pOMAPEXA) {
+ pOMAP->pOMAPEXA = InitNullEXA(pScreen, pScrn);
+ }
+
+ if (pOMAP->dri && pOMAP->pOMAPEXA) {
+ pOMAP->dri = OMAPDRI2ScreenInit(pScreen);
+ } else {
+ pOMAP->dri = FALSE;
+ }
+}
/**
* The driver's ScreenInit() function. Fill in pScreen, map the frame buffer,
@@ -697,6 +740,12 @@ OMAPScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* Set the initial black & white colormap indices: */
xf86SetBlackWhitePixels(pScreen);
+ /* Initialize external sub-modules for EXA now, this has to be before
+ * miDCInitialize() otherwise stacking order for wrapped ScreenPtr fxns
+ * ends up in the wrong order.
+ */
+ OMAPAccelInit(pScreen);
+
/* Initialize backing store: */
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
@@ -707,12 +756,6 @@ OMAPScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* Cause the cursor position to be updated by the mouse signal handler: */
xf86SetSilkenMouse(pScreen);
-#ifdef XF86DRI
- if (pOMAP->dri) {
- pOMAP->dri = OMAPDRI2ScreenInit(pScreen);
- }
-#endif
-
/* XXX -- Is this the right place for this? The Intel i830 driver says:
* "Must force it before EnterVT, so we are in control of VT..."
*/
@@ -756,39 +799,6 @@ OMAPScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
wrap(pOMAP, pScreen, CreateScreenResources, OMAPCreateScreenResources);
wrap(pOMAP, pScreen, BlockHandler, OMAPBlockHandler);
- /*
- * Initialize external sub-modules for EXA now:
- */
-
- if (!pOMAP->NoAccel) {
- switch (pOMAP->chipset) {
- case 0x3430:
- case 0x3630:
- case 0x4430:
- case 0x4460:
- INFO_MSG("Initializing the \"%s\" sub-module ...", SUB_MODULE_PVR);
- pOMAP->pOMAPEXA = InitPowerVREXA(pScreen, pScrn);
- if (pOMAP->pOMAPEXA) {
- INFO_MSG("Successfully initialized the \"%s\" sub-module",
- SUB_MODULE_PVR);
- } else {
- INFO_MSG("Could not initialize the \"%s\" sub-module",
- SUB_MODULE_PVR);
- pOMAP->NoAccel = TRUE;
- }
- break;
- /* case 4470: ..; break; */
- default:
- ERROR_MSG("Unsupported chipset: %d", pOMAP->chipset);
- pOMAP->NoAccel = TRUE;
- break;
- }
- }
-
- if (!pOMAP->pOMAPEXA) {
- pOMAP->pOMAPEXA = InitNullEXA(pScreen, pScrn);
- }
-
drmmode_screen_init(pScrn);
TRACE_EXIT();