xf86-video-intel: src/i810_dri.c
Daniel Vetter
danvet at kemper.freedesktop.org
Fri Apr 16 13:35:45 PDT 2010
src/i810_dri.c | 41 ++++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 19 deletions(-)
New commits:
commit 9494f4e91f8c8c7a0f8d61c6883c9bfceb2cec46
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date: Fri Apr 16 22:24:01 2010 +0200
i810: adjust the pitch for DRI rendering
Current code forgot to adjust the pitch of the frontbuffer.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=16729
diff --git a/src/i810_dri.c b/src/i810_dri.c
index e566acf..f6f9f5e 100644
--- a/src/i810_dri.c
+++ b/src/i810_dri.c
@@ -305,6 +305,28 @@ I810DRIScreenInit(ScreenPtr pScreen)
return FALSE;
}
+ /* adjust width first */
+#define Elements(x) sizeof(x)/sizeof(*x)
+ for (pitch_idx = 0; pitch_idx < Elements(i810_pitches); pitch_idx++)
+ if (width <= i810_pitches[pitch_idx])
+ break;
+
+ if (pitch_idx == Elements(i810_pitches)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[dri] Couldn't find depth/back buffer pitch");
+ DRICloseScreen(pScreen);
+ return FALSE;
+ } else {
+ /* for tiled memory to work, the buffer needs to have the
+ * number of lines as a multiple of 16 (the tile size),
+ * - airlied */
+ int lines = (pScrn->virtualY + 15) / 16 * 16;
+ back_size = i810_pitches[pitch_idx] * lines;
+ back_size = ((back_size + 4096 - 1) / 4096) * 4096;
+ }
+
+ pScrn->displayWidth = i810_pitches[pitch_idx] / pI810->cpp;
+
/* Check the DRI version */
{
int major, minor, patch;
@@ -521,25 +543,6 @@ I810DRIScreenInit(ScreenPtr pScreen)
xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : 0x%x\n",
(int)dcacheHandle);
-#define Elements(x) sizeof(x)/sizeof(*x)
- for (pitch_idx = 0; pitch_idx < Elements(i810_pitches); pitch_idx++)
- if (width <= i810_pitches[pitch_idx])
- break;
-
- if (pitch_idx == Elements(i810_pitches)) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "[dri] Couldn't find depth/back buffer pitch");
- DRICloseScreen(pScreen);
- return FALSE;
- } else {
- /* for tiled memory to work, the buffer needs to have the
- * number of lines as a multiple of 16 (the tile size),
- * - airlied */
- int lines = (pScrn->virtualY + 15) / 16 * 16;
- back_size = i810_pitches[pitch_idx] * lines;
- back_size = ((back_size + 4096 - 1) / 4096) * 4096;
- }
-
sysmem_size = pScrn->videoRam * 1024;
if (dcacheHandle != DRM_AGP_NO_HANDLE) {
if (back_size > 4 * 1024 * 1024) {
More information about the xorg-commit
mailing list