summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
Diffstat (limited to 'exa')
-rw-r--r--exa/exa.c23
-rw-r--r--exa/exa_classic.c4
-rw-r--r--exa/exa_driver.c4
-rw-r--r--exa/exa_mixed.c4
-rw-r--r--exa/exa_priv.h3
5 files changed, 29 insertions, 9 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 118a11098..fc15c2471 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -435,6 +435,29 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
(*pExaScr->info->FinishAccess) (pPixmap, i);
}
+
+/**
+ * Helper for things common to all schemes when a pixmap is destroyed
+ */
+void
+exaDestroyPixmap(PixmapPtr pPixmap)
+{
+ ExaScreenPriv(pPixmap->drawable.pScreen);
+ int i;
+
+ /* Finish access if it was prepared (e.g. pixmap created during
+ * software fallback)
+ */
+ for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) {
+ if (pExaScr->access[i].pixmap == pPixmap) {
+ exaFinishAccess(&pPixmap->drawable, i);
+ pExaScr->access[i].pixmap = NULL;
+ break;
+ }
+ }
+}
+
+
/**
* Here begins EXA's GC code.
* Do not ever access the fb/mi layer directly.
diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index 2cfeda5fa..169ce3aac 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -221,9 +221,7 @@ exaDestroyPixmap_classic (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
- /* During a fallback we must finish access, but we don't know the index. */
- if (pExaScr->fallback_counter)
- exaFinishAccess(&pPixmap->drawable, -1);
+ exaDestroyPixmap(pPixmap);
if (pExaPixmap->area)
{
diff --git a/exa/exa_driver.c b/exa/exa_driver.c
index abe79baad..a913cfb02 100644
--- a/exa/exa_driver.c
+++ b/exa/exa_driver.c
@@ -193,9 +193,7 @@ exaDestroyPixmap_driver (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
- /* During a fallback we must finish access, but we don't know the index. */
- if (pExaScr->fallback_counter)
- exaFinishAccess(&pPixmap->drawable, -1);
+ exaDestroyPixmap(pPixmap);
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index 7fa771d49..ef20eb502 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -245,9 +245,7 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
- /* During a fallback we must finish access, but we don't know the index. */
- if (pExaScr->fallback_counter)
- exaFinishAccess(&pPixmap->drawable, -1);
+ exaDestroyPixmap(pPixmap);
if (pExaScr->deferred_mixed_pixmap == pPixmap)
pExaScr->deferred_mixed_pixmap = NULL;
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 58d04b0de..e5d90d468 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -551,6 +551,9 @@ void
exaFinishAccess(DrawablePtr pDrawable, int index);
void
+exaDestroyPixmap(PixmapPtr pPixmap);
+
+void
exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
void