summaryrefslogtreecommitdiff
path: root/uxa
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
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')
-rw-r--r--uxa/uxa-glyphs.c27
-rw-r--r--uxa/uxa.c15
2 files changed, 25 insertions, 17 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 8c00e900..ad4f3877 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -197,13 +197,6 @@ bail:
Bool uxa_glyphs_init(ScreenPtr pScreen)
{
- /* We are trying to initialise per screen resources prior to the
- * complete initialisation of the screen. So ensure the components
- * that we depend upon are initialsed prior to our use.
- */
- if (!CreateScratchPixmapsForScreen(pScreen->myNum))
- return FALSE;
-
#if HAS_DIXREGISTERPRIVATEKEY
if (!dixRegisterPrivateKey(&uxa_glyph_key, PRIVATE_GLYPH, 0))
return FALSE;
@@ -212,6 +205,17 @@ Bool uxa_glyphs_init(ScreenPtr pScreen)
return FALSE;
#endif
+ /* Skip pixmap creation if we don't intend to use it. */
+ if (uxa_get_screen(pScreen)->force_fallback)
+ return TRUE;
+
+ /* We are trying to initialise per screen resources prior to the
+ * complete initialisation of the screen. So ensure the components
+ * that we depend upon are initialsed prior to our use.
+ */
+ if (!CreateScratchPixmapsForScreen(pScreen->myNum))
+ return FALSE;
+
if (!uxa_realize_glyph_caches(pScreen))
return FALSE;
@@ -293,18 +297,19 @@ uxa_glyph_cache_upload_glyph(ScreenPtr screen,
}
void
-uxa_glyph_unrealize(ScreenPtr pScreen,
- GlyphPtr pGlyph)
+uxa_glyph_unrealize(ScreenPtr screen,
+ GlyphPtr glyph)
{
struct uxa_glyph *priv;
- priv = uxa_glyph_get_private(pGlyph);
+ /* Use Lookup in case we have not attached to this glyph. */
+ priv = dixLookupPrivate(&glyph->devPrivates, &uxa_glyph_key);
if (priv == NULL)
return;
priv->cache->glyphs[priv->pos] = NULL;
- uxa_glyph_set_private(pGlyph, NULL);
+ uxa_glyph_set_private(glyph, NULL);
free(priv);
}
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;