From 3f3e6353a927652886f2f00c01982db46cc3401f Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sun, 3 Apr 2011 23:12:17 +0200 Subject: [PATCH] DRI: Do not map the framebuffer separately from the apertures. Only map the apertures, and access the framebuffer through the first aperture. Since kernel commit 41c2e75e60200a860a74b7c84a6375c105e7437f the drm does not support multiple framebuffer maps per device, so it would mix up a framebuffer and aperture map. This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32511 in some cases. Signed-off-by: Tormod Volden --- src/savage_dri.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/savage_dri.c b/src/savage_dri.c index e0b9f86..1c0ae70 100644 --- a/src/savage_dri.c +++ b/src/savage_dri.c @@ -922,7 +922,9 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen ) pDRIInfo->ddxDriverMinorVersion = SAVAGE_VERSION_MINOR; pDRIInfo->ddxDriverPatchVersion = SAVAGE_PATCHLEVEL; - pDRIInfo->frameBufferPhysicalAddress = (pointer)(uintptr_t) psav->FbRegion.base; + /* DRM cannot deal with multiple framebuffers, so only map aperture */ + pDRIInfo->dontMapFrameBuffer = 1; + pDRIInfo->frameBufferPhysicalAddress = NULL; pDRIInfo->frameBufferSize = psav->videoRambytes; pDRIInfo->frameBufferStride = pScrn->displayWidth*(pScrn->bitsPerPixel/8); pDRIInfo->ddxDrawableTableEntry = SAVAGE_MAX_DRAWABLES; @@ -1063,6 +1065,8 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen ) SAVAGEDRICloseScreen( pScreen ); return FALSE; } + /* use the first aperture as framebuffer */ + pDRIInfo->hFrameBuffer = pSAVAGEDRIServer->aperture.handle; if ( !SAVAGEDRIBuffersInit( pScreen ) ) { SAVAGEDRICloseScreen( pScreen ); -- 1.7.0.4