summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-09-18 02:32:23 +0000
committerEric Anholt <anholt@freebsd.org>2005-09-18 02:32:23 +0000
commita1bcf25a1f819768672ac837cb0a3d0c66937656 (patch)
treee5f7e4c46976a8e0f26c334e6ccd218be1bdf6b8
parent074913c8a9c1f66c8752387db2c81ad669e91878 (diff)
Break EXA ABI while we still can. Add coordinates to the UploadToScreen
hook so we can upload a subset of a pixmap, and convert the current drivers to respect that. Use this support to directly UploadToScreen in exaGlyphs, providing a 47.4% +/-2.4% decrease in wall time for ls -lR programs/Xserver in an antialiased gnome-terminal on an M6 (n=3, caches hot). I would have bumped major version, only I can't tell what the EXA_VERSION_* is supposed to be doing as opposed to the module version.
-rw-r--r--exa/exa.c5
-rw-r--r--exa/exa.h4
-rw-r--r--exa/exa_accel.c5
-rw-r--r--exa/exa_migration.c5
-rw-r--r--exa/exa_render.c23
-rw-r--r--hw/xfree86/exa/exa.c5
-rw-r--r--hw/xfree86/exa/exa.h4
-rw-r--r--hw/xfree86/exa/exa_accel.c5
-rw-r--r--hw/xfree86/exa/exa_migration.c5
-rw-r--r--hw/xfree86/exa/exa_render.c23
-rw-r--r--hw/xfree86/exa/exapict.c23
11 files changed, 77 insertions, 30 deletions
diff --git a/exa/exa.c b/exa/exa.c
index e3e4ecfcf..8ba5dc6a8 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -250,7 +250,10 @@ exaMoveInPixmap (PixmapPtr pPixmap)
if (pExaScr->info->accel.UploadToScreen)
{
- if (pExaScr->info->accel.UploadToScreen(pPixmap, src, src_pitch))
+ if (pExaScr->info->accel.UploadToScreen(pPixmap, 0, 0,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ src, src_pitch))
return;
}
diff --git a/exa/exa.h b/exa/exa.h
index 5e850a3cf..9e2edcafd 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -153,6 +153,10 @@ typedef struct _ExaAccelInfo {
* in-framebuffer pDst beginning at x,y and of width w,h. May fail.
*/
Bool (*UploadToScreen) (PixmapPtr pDst,
+ int x,
+ int y,
+ int w,
+ int h,
char *src,
int src_pitch);
Bool (*UploadToScratch) (PixmapPtr pSrc,
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index e3e4ecfcf..8ba5dc6a8 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -250,7 +250,10 @@ exaMoveInPixmap (PixmapPtr pPixmap)
if (pExaScr->info->accel.UploadToScreen)
{
- if (pExaScr->info->accel.UploadToScreen(pPixmap, src, src_pitch))
+ if (pExaScr->info->accel.UploadToScreen(pPixmap, 0, 0,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ src, src_pitch))
return;
}
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index e3e4ecfcf..8ba5dc6a8 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -250,7 +250,10 @@ exaMoveInPixmap (PixmapPtr pPixmap)
if (pExaScr->info->accel.UploadToScreen)
{
- if (pExaScr->info->accel.UploadToScreen(pPixmap, src, src_pitch))
+ if (pExaScr->info->accel.UploadToScreen(pPixmap, 0, 0,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ src, src_pitch))
return;
}
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 453e6e84a..c1d6fa63e 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -692,19 +692,26 @@ exaGlyphs (CARD8 op,
glyph = *glyphs++;
(*pScreen->ModifyPixmapHeader) (pScratchPixmap,
- glyph->info.width, glyph->info.height,
+ glyph->info.width,
+ glyph->info.height,
0, 0, -1, (pointer) (glyph + 1));
pScratchPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
/* Copy the glyph data into the proper pixmap instead of a fake.
- * We ought to make exaCopyNtoN (the guts of exaCopyArea) handle
- * uploads from memory to screen using UploadToScreen, which will
- * be the steady state for this.
+ * First we try to use UploadToScreen, if we can, then we fall back
+ * to a plain exaCopyArea in case of failure.
*/
- (*pGC->ops->CopyArea) (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
- 0, 0, glyph->info.width, glyph->info.height, 0, 0);
- /*exaCopyArea (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
- 0, 0, glyph->info.width, glyph->info.height, 0, 0);*/
+ if (!pExaScr->info->accel.UploadToScreen ||
+ !exaPixmapIsOffscreen(pPixmap) ||
+ !(*pExaScr->info->accel.UploadToScreen) (pPixmap, 0, 0,
+ glyph->info.width,
+ glyph->info.height,
+ pScratchPixmap->devPrivate.ptr,
+ pScratchPixmap->devKind))
+ {
+ exaCopyArea (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
+ 0, 0, glyph->info.width, glyph->info.height, 0, 0);
+ }
if (maskFormat)
{
diff --git a/hw/xfree86/exa/exa.c b/hw/xfree86/exa/exa.c
index e3e4ecfcf..8ba5dc6a8 100644
--- a/hw/xfree86/exa/exa.c
+++ b/hw/xfree86/exa/exa.c
@@ -250,7 +250,10 @@ exaMoveInPixmap (PixmapPtr pPixmap)
if (pExaScr->info->accel.UploadToScreen)
{
- if (pExaScr->info->accel.UploadToScreen(pPixmap, src, src_pitch))
+ if (pExaScr->info->accel.UploadToScreen(pPixmap, 0, 0,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ src, src_pitch))
return;
}
diff --git a/hw/xfree86/exa/exa.h b/hw/xfree86/exa/exa.h
index 5e850a3cf..9e2edcafd 100644
--- a/hw/xfree86/exa/exa.h
+++ b/hw/xfree86/exa/exa.h
@@ -153,6 +153,10 @@ typedef struct _ExaAccelInfo {
* in-framebuffer pDst beginning at x,y and of width w,h. May fail.
*/
Bool (*UploadToScreen) (PixmapPtr pDst,
+ int x,
+ int y,
+ int w,
+ int h,
char *src,
int src_pitch);
Bool (*UploadToScratch) (PixmapPtr pSrc,
diff --git a/hw/xfree86/exa/exa_accel.c b/hw/xfree86/exa/exa_accel.c
index e3e4ecfcf..8ba5dc6a8 100644
--- a/hw/xfree86/exa/exa_accel.c
+++ b/hw/xfree86/exa/exa_accel.c
@@ -250,7 +250,10 @@ exaMoveInPixmap (PixmapPtr pPixmap)
if (pExaScr->info->accel.UploadToScreen)
{
- if (pExaScr->info->accel.UploadToScreen(pPixmap, src, src_pitch))
+ if (pExaScr->info->accel.UploadToScreen(pPixmap, 0, 0,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ src, src_pitch))
return;
}
diff --git a/hw/xfree86/exa/exa_migration.c b/hw/xfree86/exa/exa_migration.c
index e3e4ecfcf..8ba5dc6a8 100644
--- a/hw/xfree86/exa/exa_migration.c
+++ b/hw/xfree86/exa/exa_migration.c
@@ -250,7 +250,10 @@ exaMoveInPixmap (PixmapPtr pPixmap)
if (pExaScr->info->accel.UploadToScreen)
{
- if (pExaScr->info->accel.UploadToScreen(pPixmap, src, src_pitch))
+ if (pExaScr->info->accel.UploadToScreen(pPixmap, 0, 0,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ src, src_pitch))
return;
}
diff --git a/hw/xfree86/exa/exa_render.c b/hw/xfree86/exa/exa_render.c
index 453e6e84a..c1d6fa63e 100644
--- a/hw/xfree86/exa/exa_render.c
+++ b/hw/xfree86/exa/exa_render.c
@@ -692,19 +692,26 @@ exaGlyphs (CARD8 op,
glyph = *glyphs++;
(*pScreen->ModifyPixmapHeader) (pScratchPixmap,
- glyph->info.width, glyph->info.height,
+ glyph->info.width,
+ glyph->info.height,
0, 0, -1, (pointer) (glyph + 1));
pScratchPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
/* Copy the glyph data into the proper pixmap instead of a fake.
- * We ought to make exaCopyNtoN (the guts of exaCopyArea) handle
- * uploads from memory to screen using UploadToScreen, which will
- * be the steady state for this.
+ * First we try to use UploadToScreen, if we can, then we fall back
+ * to a plain exaCopyArea in case of failure.
*/
- (*pGC->ops->CopyArea) (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
- 0, 0, glyph->info.width, glyph->info.height, 0, 0);
- /*exaCopyArea (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
- 0, 0, glyph->info.width, glyph->info.height, 0, 0);*/
+ if (!pExaScr->info->accel.UploadToScreen ||
+ !exaPixmapIsOffscreen(pPixmap) ||
+ !(*pExaScr->info->accel.UploadToScreen) (pPixmap, 0, 0,
+ glyph->info.width,
+ glyph->info.height,
+ pScratchPixmap->devPrivate.ptr,
+ pScratchPixmap->devKind))
+ {
+ exaCopyArea (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
+ 0, 0, glyph->info.width, glyph->info.height, 0, 0);
+ }
if (maskFormat)
{
diff --git a/hw/xfree86/exa/exapict.c b/hw/xfree86/exa/exapict.c
index 453e6e84a..c1d6fa63e 100644
--- a/hw/xfree86/exa/exapict.c
+++ b/hw/xfree86/exa/exapict.c
@@ -692,19 +692,26 @@ exaGlyphs (CARD8 op,
glyph = *glyphs++;
(*pScreen->ModifyPixmapHeader) (pScratchPixmap,
- glyph->info.width, glyph->info.height,
+ glyph->info.width,
+ glyph->info.height,
0, 0, -1, (pointer) (glyph + 1));
pScratchPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
/* Copy the glyph data into the proper pixmap instead of a fake.
- * We ought to make exaCopyNtoN (the guts of exaCopyArea) handle
- * uploads from memory to screen using UploadToScreen, which will
- * be the steady state for this.
+ * First we try to use UploadToScreen, if we can, then we fall back
+ * to a plain exaCopyArea in case of failure.
*/
- (*pGC->ops->CopyArea) (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
- 0, 0, glyph->info.width, glyph->info.height, 0, 0);
- /*exaCopyArea (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
- 0, 0, glyph->info.width, glyph->info.height, 0, 0);*/
+ if (!pExaScr->info->accel.UploadToScreen ||
+ !exaPixmapIsOffscreen(pPixmap) ||
+ !(*pExaScr->info->accel.UploadToScreen) (pPixmap, 0, 0,
+ glyph->info.width,
+ glyph->info.height,
+ pScratchPixmap->devPrivate.ptr,
+ pScratchPixmap->devKind))
+ {
+ exaCopyArea (&pScratchPixmap->drawable, &pPixmap->drawable, pGC,
+ 0, 0, glyph->info.width, glyph->info.height, 0, 0);
+ }
if (maskFormat)
{