From ea152819f45b6cf92f6742ed3f9f639cdbbd53f0 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Fri, 5 Sep 2008 22:51:27 +0200 Subject: [PATCH] exa: align offscreenBase to something sensible - Aligning virtualY makes no sense whatsoever. - displayWidth is the "pitch-width" of the framebuffer. --- src/nv_exa.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/nv_exa.c b/src/nv_exa.c index 23b0c46..67f348c 100644 --- a/src/nv_exa.c +++ b/src/nv_exa.c @@ -864,6 +864,12 @@ NVExaInit(ScreenPtr pScreen) pNv->EXADriverPtr->exa_major = EXA_VERSION_MAJOR; pNv->EXADriverPtr->exa_minor = EXA_VERSION_MINOR; + if (pNv->Architecture < NV_ARCH_50) + pNv->EXADriverPtr->pixmapOffsetAlign = 256; + else + pNv->EXADriverPtr->pixmapOffsetAlign = 65536; /* fuck me! */ + pNv->EXADriverPtr->pixmapPitchAlign = 64; + #if NOUVEAU_EXA_PIXMAPS if (NOUVEAU_EXA_PIXMAPS) { pNv->EXADriverPtr->flags = EXA_OFFSCREEN_PIXMAPS | @@ -879,9 +885,8 @@ NVExaInit(ScreenPtr pScreen) { pNv->EXADriverPtr->flags = EXA_OFFSCREEN_PIXMAPS; pNv->EXADriverPtr->memoryBase = pNv->FB->map; - pNv->EXADriverPtr->offScreenBase = - NOUVEAU_ALIGN(pScrn->virtualX, 64) * NOUVEAU_ALIGN(pScrn->virtualY,64) * - (pScrn->bitsPerPixel / 8); + pNv->EXADriverPtr->offScreenBase = NOUVEAU_ALIGN(pScrn->displayWidth * pScrn->virtualY * + (pScrn->bitsPerPixel / 8), pNv->EXADriverPtr->pixmapOffsetAlign); pNv->EXADriverPtr->memorySize = pNv->FB->size; #if EXA_VERSION_MINOR >= 2 pNv->EXADriverPtr->PixmapIsOffscreen = nouveau_exa_pixmap_is_offscreen; @@ -907,12 +912,6 @@ NVExaInit(ScreenPtr pScreen) #endif } - if (pNv->Architecture < NV_ARCH_50) - pNv->EXADriverPtr->pixmapOffsetAlign = 256; - else - pNv->EXADriverPtr->pixmapOffsetAlign = 65536; /* fuck me! */ - pNv->EXADriverPtr->pixmapPitchAlign = 64; - if (pNv->Architecture >= NV_ARCH_50) { struct nouveau_device_priv *nvdev = nouveau_device(pNv->dev); struct nouveau_bo_priv *nvbo = nouveau_bo(pNv->FB); -- 2.32.0.93.g670b81a890