From a6dc81a0864f9ab2f6fc1aa31002c0191f674ceb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Oct 2007 12:37:19 -0700 Subject: Allow front/back/depth to move over the lifetime of the server. --- src/i830_driver.c | 16 ++++------------ src/i830_memory.c | 11 ++--------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/i830_driver.c b/src/i830_driver.c index abe70d72..339fe258 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -777,12 +777,8 @@ I830LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, } } -#if 0 -/* This code ended up unused, but will be at least a reference when we let the - * front buffer move. - */ static void -i830UpdateFrontOffset(ScrnInfoPtr pScrn) +i830_update_front_offset(ScrnInfoPtr pScrn) { ScreenPtr pScreen = pScrn->pScreen; I830Ptr pI830 = I830PTR(pScrn); @@ -820,11 +816,10 @@ i830CreateScreenResources(ScreenPtr pScreen) if (!(*pScreen->CreateScreenResources)(pScreen)) return FALSE; - i830UpdateFrontOffset(pScrn); + i830_update_front_offset(pScrn); return TRUE; } -#endif int i830_output_clones (ScrnInfoPtr pScrn, int type_mask) @@ -2867,10 +2862,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScreen->SaveScreen = xf86SaveScreen; pI830->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = I830CloseScreen; -#if 0 pI830->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = i830CreateScreenResources; -#endif if (!xf86CrtcScreenInit (pScreen)) return FALSE; @@ -3035,9 +3028,8 @@ I830EnterVT(int scrnIndex, int flags) i830_describe_allocations(pScrn, 1, ""); -#if 0 - i830UpdateFrontOffset(pScrn); -#endif + /* Update the screen pixmap in case the buffer moved */ + i830_update_front_offset(pScrn); if (i830_check_error_state(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, diff --git a/src/i830_memory.c b/src/i830_memory.c index 2ff1a0c2..4d55ca77 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -1087,11 +1087,7 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox, i830_memory *front_buffer = NULL; Bool tiling; - /* The front buffer is currently marked as NEED_LIFETIME_FIXED because - * DRIDoMappings is the only caller of the rm/add map functions, - * and it's only called at startup. This should be easily fixable. - */ - flags = NEED_LIFETIME_FIXED | ALLOW_SHARING; + flags = ALLOW_SHARING; /* Clear everything first. */ memset(FbMemBox, 0, sizeof(*FbMemBox)); @@ -1488,7 +1484,6 @@ i830_allocate_backbuffer(ScrnInfoPtr pScrn, i830_memory **buffer, *buffer = i830_allocate_memory_tiled(pScrn, name, size, pitch, GTT_PAGE_SIZE, ALIGN_BOTH_ENDS | - NEED_LIFETIME_FIXED | ALLOW_SHARING, TILE_XMAJOR); } @@ -1500,7 +1495,6 @@ i830_allocate_backbuffer(ScrnInfoPtr pScrn, i830_memory **buffer, size = ROUND_TO_PAGE(pitch * height); *buffer = i830_allocate_memory(pScrn, name, size, GTT_PAGE_SIZE, ALIGN_BOTH_ENDS | - NEED_LIFETIME_FIXED | ALLOW_SHARING); } @@ -1543,7 +1537,6 @@ i830_allocate_depthbuffer(ScrnInfoPtr pScrn) i830_allocate_memory_tiled(pScrn, "depth buffer", size, pitch, GTT_PAGE_SIZE, ALIGN_BOTH_ENDS | - NEED_LIFETIME_FIXED | ALLOW_SHARING, tile_format); } @@ -1555,7 +1548,7 @@ i830_allocate_depthbuffer(ScrnInfoPtr pScrn) size = ROUND_TO_PAGE(pitch * height); pI830->depth_buffer = i830_allocate_memory(pScrn, "depth buffer", size, GTT_PAGE_SIZE, - ALLOW_SHARING | NEED_LIFETIME_FIXED); + ALLOW_SHARING); } if (pI830->depth_buffer == NULL) { -- cgit v1.2.3