summaryrefslogtreecommitdiff
path: root/uxa/uxa.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-08-25 12:56:43 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-08 13:33:37 +0100
commit2b96c18165d713cd6781dbf217ec33e11cc961bc (patch)
tree92b4c9b3b0fa31e0ec20b6ac348011de9ea59df2 /uxa/uxa.c
parent0fa4321a765126228170ecb9536f32c134886d51 (diff)
Enable a shadow buffer and disable GPU acceleration.
An attempt to workaround the incoherency in gen2 chipsets, we avoid using dynamic reallocation as much as possible. The first step is to disable allocation of pixmaps using GEM and simply create them in system memory without a backing buffer object. This forces all rendering to use S/W fallbacks. The second step is to allocate a shadow front buffer and assign that to the Screen pixmap. This ensure that the front buffer remains in the GTT and pinned for scanout. The shadow buffer will be rendered to in the normal fashion via the Screen pixmap, and be marked dirty. In the block handler, the dirty shadow buffer is then blitted (using the GPU) over the front buffer. This should completely avoid having to move pages around in the GTT and avoid incurring the wrath of those early chipsets. Secondly, performance should be reasonable as we avoid the ping-pong caused by the small aperture and weak GPU forcing software fallbacks. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'uxa/uxa.c')
-rw-r--r--uxa/uxa.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/uxa/uxa.c b/uxa/uxa.c
index 4a5907e8..3c81a851 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -385,12 +385,15 @@ static Bool uxa_close_screen(int i, ScreenPtr pScreen)
uxa_glyphs_fini(pScreen);
- /* Destroy the pixmap created by miScreenInit() *before* chaining up as
- * we finalize ourselves here and so this is the last chance we have of
- * releasing our resources associated with the Pixmap. So do it first.
- */
- (void) (*pScreen->DestroyPixmap) (pScreen->devPrivate);
- pScreen->devPrivate = NULL;
+ if (pScreen->devPrivate) {
+ /* Destroy the pixmap created by miScreenInit() *before*
+ * chaining up as we finalize ourselves here and so this
+ * is the last chance we have of releasing our resources
+ * associated with the Pixmap. So do it first.
+ */
+ (void) (*pScreen->DestroyPixmap) (pScreen->devPrivate);
+ pScreen->devPrivate = NULL;
+ }
pScreen->CreateGC = uxa_screen->SavedCreateGC;
pScreen->CloseScreen = uxa_screen->SavedCloseScreen;