summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-09-28 20:01:37 +0000
committerEric Anholt <anholt@freebsd.org>2005-09-28 20:01:37 +0000
commit58abce3f90504dd48838a2f7ae7bb5db6a6cff70 (patch)
treea953aead1ef0743604dee8ccaad7073432e17c6f
parentf53404bdbba23fd46420564565ab815f7c20b101 (diff)
- Use the dirty flag (which should be set correctly all the time,
particularly thanks to Prepare/FinishAccess) to avoid DFS/memcpy on pixmap move-out if it's unnecessary. This was disabled in KAA because cache misuse on ATI made me guess that this code was wrong. - Unwrap Glyphs on closescreen.
-rw-r--r--exa/exa.c55
-rw-r--r--exa/exa_accel.c55
-rw-r--r--exa/exa_migration.c55
-rw-r--r--exa/exa_priv.h4
-rw-r--r--hw/xfree86/exa/exa.c55
-rw-r--r--hw/xfree86/exa/exaPriv.h4
-rw-r--r--hw/xfree86/exa/exa_accel.c55
-rw-r--r--hw/xfree86/exa/exa_migration.c55
-rw-r--r--hw/xfree86/exa/exa_priv.h4
9 files changed, 150 insertions, 192 deletions
diff --git a/exa/exa.c b/exa/exa.c
index c8c388917..53301c949 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -130,44 +130,34 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
src = pPixmap->devPrivate.ptr;
dst = pExaPixmap->devPrivate.ptr;
- if (pExaScr->info->accel.DownloadFromScreen)
- {
- if (pExaScr->info->accel.DownloadFromScreen(pPixmap,
- pPixmap->drawable.x,
- pPixmap->drawable.y,
- pPixmap->drawable.width,
- pPixmap->drawable.height,
- dst,
- dst_pitch)) {
-
- pPixmap->devKind = dst_pitch;
- pPixmap->devPrivate.ptr = dst;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pExaPixmap->area = NULL;
- return;
- }
+ if (pExaPixmap->dirty) {
+ if (pExaScr->info->accel.DownloadFromScreen &&
+ (*pExaScr->info->accel.DownloadFromScreen) (pPixmap,
+ pPixmap->drawable.x,
+ pPixmap->drawable.y,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ dst,
+ dst_pitch)) {
+
+ } else {
+ exaWaitSync (pPixmap->drawable.pScreen);
+
+ bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
+
+ i = pPixmap->drawable.height;
+ while (i--) {
+ memcpy (dst, src, bytes);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
}
pPixmap->devKind = dst_pitch;
pPixmap->devPrivate.ptr = dst;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pExaPixmap->area = NULL;
-
-#if 0
- if (!pExaPixmap->dirty)
- return;
-#endif
-
- exaWaitSync (pPixmap->drawable.pScreen);
-
- bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
-
- i = pPixmap->drawable.height;
- while (i--) {
- memcpy (dst, src, bytes);
- dst += dst_pitch;
- src += src_pitch;
- }
}
static int
@@ -1360,6 +1350,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
+ ps->Glyphs = pExaScr->SavedGlyphs;
}
#endif
if (pExaScr->wrappedEnableDisableFB)
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index c8c388917..53301c949 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -130,44 +130,34 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
src = pPixmap->devPrivate.ptr;
dst = pExaPixmap->devPrivate.ptr;
- if (pExaScr->info->accel.DownloadFromScreen)
- {
- if (pExaScr->info->accel.DownloadFromScreen(pPixmap,
- pPixmap->drawable.x,
- pPixmap->drawable.y,
- pPixmap->drawable.width,
- pPixmap->drawable.height,
- dst,
- dst_pitch)) {
-
- pPixmap->devKind = dst_pitch;
- pPixmap->devPrivate.ptr = dst;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pExaPixmap->area = NULL;
- return;
- }
+ if (pExaPixmap->dirty) {
+ if (pExaScr->info->accel.DownloadFromScreen &&
+ (*pExaScr->info->accel.DownloadFromScreen) (pPixmap,
+ pPixmap->drawable.x,
+ pPixmap->drawable.y,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ dst,
+ dst_pitch)) {
+
+ } else {
+ exaWaitSync (pPixmap->drawable.pScreen);
+
+ bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
+
+ i = pPixmap->drawable.height;
+ while (i--) {
+ memcpy (dst, src, bytes);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
}
pPixmap->devKind = dst_pitch;
pPixmap->devPrivate.ptr = dst;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pExaPixmap->area = NULL;
-
-#if 0
- if (!pExaPixmap->dirty)
- return;
-#endif
-
- exaWaitSync (pPixmap->drawable.pScreen);
-
- bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
-
- i = pPixmap->drawable.height;
- while (i--) {
- memcpy (dst, src, bytes);
- dst += dst_pitch;
- src += src_pitch;
- }
}
static int
@@ -1360,6 +1350,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
+ ps->Glyphs = pExaScr->SavedGlyphs;
}
#endif
if (pExaScr->wrappedEnableDisableFB)
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index c8c388917..53301c949 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -130,44 +130,34 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
src = pPixmap->devPrivate.ptr;
dst = pExaPixmap->devPrivate.ptr;
- if (pExaScr->info->accel.DownloadFromScreen)
- {
- if (pExaScr->info->accel.DownloadFromScreen(pPixmap,
- pPixmap->drawable.x,
- pPixmap->drawable.y,
- pPixmap->drawable.width,
- pPixmap->drawable.height,
- dst,
- dst_pitch)) {
-
- pPixmap->devKind = dst_pitch;
- pPixmap->devPrivate.ptr = dst;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pExaPixmap->area = NULL;
- return;
- }
+ if (pExaPixmap->dirty) {
+ if (pExaScr->info->accel.DownloadFromScreen &&
+ (*pExaScr->info->accel.DownloadFromScreen) (pPixmap,
+ pPixmap->drawable.x,
+ pPixmap->drawable.y,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ dst,
+ dst_pitch)) {
+
+ } else {
+ exaWaitSync (pPixmap->drawable.pScreen);
+
+ bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
+
+ i = pPixmap->drawable.height;
+ while (i--) {
+ memcpy (dst, src, bytes);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
}
pPixmap->devKind = dst_pitch;
pPixmap->devPrivate.ptr = dst;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pExaPixmap->area = NULL;
-
-#if 0
- if (!pExaPixmap->dirty)
- return;
-#endif
-
- exaWaitSync (pPixmap->drawable.pScreen);
-
- bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
-
- i = pPixmap->drawable.height;
- while (i--) {
- memcpy (dst, src, bytes);
- dst += dst_pitch;
- src += src_pitch;
- }
}
static int
@@ -1360,6 +1350,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
+ ps->Glyphs = pExaScr->SavedGlyphs;
}
#endif
if (pExaScr->wrappedEnableDisableFB)
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index ca1cdb110..db83d1b32 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -118,6 +118,10 @@ typedef struct {
int score;
int devKind;
DevUnion devPrivate;
+
+ /* True if the in-screen copy has been modified compared to the
+ * system-memory copy.
+ */
Bool dirty;
unsigned int size;
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
diff --git a/hw/xfree86/exa/exa.c b/hw/xfree86/exa/exa.c
index c8c388917..53301c949 100644
--- a/hw/xfree86/exa/exa.c
+++ b/hw/xfree86/exa/exa.c
@@ -130,44 +130,34 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
src = pPixmap->devPrivate.ptr;
dst = pExaPixmap->devPrivate.ptr;
- if (pExaScr->info->accel.DownloadFromScreen)
- {
- if (pExaScr->info->accel.DownloadFromScreen(pPixmap,
- pPixmap->drawable.x,
- pPixmap->drawable.y,
- pPixmap->drawable.width,
- pPixmap->drawable.height,
- dst,
- dst_pitch)) {
-
- pPixmap->devKind = dst_pitch;
- pPixmap->devPrivate.ptr = dst;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pExaPixmap->area = NULL;
- return;
- }
+ if (pExaPixmap->dirty) {
+ if (pExaScr->info->accel.DownloadFromScreen &&
+ (*pExaScr->info->accel.DownloadFromScreen) (pPixmap,
+ pPixmap->drawable.x,
+ pPixmap->drawable.y,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ dst,
+ dst_pitch)) {
+
+ } else {
+ exaWaitSync (pPixmap->drawable.pScreen);
+
+ bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
+
+ i = pPixmap->drawable.height;
+ while (i--) {
+ memcpy (dst, src, bytes);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
}
pPixmap->devKind = dst_pitch;
pPixmap->devPrivate.ptr = dst;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pExaPixmap->area = NULL;
-
-#if 0
- if (!pExaPixmap->dirty)
- return;
-#endif
-
- exaWaitSync (pPixmap->drawable.pScreen);
-
- bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
-
- i = pPixmap->drawable.height;
- while (i--) {
- memcpy (dst, src, bytes);
- dst += dst_pitch;
- src += src_pitch;
- }
}
static int
@@ -1360,6 +1350,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
+ ps->Glyphs = pExaScr->SavedGlyphs;
}
#endif
if (pExaScr->wrappedEnableDisableFB)
diff --git a/hw/xfree86/exa/exaPriv.h b/hw/xfree86/exa/exaPriv.h
index ca1cdb110..db83d1b32 100644
--- a/hw/xfree86/exa/exaPriv.h
+++ b/hw/xfree86/exa/exaPriv.h
@@ -118,6 +118,10 @@ typedef struct {
int score;
int devKind;
DevUnion devPrivate;
+
+ /* True if the in-screen copy has been modified compared to the
+ * system-memory copy.
+ */
Bool dirty;
unsigned int size;
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
diff --git a/hw/xfree86/exa/exa_accel.c b/hw/xfree86/exa/exa_accel.c
index c8c388917..53301c949 100644
--- a/hw/xfree86/exa/exa_accel.c
+++ b/hw/xfree86/exa/exa_accel.c
@@ -130,44 +130,34 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
src = pPixmap->devPrivate.ptr;
dst = pExaPixmap->devPrivate.ptr;
- if (pExaScr->info->accel.DownloadFromScreen)
- {
- if (pExaScr->info->accel.DownloadFromScreen(pPixmap,
- pPixmap->drawable.x,
- pPixmap->drawable.y,
- pPixmap->drawable.width,
- pPixmap->drawable.height,
- dst,
- dst_pitch)) {
-
- pPixmap->devKind = dst_pitch;
- pPixmap->devPrivate.ptr = dst;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pExaPixmap->area = NULL;
- return;
- }
+ if (pExaPixmap->dirty) {
+ if (pExaScr->info->accel.DownloadFromScreen &&
+ (*pExaScr->info->accel.DownloadFromScreen) (pPixmap,
+ pPixmap->drawable.x,
+ pPixmap->drawable.y,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ dst,
+ dst_pitch)) {
+
+ } else {
+ exaWaitSync (pPixmap->drawable.pScreen);
+
+ bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
+
+ i = pPixmap->drawable.height;
+ while (i--) {
+ memcpy (dst, src, bytes);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
}
pPixmap->devKind = dst_pitch;
pPixmap->devPrivate.ptr = dst;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pExaPixmap->area = NULL;
-
-#if 0
- if (!pExaPixmap->dirty)
- return;
-#endif
-
- exaWaitSync (pPixmap->drawable.pScreen);
-
- bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
-
- i = pPixmap->drawable.height;
- while (i--) {
- memcpy (dst, src, bytes);
- dst += dst_pitch;
- src += src_pitch;
- }
}
static int
@@ -1360,6 +1350,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
+ ps->Glyphs = pExaScr->SavedGlyphs;
}
#endif
if (pExaScr->wrappedEnableDisableFB)
diff --git a/hw/xfree86/exa/exa_migration.c b/hw/xfree86/exa/exa_migration.c
index c8c388917..53301c949 100644
--- a/hw/xfree86/exa/exa_migration.c
+++ b/hw/xfree86/exa/exa_migration.c
@@ -130,44 +130,34 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
src = pPixmap->devPrivate.ptr;
dst = pExaPixmap->devPrivate.ptr;
- if (pExaScr->info->accel.DownloadFromScreen)
- {
- if (pExaScr->info->accel.DownloadFromScreen(pPixmap,
- pPixmap->drawable.x,
- pPixmap->drawable.y,
- pPixmap->drawable.width,
- pPixmap->drawable.height,
- dst,
- dst_pitch)) {
-
- pPixmap->devKind = dst_pitch;
- pPixmap->devPrivate.ptr = dst;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pExaPixmap->area = NULL;
- return;
- }
+ if (pExaPixmap->dirty) {
+ if (pExaScr->info->accel.DownloadFromScreen &&
+ (*pExaScr->info->accel.DownloadFromScreen) (pPixmap,
+ pPixmap->drawable.x,
+ pPixmap->drawable.y,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ dst,
+ dst_pitch)) {
+
+ } else {
+ exaWaitSync (pPixmap->drawable.pScreen);
+
+ bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
+
+ i = pPixmap->drawable.height;
+ while (i--) {
+ memcpy (dst, src, bytes);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
}
pPixmap->devKind = dst_pitch;
pPixmap->devPrivate.ptr = dst;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pExaPixmap->area = NULL;
-
-#if 0
- if (!pExaPixmap->dirty)
- return;
-#endif
-
- exaWaitSync (pPixmap->drawable.pScreen);
-
- bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
-
- i = pPixmap->drawable.height;
- while (i--) {
- memcpy (dst, src, bytes);
- dst += dst_pitch;
- src += src_pitch;
- }
}
static int
@@ -1360,6 +1350,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
+ ps->Glyphs = pExaScr->SavedGlyphs;
}
#endif
if (pExaScr->wrappedEnableDisableFB)
diff --git a/hw/xfree86/exa/exa_priv.h b/hw/xfree86/exa/exa_priv.h
index ca1cdb110..db83d1b32 100644
--- a/hw/xfree86/exa/exa_priv.h
+++ b/hw/xfree86/exa/exa_priv.h
@@ -118,6 +118,10 @@ typedef struct {
int score;
int devKind;
DevUnion devPrivate;
+
+ /* True if the in-screen copy has been modified compared to the
+ * system-memory copy.
+ */
Bool dirty;
unsigned int size;
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;