2005-07-01 10:56:12 +02:00
|
|
|
|
/*
|
|
|
|
|
* Copyright <EFBFBD> 2001 Keith Packard
|
|
|
|
|
*
|
|
|
|
|
* Partly based on code that is Copyright <EFBFBD> The XFree86 Project Inc.
|
|
|
|
|
*
|
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
|
* documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
|
* the above copyright notice appear in all copies and that both that
|
|
|
|
|
* copyright notice and this permission notice appear in supporting
|
|
|
|
|
* documentation, and that the name of Keith Packard not be used in
|
|
|
|
|
* advertising or publicity pertaining to distribution of the software without
|
|
|
|
|
* specific, written prior permission. Keith Packard makes no
|
|
|
|
|
* representations about the suitability of this software for any purpose. It
|
|
|
|
|
* is provided "as is" without express or implied warranty.
|
|
|
|
|
*
|
|
|
|
|
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
|
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
|
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
|
2006-02-16 01:14:11 +01:00
|
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
|
#include <dix-config.h>
|
2005-07-01 10:56:12 +02:00
|
|
|
|
#endif
|
2006-02-10 23:00:30 +01:00
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2006-02-02 21:09:14 +01:00
|
|
|
|
#include "exa_priv.h"
|
2005-07-03 09:02:09 +02:00
|
|
|
|
#include <X11/fonts/fontstruct.h>
|
2005-07-01 10:56:12 +02:00
|
|
|
|
#include "dixfontstr.h"
|
|
|
|
|
#include "exa.h"
|
2005-10-02 10:28:27 +02:00
|
|
|
|
#include "cw.h"
|
2005-07-01 10:56:12 +02:00
|
|
|
|
|
|
|
|
|
#if DEBUG_MIGRATE
|
|
|
|
|
#define DBG_MIGRATE(a) ErrorF a
|
|
|
|
|
#else
|
|
|
|
|
#define DBG_MIGRATE(a)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
|
|
|
|
|
{
|
|
|
|
|
PixmapPtr pPixmap = area->privData;
|
|
|
|
|
ExaScreenPriv (pScreen);
|
|
|
|
|
ExaPixmapPriv(pPixmap);
|
|
|
|
|
int dst_pitch, src_pitch, bytes;
|
|
|
|
|
char *dst, *src;
|
|
|
|
|
int i;
|
|
|
|
|
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
DBG_MIGRATE (("Save %p (%p) (%dx%d)\n",
|
2005-07-01 10:56:12 +02:00
|
|
|
|
(void*)pPixmap->drawable.id,
|
|
|
|
|
(void*)(ExaGetPixmapPriv(pPixmap)->area ?
|
|
|
|
|
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
|
|
|
|
|
pPixmap->drawable.width,
|
|
|
|
|
pPixmap->drawable.height));
|
|
|
|
|
|
|
|
|
|
src_pitch = pPixmap->devKind;
|
|
|
|
|
dst_pitch = pExaPixmap->devKind;
|
|
|
|
|
|
|
|
|
|
src = pPixmap->devPrivate.ptr;
|
|
|
|
|
dst = pExaPixmap->devPrivate.ptr;
|
|
|
|
|
|
2005-09-28 22:01:37 +02:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-07-01 10:56:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pPixmap->devKind = dst_pitch;
|
2005-11-06 17:40:59 +01:00
|
|
|
|
pPixmap->devPrivate.ptr = pExaPixmap->devPrivate.ptr;
|
2005-07-01 10:56:12 +02:00
|
|
|
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
|
|
|
|
pExaPixmap->area = NULL;
|
2005-10-15 04:19:09 +02:00
|
|
|
|
/* Mark it dirty now, to say that there is important data in the
|
|
|
|
|
* system-memory copy.
|
|
|
|
|
*/
|
|
|
|
|
pExaPixmap->dirty = TRUE;
|
2005-07-01 10:56:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
exaLog2(int val)
|
|
|
|
|
{
|
|
|
|
|
int bits;
|
|
|
|
|
|
|
|
|
|
if (!val)
|
|
|
|
|
return 0;
|
|
|
|
|
for (bits = 0; val != 0; bits++)
|
|
|
|
|
val >>= 1;
|
|
|
|
|
return bits - 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
|
exaPixmapAllocArea (PixmapPtr pPixmap)
|
|
|
|
|
{
|
|
|
|
|
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
|
|
|
|
ExaScreenPriv (pScreen);
|
|
|
|
|
ExaPixmapPriv (pPixmap);
|
|
|
|
|
int bpp = pPixmap->drawable.bitsPerPixel;
|
|
|
|
|
CARD16 h = pPixmap->drawable.height;
|
|
|
|
|
CARD16 w = pPixmap->drawable.width;
|
|
|
|
|
int pitch;
|
|
|
|
|
|
|
|
|
|
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
|
|
|
|
w = 1 << (exaLog2(w - 1) + 1);
|
2005-08-14 21:46:55 +02:00
|
|
|
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
|
|
|
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
2005-07-01 10:56:12 +02:00
|
|
|
|
|
2005-09-11 21:08:10 +02:00
|
|
|
|
pExaPixmap->size = pitch * h;
|
2005-07-01 10:56:12 +02:00
|
|
|
|
pExaPixmap->devKind = pPixmap->devKind;
|
|
|
|
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
|
|
|
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
2005-08-14 21:46:55 +02:00
|
|
|
|
pExaScr->info->card.pixmapOffsetAlign,
|
2005-07-01 10:56:12 +02:00
|
|
|
|
FALSE,
|
|
|
|
|
exaPixmapSave, (pointer) pPixmap);
|
|
|
|
|
if (!pExaPixmap->area)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
|
|
|
|
|
(ExaGetPixmapPriv(pPixmap)->area ?
|
|
|
|
|
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
|
|
|
|
|
pPixmap->drawable.width,
|
|
|
|
|
pPixmap->drawable.height));
|
2005-07-01 10:56:12 +02:00
|
|
|
|
pPixmap->devKind = pitch;
|
|
|
|
|
|
|
|
|
|
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
|
|
|
|
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
exaMoveInPixmap (PixmapPtr pPixmap)
|
|
|
|
|
{
|
|
|
|
|
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
|
|
|
|
ExaScreenPriv (pScreen);
|
|
|
|
|
ExaPixmapPriv (pPixmap);
|
|
|
|
|
int dst_pitch, src_pitch, bytes;
|
|
|
|
|
char *dst, *src;
|
|
|
|
|
int i;
|
|
|
|
|
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
|
|
|
|
|
(ExaGetPixmapPriv(pPixmap)->area ?
|
|
|
|
|
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
|
2005-07-01 10:56:12 +02:00
|
|
|
|
pPixmap->drawable.width,
|
|
|
|
|
pPixmap->drawable.height));
|
|
|
|
|
|
|
|
|
|
src = pPixmap->devPrivate.ptr;
|
|
|
|
|
src_pitch = pPixmap->devKind;
|
|
|
|
|
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
if (!exaPixmapAllocArea (pPixmap)) {
|
|
|
|
|
DBG_MIGRATE (("failed to allocate fb for pixmap %p (%dx%dx%d)\n",
|
|
|
|
|
(pointer)pPixmap,
|
|
|
|
|
pPixmap->drawable.width, pPixmap->drawable.height,
|
|
|
|
|
pPixmap->drawable.bitsPerPixel));
|
2005-07-01 10:56:12 +02:00
|
|
|
|
return;
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
}
|
2005-07-01 10:56:12 +02:00
|
|
|
|
|
2005-10-15 04:19:09 +02:00
|
|
|
|
/* If the "dirty" flag has never been set on the in-memory pixmap, then
|
|
|
|
|
* nothing has been written to it, so the contents are undefined and we can
|
|
|
|
|
* avoid the upload.
|
|
|
|
|
*/
|
|
|
|
|
if (!pExaPixmap->dirty) {
|
|
|
|
|
DBG_MIGRATE(("saved upload of %dx%d\n", pPixmap->drawable.width,
|
|
|
|
|
pPixmap->drawable.height));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-01 10:56:12 +02:00
|
|
|
|
pExaPixmap->dirty = FALSE;
|
|
|
|
|
|
|
|
|
|
if (pExaScr->info->accel.UploadToScreen)
|
|
|
|
|
{
|
2005-09-18 04:32:23 +02:00
|
|
|
|
if (pExaScr->info->accel.UploadToScreen(pPixmap, 0, 0,
|
|
|
|
|
pPixmap->drawable.width,
|
|
|
|
|
pPixmap->drawable.height,
|
|
|
|
|
src, src_pitch))
|
2005-07-01 10:56:12 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dst = pPixmap->devPrivate.ptr;
|
|
|
|
|
dst_pitch = pPixmap->devKind;
|
|
|
|
|
|
|
|
|
|
bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
|
|
|
|
|
|
|
|
|
|
exaWaitSync (pPixmap->drawable.pScreen);
|
|
|
|
|
|
|
|
|
|
i = pPixmap->drawable.height;
|
2005-07-01 15:30:29 +02:00
|
|
|
|
DBG_PIXMAP(("dst = %p, src = %p,(%d, %d) height = %d, mem_base = %p, offset = %d\n",
|
|
|
|
|
dst, src, dst_pitch, src_pitch,
|
|
|
|
|
i, pExaScr->info->card.memoryBase, ExaGetPixmapPriv(pPixmap)->area->offset));
|
2005-07-01 10:56:12 +02:00
|
|
|
|
|
|
|
|
|
while (i--) {
|
|
|
|
|
memcpy (dst, src, bytes);
|
|
|
|
|
dst += dst_pitch;
|
|
|
|
|
src += src_pitch;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-02 21:09:14 +01:00
|
|
|
|
void
|
2005-07-01 10:56:12 +02:00
|
|
|
|
exaMoveOutPixmap (PixmapPtr pPixmap)
|
|
|
|
|
{
|
|
|
|
|
ExaPixmapPriv (pPixmap);
|
|
|
|
|
ExaOffscreenArea *area = pExaPixmap->area;
|
|
|
|
|
|
|
|
|
|
DBG_MIGRATE (("<- 0x%p (0x%p) (%dx%d)\n",
|
|
|
|
|
(void*)pPixmap->drawable.id,
|
|
|
|
|
(void*)(ExaGetPixmapPriv(pPixmap)->area ?
|
|
|
|
|
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
|
|
|
|
|
pPixmap->drawable.width,
|
|
|
|
|
pPixmap->drawable.height));
|
|
|
|
|
if (area)
|
|
|
|
|
{
|
|
|
|
|
exaPixmapSave (pPixmap->drawable.pScreen, area);
|
|
|
|
|
exaOffscreenFree (pPixmap->drawable.pScreen, area);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
void
|
|
|
|
|
exaDrawableUseScreen(DrawablePtr pDrawable)
|
|
|
|
|
{
|
2006-02-02 22:07:06 +01:00
|
|
|
|
exaPixmapUseScreen (exaGetDrawablePixmap (pDrawable));
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
exaDrawableUseMemory(DrawablePtr pDrawable)
|
|
|
|
|
{
|
2006-02-02 22:07:06 +01:00
|
|
|
|
exaPixmapUseMemory (exaGetDrawablePixmap (pDrawable));
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-01 10:56:12 +02:00
|
|
|
|
void
|
|
|
|
|
exaPixmapUseScreen (PixmapPtr pPixmap)
|
|
|
|
|
{
|
|
|
|
|
ExaPixmapPriv (pPixmap);
|
|
|
|
|
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
if (pExaPixmap == NULL) {
|
|
|
|
|
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
(pointer)pPixmap,
|
|
|
|
|
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
|
2005-08-24 23:51:28 +02:00
|
|
|
|
return;
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
}
|
2005-08-24 23:51:28 +02:00
|
|
|
|
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) {
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
|
|
|
|
|
(pointer)pPixmap));
|
2005-07-01 10:56:12 +02:00
|
|
|
|
return;
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
}
|
|
|
|
|
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
DBG_MIGRATE(("UseScreen %p score %d\n",
|
|
|
|
|
(pointer)pPixmap, pExaPixmap->score));
|
2005-07-01 10:56:12 +02:00
|
|
|
|
|
|
|
|
|
if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
|
|
|
|
|
exaMoveInPixmap(pPixmap);
|
|
|
|
|
pExaPixmap->score = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
|
|
|
|
|
pExaPixmap->score++;
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
|
|
|
|
|
if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
|
|
|
|
|
!exaPixmapIsOffscreen(pPixmap))
|
|
|
|
|
{
|
|
|
|
|
exaMoveInPixmap (pPixmap);
|
2005-07-01 10:56:12 +02:00
|
|
|
|
}
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
|
2005-07-01 10:56:12 +02:00
|
|
|
|
ExaOffscreenMarkUsed (pPixmap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
exaPixmapUseMemory (PixmapPtr pPixmap)
|
|
|
|
|
{
|
|
|
|
|
ExaPixmapPriv (pPixmap);
|
|
|
|
|
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
if (pExaPixmap == NULL) {
|
|
|
|
|
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
(pointer)pPixmap,
|
|
|
|
|
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
|
2005-08-24 23:51:28 +02:00
|
|
|
|
return;
|
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
appears that we do need the cache flush here, thought it's not clear
why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
were being accumulated in from non-migratable scratch pixmaps, causing
the destination pixmap to move towards screen but the migration
necessary for source never to happen, leading to abysmal performance.
Instead, copy the scratch glyph data into a real pixmap first, then
composite from that into the destination, allowing for migration. time
ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
windows needing backing store. Makes migration code prettier, and
ensures that composited windows will be migrated as normal when we turn
off cw for EXA. (issue brought up by keithp)
2005-09-17 22:02:02 +02:00
|
|
|
|
}
|
|
|
|
|
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
DBG_MIGRATE(("UseMem: %p score %d\n", (pointer)pPixmap, pExaPixmap->score));
|
2005-08-24 23:51:28 +02:00
|
|
|
|
|
2005-07-01 10:56:12 +02:00
|
|
|
|
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT)
|
|
|
|
|
pExaPixmap->score = 0;
|
|
|
|
|
|
|
|
|
|
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
|
|
|
|
|
pExaPixmap->score--;
|
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
you got moved in. Instead, do the above-threshhold check separate from
score starting out less than max. While this will likely make thrashing
cases worse, I hope it will fix some issues with long term performance
(think of an xcompmgr with a backbuffer it's doing only accelerated
operations to. If some new pixmap comes in and bumps it out, even once,
it will never get a chance to re-migrate because its score will be
maxed). Change migration-out to be the same way for symmetry, though it
shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
completeness. The fallback debugging covers a lot more now, pointing
out new areas for improvement. Debugging toggles are now centralized in
exaPriv.h.
2005-09-21 12:27:53 +02:00
|
|
|
|
|
|
|
|
|
if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
|
|
|
|
|
exaMoveOutPixmap (pPixmap);
|
2005-07-01 10:56:12 +02:00
|
|
|
|
}
|