summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:05:50 +1000
committerDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:05:50 +1000
commit9af2aac8e1b9227c752717498641afe880ec948b (patch)
treebf1392fed49f36338911695f74b0b9065fcbf4ab
parent11390cd554287b46c737a1dabbe085392fec4da8 (diff)
intel-dri.patch
-rw-r--r--src/i830_dri.c12
-rw-r--r--src/i830_driver.c26
2 files changed, 22 insertions, 16 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 141b970f..5dfe82c6 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -130,7 +130,7 @@ static void I830DRITransitionSingleToMulti3d(ScreenPtr pScreen);
#if (DRIINFO_MAJOR_VERSION > 5 || \
(DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 4))
-#define DRI_DRIVER_FRAMEBUFFER_MAP 1
+#define DRI_DRIVER_FRAMEBUFFER_MAP 0
#else
#define DRI_DRIVER_FRAMEBUFFER_MAP 0
#endif
@@ -613,9 +613,13 @@ I830DRIScreenInit(ScreenPtr pScreen)
#else
/* Supply a dummy mapping info required by DRI setup.
*/
- pDRIInfo->frameBufferPhysicalAddress = (char *) pI830->LinearAddr;
- pDRIInfo->frameBufferSize = GTT_PAGE_SIZE;
- pDRIInfo->frameBufferStride = 1;
+ pDRIInfo->frameBufferPhysicalAddress = (char *) pI830->LinearAddr + pI830->front_buffer->offset;
+ /* Workaround for XAA pixmap cache: Don't use front_buffer->size
+ * and instead, calculate the visible frontbuffer size and round to
+ * avoid irritating the assertions of older DRI drivers.
+ */
+ pDRIInfo->frameBufferSize = ROUND_TO_PAGE(pScrn->displayWidth * pScrn->virtualY * pI830->cpp);
+ pDRIInfo->frameBufferStride = pScrn->displayWidth;
#endif
pDRIInfo->TransitionTo2d = I830DRITransitionTo2d;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index d51d02fd..11ba3e2c 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2453,22 +2453,12 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->videoRam & ~3, pScrn->videoRam);
pScrn->videoRam &= ~3;
}
-
#ifdef XF86DRI
/* Check for appropriate bpp and module support to initialize DRI. */
if (!I830CheckDRIAvailable(pScrn)) {
pI830->directRenderingDisabled = TRUE;
- }
-
- /* If DRI hasn't been explicitly disabled, try to initialize it.
- * It will be used by the memory allocator.
- */
- if (!pI830->directRenderingDisabled)
- pI830->directRenderingEnabled = I830DRIScreenInit(pScreen);
- else
- pI830->directRenderingEnabled = FALSE;
-#else
- pI830->directRenderingEnabled = FALSE;
+ } else
+ pI830->directRenderingEnabled = TRUE;
#endif
/* Set up our video memory allocator for the chosen videoRam */
@@ -2661,6 +2651,18 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
allocation_done = TRUE;
}
+#ifdef XF86DRI
+
+ /* If DRI hasn't been explicitly disabled, try to initialize it.
+ * It will be used by the memory allocator.
+ */
+ if (!pI830->directRenderingDisabled)
+ pI830->directRenderingEnabled = I830DRIScreenInit(pScreen);
+ else
+ pI830->directRenderingEnabled = FALSE;
+#else
+ pI830->directRenderingEnabled = FALSE;
+#endif
I830UnmapMMIO(pScrn);
if (!IS_I965G(pI830) && pScrn->displayWidth > 2048) {