Add a pair of hooks, PrepareAccess() and FinishAccess(), which get called
around CPU access to the framebuffer. This allows the hardware to set up swappers to deal with endianness, or to tell EXA to move the pixmap out to framebuffer if insufficient swappers are available (note: must not fail on front buffer!). Submitted by: benh
This commit is contained in:
parent
ca210830bd
commit
1c003ccf5d
105
exa/exa.c
105
exa/exa.c
|
@ -78,6 +78,21 @@ exaGetPixmapPitch(PixmapPtr pPix)
|
||||||
return pPix->devKind;
|
return pPix->devKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Returns the size in bytes of the given pixmap in
|
||||||
|
* video memory. Only valid when the vram storage has been
|
||||||
|
* allocated
|
||||||
|
*/
|
||||||
|
unsigned long
|
||||||
|
exaGetPixmapSize(PixmapPtr pPix)
|
||||||
|
{
|
||||||
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
|
||||||
|
pExaPixmap = ExaGetPixmapPriv(pPix);
|
||||||
|
if (pExaPixmap != NULL)
|
||||||
|
return pExaPixmap->size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty (DrawablePtr pDrawable)
|
exaDrawableDirty (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
|
@ -185,6 +200,7 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
|
pExaPixmap->size = pitch * h;
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
|
@ -439,6 +455,7 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
STRACE;
|
STRACE;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
else
|
else
|
||||||
|
@ -446,6 +463,57 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
return exaPixmapIsOffscreen (pPixmap);
|
return exaPixmapIsOffscreen (pPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
|
||||||
|
if (index == EXA_PREPARE_DEST)
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
|
if (exaPixmapIsOffscreen (pPixmap))
|
||||||
|
exaWaitSync (pDrawable->pScreen);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.PrepareAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
|
||||||
|
ExaPixmapPriv (pPixmap);
|
||||||
|
assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
|
||||||
|
exaMoveOutPixmap (pPixmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.FinishAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
if (!exaPixmapIsOffscreen (pPixmap))
|
||||||
|
return;
|
||||||
|
|
||||||
|
(*pExaScr->info->accel.FinishAccess) (pPixmap, index);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
exaFillTiled(int dst_x,
|
exaFillTiled(int dst_x,
|
||||||
|
@ -620,10 +688,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
goto fallback;
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
|
||||||
bitplane, closure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If either drawable is already in framebuffer, try to get both of them
|
/* If either drawable is already in framebuffer, try to get both of them
|
||||||
|
@ -664,15 +729,18 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
||||||
exaMarkSync(pDstDrawable->pScreen);
|
exaMarkSync(pDstDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDstDrawable);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
fallback:
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
||||||
bitplane, closure);
|
pbox, nbox, dx, dy, reverse, upsidedown,
|
||||||
}
|
bitplane, closure);
|
||||||
exaDrawableDirty (pDstDrawable);
|
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -822,12 +890,12 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
||||||
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
||||||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
||||||
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
||||||
fbAnd (GXcopy, fg, pm),
|
fbAnd (GXcopy, fg, pm),
|
||||||
fbXor (GXcopy, fg, pm));
|
fbXor (GXcopy, fg, pm));
|
||||||
exaDrawableDirty (pDrawable);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
||||||
|
@ -949,8 +1017,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
opaque = FALSE;
|
opaque = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
|
|
||||||
ppci = ppciInit;
|
ppci = ppciInit;
|
||||||
while (nglyph--)
|
while (nglyph--)
|
||||||
|
@ -996,6 +1063,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
x += pci->metrics.characterWidth;
|
x += pci->metrics.characterWidth;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GCOps exaOps = {
|
static const GCOps exaOps = {
|
||||||
|
@ -1121,14 +1189,15 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
||||||
exaMarkSync(pDrawable->pScreen);
|
exaMarkSync(pDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fbFillRegionSolid (pDrawable, pRegion, 0,
|
fbFillRegionSolid (pDrawable, pRegion, 0,
|
||||||
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
21
exa/exa.h
21
exa/exa.h
|
@ -175,6 +175,24 @@ typedef struct _ExaAccelInfo {
|
||||||
*/
|
*/
|
||||||
int (*MarkSync) (ScreenPtr pScreen);
|
int (*MarkSync) (ScreenPtr pScreen);
|
||||||
void (*WaitMarker) (ScreenPtr pScreen, int marker);
|
void (*WaitMarker) (ScreenPtr pScreen, int marker);
|
||||||
|
|
||||||
|
/* These are wrapping all fb or composite operations that will cause
|
||||||
|
* a direct access to the framebuffer. You can use them to update
|
||||||
|
* endian swappers, force migration to RAM, or whatever else you find
|
||||||
|
* useful at this point. EXA can stack up to 3 calls to Prepare/Finish
|
||||||
|
* access, though they will have a different index. If your hardware
|
||||||
|
* doesn't have enough separate configurable swapper, you can return
|
||||||
|
* FALSE from PrepareAccess() to force EXA to migrate the pixmap to RAM.
|
||||||
|
* Note that DownloadFromScreen and UploadToScreen can both be called
|
||||||
|
* between PrepareAccess() and FinishAccess(). If they need to use a
|
||||||
|
* swapper, they should save & restore its setting.
|
||||||
|
*/
|
||||||
|
Bool (*PrepareAccess)(PixmapPtr pPix, int index);
|
||||||
|
void (*FinishAccess)(PixmapPtr pPix, int index);
|
||||||
|
#define EXA_PREPARE_DEST 0
|
||||||
|
#define EXA_PREPARE_SRC 1
|
||||||
|
#define EXA_PREPARE_MASK 2
|
||||||
|
|
||||||
} ExaAccelInfoRec, *ExaAccelInfoPtr;
|
} ExaAccelInfoRec, *ExaAccelInfoPtr;
|
||||||
|
|
||||||
typedef struct _ExaDriver {
|
typedef struct _ExaDriver {
|
||||||
|
@ -224,6 +242,9 @@ exaGetPixmapOffset(PixmapPtr pPix);
|
||||||
unsigned long
|
unsigned long
|
||||||
exaGetPixmapPitch(PixmapPtr pPix);
|
exaGetPixmapPitch(PixmapPtr pPix);
|
||||||
|
|
||||||
|
unsigned long
|
||||||
|
exaGetPixmapSize(PixmapPtr pPix);
|
||||||
|
|
||||||
#define exaInitCard(exa, sync, memory_base, off_screen_base, memory_size, \
|
#define exaInitCard(exa, sync, memory_base, off_screen_base, memory_size, \
|
||||||
offscreen_byte_align, offscreen_pitch, flags, \
|
offscreen_byte_align, offscreen_pitch, flags, \
|
||||||
max_x, max_y) \
|
max_x, max_y) \
|
||||||
|
|
105
exa/exa_accel.c
105
exa/exa_accel.c
|
@ -78,6 +78,21 @@ exaGetPixmapPitch(PixmapPtr pPix)
|
||||||
return pPix->devKind;
|
return pPix->devKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Returns the size in bytes of the given pixmap in
|
||||||
|
* video memory. Only valid when the vram storage has been
|
||||||
|
* allocated
|
||||||
|
*/
|
||||||
|
unsigned long
|
||||||
|
exaGetPixmapSize(PixmapPtr pPix)
|
||||||
|
{
|
||||||
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
|
||||||
|
pExaPixmap = ExaGetPixmapPriv(pPix);
|
||||||
|
if (pExaPixmap != NULL)
|
||||||
|
return pExaPixmap->size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty (DrawablePtr pDrawable)
|
exaDrawableDirty (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
|
@ -185,6 +200,7 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
|
pExaPixmap->size = pitch * h;
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
|
@ -439,6 +455,7 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
STRACE;
|
STRACE;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
else
|
else
|
||||||
|
@ -446,6 +463,57 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
return exaPixmapIsOffscreen (pPixmap);
|
return exaPixmapIsOffscreen (pPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
|
||||||
|
if (index == EXA_PREPARE_DEST)
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
|
if (exaPixmapIsOffscreen (pPixmap))
|
||||||
|
exaWaitSync (pDrawable->pScreen);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.PrepareAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
|
||||||
|
ExaPixmapPriv (pPixmap);
|
||||||
|
assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
|
||||||
|
exaMoveOutPixmap (pPixmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.FinishAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
if (!exaPixmapIsOffscreen (pPixmap))
|
||||||
|
return;
|
||||||
|
|
||||||
|
(*pExaScr->info->accel.FinishAccess) (pPixmap, index);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
exaFillTiled(int dst_x,
|
exaFillTiled(int dst_x,
|
||||||
|
@ -620,10 +688,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
goto fallback;
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
|
||||||
bitplane, closure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If either drawable is already in framebuffer, try to get both of them
|
/* If either drawable is already in framebuffer, try to get both of them
|
||||||
|
@ -664,15 +729,18 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
||||||
exaMarkSync(pDstDrawable->pScreen);
|
exaMarkSync(pDstDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDstDrawable);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
fallback:
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
||||||
bitplane, closure);
|
pbox, nbox, dx, dy, reverse, upsidedown,
|
||||||
}
|
bitplane, closure);
|
||||||
exaDrawableDirty (pDstDrawable);
|
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -822,12 +890,12 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
||||||
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
||||||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
||||||
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
||||||
fbAnd (GXcopy, fg, pm),
|
fbAnd (GXcopy, fg, pm),
|
||||||
fbXor (GXcopy, fg, pm));
|
fbXor (GXcopy, fg, pm));
|
||||||
exaDrawableDirty (pDrawable);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
||||||
|
@ -949,8 +1017,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
opaque = FALSE;
|
opaque = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
|
|
||||||
ppci = ppciInit;
|
ppci = ppciInit;
|
||||||
while (nglyph--)
|
while (nglyph--)
|
||||||
|
@ -996,6 +1063,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
x += pci->metrics.characterWidth;
|
x += pci->metrics.characterWidth;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GCOps exaOps = {
|
static const GCOps exaOps = {
|
||||||
|
@ -1121,14 +1189,15 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
||||||
exaMarkSync(pDrawable->pScreen);
|
exaMarkSync(pDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fbFillRegionSolid (pDrawable, pRegion, 0,
|
fbFillRegionSolid (pDrawable, pRegion, 0,
|
||||||
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -78,6 +78,21 @@ exaGetPixmapPitch(PixmapPtr pPix)
|
||||||
return pPix->devKind;
|
return pPix->devKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Returns the size in bytes of the given pixmap in
|
||||||
|
* video memory. Only valid when the vram storage has been
|
||||||
|
* allocated
|
||||||
|
*/
|
||||||
|
unsigned long
|
||||||
|
exaGetPixmapSize(PixmapPtr pPix)
|
||||||
|
{
|
||||||
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
|
||||||
|
pExaPixmap = ExaGetPixmapPriv(pPix);
|
||||||
|
if (pExaPixmap != NULL)
|
||||||
|
return pExaPixmap->size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty (DrawablePtr pDrawable)
|
exaDrawableDirty (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
|
@ -185,6 +200,7 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
|
pExaPixmap->size = pitch * h;
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
|
@ -439,6 +455,7 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
STRACE;
|
STRACE;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
else
|
else
|
||||||
|
@ -446,6 +463,57 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
return exaPixmapIsOffscreen (pPixmap);
|
return exaPixmapIsOffscreen (pPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
|
||||||
|
if (index == EXA_PREPARE_DEST)
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
|
if (exaPixmapIsOffscreen (pPixmap))
|
||||||
|
exaWaitSync (pDrawable->pScreen);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.PrepareAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
|
||||||
|
ExaPixmapPriv (pPixmap);
|
||||||
|
assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
|
||||||
|
exaMoveOutPixmap (pPixmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.FinishAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
if (!exaPixmapIsOffscreen (pPixmap))
|
||||||
|
return;
|
||||||
|
|
||||||
|
(*pExaScr->info->accel.FinishAccess) (pPixmap, index);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
exaFillTiled(int dst_x,
|
exaFillTiled(int dst_x,
|
||||||
|
@ -620,10 +688,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
goto fallback;
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
|
||||||
bitplane, closure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If either drawable is already in framebuffer, try to get both of them
|
/* If either drawable is already in framebuffer, try to get both of them
|
||||||
|
@ -664,15 +729,18 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
||||||
exaMarkSync(pDstDrawable->pScreen);
|
exaMarkSync(pDstDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDstDrawable);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
fallback:
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
||||||
bitplane, closure);
|
pbox, nbox, dx, dy, reverse, upsidedown,
|
||||||
}
|
bitplane, closure);
|
||||||
exaDrawableDirty (pDstDrawable);
|
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -822,12 +890,12 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
||||||
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
||||||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
||||||
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
||||||
fbAnd (GXcopy, fg, pm),
|
fbAnd (GXcopy, fg, pm),
|
||||||
fbXor (GXcopy, fg, pm));
|
fbXor (GXcopy, fg, pm));
|
||||||
exaDrawableDirty (pDrawable);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
||||||
|
@ -949,8 +1017,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
opaque = FALSE;
|
opaque = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
|
|
||||||
ppci = ppciInit;
|
ppci = ppciInit;
|
||||||
while (nglyph--)
|
while (nglyph--)
|
||||||
|
@ -996,6 +1063,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
x += pci->metrics.characterWidth;
|
x += pci->metrics.characterWidth;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GCOps exaOps = {
|
static const GCOps exaOps = {
|
||||||
|
@ -1121,14 +1189,15 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
||||||
exaMarkSync(pDrawable->pScreen);
|
exaMarkSync(pDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fbFillRegionSolid (pDrawable, pRegion, 0,
|
fbFillRegionSolid (pDrawable, pRegion, 0,
|
||||||
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -103,6 +103,7 @@ typedef struct {
|
||||||
int devKind;
|
int devKind;
|
||||||
DevUnion devPrivate;
|
DevUnion devPrivate;
|
||||||
Bool dirty;
|
Bool dirty;
|
||||||
|
unsigned int size;
|
||||||
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
||||||
|
|
||||||
|
|
||||||
|
@ -246,6 +247,12 @@ exaPixmapUseScreen (PixmapPtr pPixmap);
|
||||||
void
|
void
|
||||||
exaPixmapUseMemory (PixmapPtr pPixmap);
|
exaPixmapUseMemory (PixmapPtr pPixmap);
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index);
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index);
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty(DrawablePtr pDrawable);
|
exaDrawableDirty(DrawablePtr pDrawable);
|
||||||
|
|
||||||
|
|
|
@ -262,13 +262,8 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
else
|
else
|
||||||
pSrcPix = (PixmapPtr) (pSrc->pDrawable);
|
pSrcPix = (PixmapPtr) (pSrc->pDrawable);
|
||||||
|
|
||||||
/* If source is offscreen, we need to sync the accelerator
|
|
||||||
* before accessing it. We'd prefer for it to be in memory.
|
|
||||||
*/
|
|
||||||
if (exaPixmapIsOffscreen(pSrcPix)) {
|
|
||||||
exaWaitSync(pDst->pDrawable->pScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
exaPrepareAccess(&pSrcPix->drawable, EXA_PREPARE_SRC);
|
||||||
pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
|
pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
|
||||||
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
||||||
pSrc->format))
|
pSrc->format))
|
||||||
|
@ -276,6 +271,8 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess(&pSrcPix->drawable, EXA_PREPARE_SRC);
|
||||||
|
|
||||||
exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
||||||
pDst->format);
|
pDst->format);
|
||||||
|
|
||||||
|
|
|
@ -33,18 +33,18 @@ void
|
||||||
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
|
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
|
||||||
DDXPointPtr ppt, int *pwidth, int fSorted)
|
DDXPointPtr ppt, int *pwidth, int fSorted)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
|
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
|
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
|
||||||
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
|
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
|
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -52,18 +52,24 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
|
||||||
int x, int y, int w, int h, int leftPad, int format,
|
int x, int y, int w, int h, int leftPad, int format,
|
||||||
char *bits)
|
char *bits)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||||
int srcx, int srcy, int w, int h, int dstx, int dsty)
|
int srcx, int srcy, int w, int h, int dstx, int dsty)
|
||||||
{
|
{
|
||||||
exaWaitSync (pSrc->pScreen);
|
RegionPtr ret;
|
||||||
exaDrawableDirty (pDst);
|
|
||||||
return fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
|
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
ret = fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
|
||||||
|
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -71,19 +77,25 @@ ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||||
int srcx, int srcy, int w, int h, int dstx, int dsty,
|
int srcx, int srcy, int w, int h, int dstx, int dsty,
|
||||||
unsigned long bitPlane)
|
unsigned long bitPlane)
|
||||||
{
|
{
|
||||||
exaWaitSync (pSrc->pScreen);
|
RegionPtr ret;
|
||||||
exaDrawableDirty (pDst);
|
|
||||||
return fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
|
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
|
||||||
bitPlane);
|
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
ret = fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
|
||||||
|
bitPlane);
|
||||||
|
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
|
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
|
||||||
DDXPointPtr pptInit)
|
DDXPointPtr pptInit)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
|
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -92,10 +104,11 @@ ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,10 +117,11 @@ ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nsegInit, xSegment *pSegInit)
|
int nsegInit, xSegment *pSegInit)
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,8 +130,10 @@ ExaCheckPolyRectangle (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nrects, xRectangle *prect)
|
int nrects, xRectangle *prect)
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
||||||
}
|
}
|
||||||
|
@ -128,12 +144,12 @@ ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0)
|
if (pGC->lineWidth == 0)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyArc (pDrawable, pGC, narcs, pArcs);
|
fbPolyArc (pDrawable, pGC, narcs, pArcs);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
miPolyArc (pDrawable, pGC, narcs, pArcs);
|
||||||
miPolyArc (pDrawable, pGC, narcs, pArcs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -141,9 +157,9 @@ void
|
||||||
ExaCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int shape, int mode, int count, DDXPointPtr pPts)
|
int shape, int mode, int count, DDXPointPtr pPts)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbFillPolygon (pDrawable, pGC, mode, count, pPts);
|
fbFillPolygon (pDrawable, pGC, mode, count, pPts);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -151,18 +167,18 @@ void
|
||||||
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nrect, xRectangle *prect)
|
int nrect, xRectangle *prect)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int narcs, xArc *pArcs)
|
int narcs, xArc *pArcs)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyFillArc (pDrawable, pGC, narcs, pArcs);
|
fbPolyFillArc (pDrawable, pGC, narcs, pArcs);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -170,9 +186,9 @@ ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int x, int y, unsigned int nglyph,
|
int x, int y, unsigned int nglyph,
|
||||||
CharInfoPtr *ppci, pointer pglyphBase)
|
CharInfoPtr *ppci, pointer pglyphBase)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -180,9 +196,9 @@ ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int x, int y, unsigned int nglyph,
|
int x, int y, unsigned int nglyph,
|
||||||
CharInfoPtr *ppci, pointer pglyphBase)
|
CharInfoPtr *ppci, pointer pglyphBase)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -190,9 +206,9 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
|
||||||
DrawablePtr pDrawable,
|
DrawablePtr pDrawable,
|
||||||
int w, int h, int x, int y)
|
int w, int h, int x, int y)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
|
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -201,8 +217,9 @@ ExaCheckGetImage (DrawablePtr pDrawable,
|
||||||
unsigned int format, unsigned long planeMask,
|
unsigned int format, unsigned long planeMask,
|
||||||
char *d)
|
char *d)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
|
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -213,8 +230,9 @@ ExaCheckGetSpans (DrawablePtr pDrawable,
|
||||||
int nspans,
|
int nspans,
|
||||||
char *pdstStart)
|
char *pdstStart)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -224,9 +242,9 @@ ExaCheckSaveAreas (PixmapPtr pPixmap,
|
||||||
int yorg,
|
int yorg,
|
||||||
WindowPtr pWin)
|
WindowPtr pWin)
|
||||||
{
|
{
|
||||||
exaWaitSync(pWin->drawable.pScreen);
|
exaPrepareAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (&pPixmap->drawable);
|
|
||||||
fbSaveAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
fbSaveAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
||||||
|
exaFinishAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -236,17 +254,17 @@ ExaCheckRestoreAreas (PixmapPtr pPixmap,
|
||||||
int yorg,
|
int yorg,
|
||||||
WindowPtr pWin)
|
WindowPtr pWin)
|
||||||
{
|
{
|
||||||
exaWaitSync(pWin->drawable.pScreen);
|
exaPrepareAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty ((DrawablePtr)pWin);
|
|
||||||
fbRestoreAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
fbRestoreAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
||||||
|
exaFinishAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
|
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
|
||||||
{
|
{
|
||||||
exaWaitSync (pWin->drawable.pScreen);
|
exaPrepareAccess (&pWin->drawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty ((DrawablePtr)pWin);
|
|
||||||
fbPaintWindow (pWin, pRegion, what);
|
fbPaintWindow (pWin, pRegion, what);
|
||||||
|
exaFinishAccess (&pWin->drawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -263,8 +281,10 @@ ExaCheckComposite (CARD8 op,
|
||||||
CARD16 width,
|
CARD16 width,
|
||||||
CARD16 height)
|
CARD16 height)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDst->pDrawable->pScreen);
|
exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDst->pDrawable);
|
exaPrepareAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
|
||||||
|
if (pMask)
|
||||||
|
exaPrepareAccess (pMask->pDrawable, EXA_PREPARE_MASK);
|
||||||
fbComposite (op,
|
fbComposite (op,
|
||||||
pSrc,
|
pSrc,
|
||||||
pMask,
|
pMask,
|
||||||
|
@ -277,6 +297,10 @@ ExaCheckComposite (CARD8 op,
|
||||||
yDst,
|
yDst,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
if (pMask)
|
||||||
|
exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
|
||||||
|
exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -78,6 +78,21 @@ exaGetPixmapPitch(PixmapPtr pPix)
|
||||||
return pPix->devKind;
|
return pPix->devKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Returns the size in bytes of the given pixmap in
|
||||||
|
* video memory. Only valid when the vram storage has been
|
||||||
|
* allocated
|
||||||
|
*/
|
||||||
|
unsigned long
|
||||||
|
exaGetPixmapSize(PixmapPtr pPix)
|
||||||
|
{
|
||||||
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
|
||||||
|
pExaPixmap = ExaGetPixmapPriv(pPix);
|
||||||
|
if (pExaPixmap != NULL)
|
||||||
|
return pExaPixmap->size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty (DrawablePtr pDrawable)
|
exaDrawableDirty (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
|
@ -185,6 +200,7 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
|
pExaPixmap->size = pitch * h;
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
|
@ -439,6 +455,7 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
STRACE;
|
STRACE;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
else
|
else
|
||||||
|
@ -446,6 +463,57 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
return exaPixmapIsOffscreen (pPixmap);
|
return exaPixmapIsOffscreen (pPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
|
||||||
|
if (index == EXA_PREPARE_DEST)
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
|
if (exaPixmapIsOffscreen (pPixmap))
|
||||||
|
exaWaitSync (pDrawable->pScreen);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.PrepareAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
|
||||||
|
ExaPixmapPriv (pPixmap);
|
||||||
|
assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
|
||||||
|
exaMoveOutPixmap (pPixmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.FinishAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
if (!exaPixmapIsOffscreen (pPixmap))
|
||||||
|
return;
|
||||||
|
|
||||||
|
(*pExaScr->info->accel.FinishAccess) (pPixmap, index);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
exaFillTiled(int dst_x,
|
exaFillTiled(int dst_x,
|
||||||
|
@ -620,10 +688,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
goto fallback;
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
|
||||||
bitplane, closure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If either drawable is already in framebuffer, try to get both of them
|
/* If either drawable is already in framebuffer, try to get both of them
|
||||||
|
@ -664,15 +729,18 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
||||||
exaMarkSync(pDstDrawable->pScreen);
|
exaMarkSync(pDstDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDstDrawable);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
fallback:
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
||||||
bitplane, closure);
|
pbox, nbox, dx, dy, reverse, upsidedown,
|
||||||
}
|
bitplane, closure);
|
||||||
exaDrawableDirty (pDstDrawable);
|
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -822,12 +890,12 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
||||||
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
||||||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
||||||
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
||||||
fbAnd (GXcopy, fg, pm),
|
fbAnd (GXcopy, fg, pm),
|
||||||
fbXor (GXcopy, fg, pm));
|
fbXor (GXcopy, fg, pm));
|
||||||
exaDrawableDirty (pDrawable);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
||||||
|
@ -949,8 +1017,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
opaque = FALSE;
|
opaque = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
|
|
||||||
ppci = ppciInit;
|
ppci = ppciInit;
|
||||||
while (nglyph--)
|
while (nglyph--)
|
||||||
|
@ -996,6 +1063,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
x += pci->metrics.characterWidth;
|
x += pci->metrics.characterWidth;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GCOps exaOps = {
|
static const GCOps exaOps = {
|
||||||
|
@ -1121,14 +1189,15 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
||||||
exaMarkSync(pDrawable->pScreen);
|
exaMarkSync(pDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fbFillRegionSolid (pDrawable, pRegion, 0,
|
fbFillRegionSolid (pDrawable, pRegion, 0,
|
||||||
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -175,6 +175,24 @@ typedef struct _ExaAccelInfo {
|
||||||
*/
|
*/
|
||||||
int (*MarkSync) (ScreenPtr pScreen);
|
int (*MarkSync) (ScreenPtr pScreen);
|
||||||
void (*WaitMarker) (ScreenPtr pScreen, int marker);
|
void (*WaitMarker) (ScreenPtr pScreen, int marker);
|
||||||
|
|
||||||
|
/* These are wrapping all fb or composite operations that will cause
|
||||||
|
* a direct access to the framebuffer. You can use them to update
|
||||||
|
* endian swappers, force migration to RAM, or whatever else you find
|
||||||
|
* useful at this point. EXA can stack up to 3 calls to Prepare/Finish
|
||||||
|
* access, though they will have a different index. If your hardware
|
||||||
|
* doesn't have enough separate configurable swapper, you can return
|
||||||
|
* FALSE from PrepareAccess() to force EXA to migrate the pixmap to RAM.
|
||||||
|
* Note that DownloadFromScreen and UploadToScreen can both be called
|
||||||
|
* between PrepareAccess() and FinishAccess(). If they need to use a
|
||||||
|
* swapper, they should save & restore its setting.
|
||||||
|
*/
|
||||||
|
Bool (*PrepareAccess)(PixmapPtr pPix, int index);
|
||||||
|
void (*FinishAccess)(PixmapPtr pPix, int index);
|
||||||
|
#define EXA_PREPARE_DEST 0
|
||||||
|
#define EXA_PREPARE_SRC 1
|
||||||
|
#define EXA_PREPARE_MASK 2
|
||||||
|
|
||||||
} ExaAccelInfoRec, *ExaAccelInfoPtr;
|
} ExaAccelInfoRec, *ExaAccelInfoPtr;
|
||||||
|
|
||||||
typedef struct _ExaDriver {
|
typedef struct _ExaDriver {
|
||||||
|
@ -224,6 +242,9 @@ exaGetPixmapOffset(PixmapPtr pPix);
|
||||||
unsigned long
|
unsigned long
|
||||||
exaGetPixmapPitch(PixmapPtr pPix);
|
exaGetPixmapPitch(PixmapPtr pPix);
|
||||||
|
|
||||||
|
unsigned long
|
||||||
|
exaGetPixmapSize(PixmapPtr pPix);
|
||||||
|
|
||||||
#define exaInitCard(exa, sync, memory_base, off_screen_base, memory_size, \
|
#define exaInitCard(exa, sync, memory_base, off_screen_base, memory_size, \
|
||||||
offscreen_byte_align, offscreen_pitch, flags, \
|
offscreen_byte_align, offscreen_pitch, flags, \
|
||||||
max_x, max_y) \
|
max_x, max_y) \
|
||||||
|
|
|
@ -103,6 +103,7 @@ typedef struct {
|
||||||
int devKind;
|
int devKind;
|
||||||
DevUnion devPrivate;
|
DevUnion devPrivate;
|
||||||
Bool dirty;
|
Bool dirty;
|
||||||
|
unsigned int size;
|
||||||
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
||||||
|
|
||||||
|
|
||||||
|
@ -246,6 +247,12 @@ exaPixmapUseScreen (PixmapPtr pPixmap);
|
||||||
void
|
void
|
||||||
exaPixmapUseMemory (PixmapPtr pPixmap);
|
exaPixmapUseMemory (PixmapPtr pPixmap);
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index);
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index);
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty(DrawablePtr pDrawable);
|
exaDrawableDirty(DrawablePtr pDrawable);
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,21 @@ exaGetPixmapPitch(PixmapPtr pPix)
|
||||||
return pPix->devKind;
|
return pPix->devKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Returns the size in bytes of the given pixmap in
|
||||||
|
* video memory. Only valid when the vram storage has been
|
||||||
|
* allocated
|
||||||
|
*/
|
||||||
|
unsigned long
|
||||||
|
exaGetPixmapSize(PixmapPtr pPix)
|
||||||
|
{
|
||||||
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
|
||||||
|
pExaPixmap = ExaGetPixmapPriv(pPix);
|
||||||
|
if (pExaPixmap != NULL)
|
||||||
|
return pExaPixmap->size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty (DrawablePtr pDrawable)
|
exaDrawableDirty (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
|
@ -185,6 +200,7 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
|
pExaPixmap->size = pitch * h;
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
|
@ -439,6 +455,7 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
STRACE;
|
STRACE;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
else
|
else
|
||||||
|
@ -446,6 +463,57 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
return exaPixmapIsOffscreen (pPixmap);
|
return exaPixmapIsOffscreen (pPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
|
||||||
|
if (index == EXA_PREPARE_DEST)
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
|
if (exaPixmapIsOffscreen (pPixmap))
|
||||||
|
exaWaitSync (pDrawable->pScreen);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.PrepareAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
|
||||||
|
ExaPixmapPriv (pPixmap);
|
||||||
|
assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
|
||||||
|
exaMoveOutPixmap (pPixmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.FinishAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
if (!exaPixmapIsOffscreen (pPixmap))
|
||||||
|
return;
|
||||||
|
|
||||||
|
(*pExaScr->info->accel.FinishAccess) (pPixmap, index);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
exaFillTiled(int dst_x,
|
exaFillTiled(int dst_x,
|
||||||
|
@ -620,10 +688,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
goto fallback;
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
|
||||||
bitplane, closure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If either drawable is already in framebuffer, try to get both of them
|
/* If either drawable is already in framebuffer, try to get both of them
|
||||||
|
@ -664,15 +729,18 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
||||||
exaMarkSync(pDstDrawable->pScreen);
|
exaMarkSync(pDstDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDstDrawable);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
fallback:
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
||||||
bitplane, closure);
|
pbox, nbox, dx, dy, reverse, upsidedown,
|
||||||
}
|
bitplane, closure);
|
||||||
exaDrawableDirty (pDstDrawable);
|
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -822,12 +890,12 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
||||||
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
||||||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
||||||
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
||||||
fbAnd (GXcopy, fg, pm),
|
fbAnd (GXcopy, fg, pm),
|
||||||
fbXor (GXcopy, fg, pm));
|
fbXor (GXcopy, fg, pm));
|
||||||
exaDrawableDirty (pDrawable);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
||||||
|
@ -949,8 +1017,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
opaque = FALSE;
|
opaque = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
|
|
||||||
ppci = ppciInit;
|
ppci = ppciInit;
|
||||||
while (nglyph--)
|
while (nglyph--)
|
||||||
|
@ -996,6 +1063,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
x += pci->metrics.characterWidth;
|
x += pci->metrics.characterWidth;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GCOps exaOps = {
|
static const GCOps exaOps = {
|
||||||
|
@ -1121,14 +1189,15 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
||||||
exaMarkSync(pDrawable->pScreen);
|
exaMarkSync(pDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fbFillRegionSolid (pDrawable, pRegion, 0,
|
fbFillRegionSolid (pDrawable, pRegion, 0,
|
||||||
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -78,6 +78,21 @@ exaGetPixmapPitch(PixmapPtr pPix)
|
||||||
return pPix->devKind;
|
return pPix->devKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Returns the size in bytes of the given pixmap in
|
||||||
|
* video memory. Only valid when the vram storage has been
|
||||||
|
* allocated
|
||||||
|
*/
|
||||||
|
unsigned long
|
||||||
|
exaGetPixmapSize(PixmapPtr pPix)
|
||||||
|
{
|
||||||
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
|
||||||
|
pExaPixmap = ExaGetPixmapPriv(pPix);
|
||||||
|
if (pExaPixmap != NULL)
|
||||||
|
return pExaPixmap->size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty (DrawablePtr pDrawable)
|
exaDrawableDirty (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
|
@ -185,6 +200,7 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
|
pExaPixmap->size = pitch * h;
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
|
@ -439,6 +455,7 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
STRACE;
|
STRACE;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
else
|
else
|
||||||
|
@ -446,6 +463,57 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
return exaPixmapIsOffscreen (pPixmap);
|
return exaPixmapIsOffscreen (pPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
|
||||||
|
if (index == EXA_PREPARE_DEST)
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
|
if (exaPixmapIsOffscreen (pPixmap))
|
||||||
|
exaWaitSync (pDrawable->pScreen);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.PrepareAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
|
||||||
|
ExaPixmapPriv (pPixmap);
|
||||||
|
assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
|
||||||
|
exaMoveOutPixmap (pPixmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
ExaScreenPriv (pScreen);
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
STRACE;
|
||||||
|
|
||||||
|
if (pExaScr->info->accel.FinishAccess == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
||||||
|
else
|
||||||
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
|
if (!exaPixmapIsOffscreen (pPixmap))
|
||||||
|
return;
|
||||||
|
|
||||||
|
(*pExaScr->info->accel.FinishAccess) (pPixmap, index);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
exaFillTiled(int dst_x,
|
exaFillTiled(int dst_x,
|
||||||
|
@ -620,10 +688,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
goto fallback;
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
|
||||||
bitplane, closure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If either drawable is already in framebuffer, try to get both of them
|
/* If either drawable is already in framebuffer, try to get both of them
|
||||||
|
@ -664,15 +729,18 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
(*pExaScr->info->accel.DoneCopy) (pDstPixmap);
|
||||||
exaMarkSync(pDstDrawable->pScreen);
|
exaMarkSync(pDstDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDstDrawable);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
fallback:
|
||||||
exaWaitSync (pDstDrawable->pScreen);
|
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
||||||
bitplane, closure);
|
pbox, nbox, dx, dy, reverse, upsidedown,
|
||||||
}
|
bitplane, closure);
|
||||||
exaDrawableDirty (pDstDrawable);
|
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -822,12 +890,12 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
||||||
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
||||||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
||||||
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
|
||||||
fbAnd (GXcopy, fg, pm),
|
fbAnd (GXcopy, fg, pm),
|
||||||
fbXor (GXcopy, fg, pm));
|
fbXor (GXcopy, fg, pm));
|
||||||
exaDrawableDirty (pDrawable);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
||||||
|
@ -949,8 +1017,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
opaque = FALSE;
|
opaque = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
|
|
||||||
ppci = ppciInit;
|
ppci = ppciInit;
|
||||||
while (nglyph--)
|
while (nglyph--)
|
||||||
|
@ -996,6 +1063,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
x += pci->metrics.characterWidth;
|
x += pci->metrics.characterWidth;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GCOps exaOps = {
|
static const GCOps exaOps = {
|
||||||
|
@ -1121,14 +1189,15 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
||||||
}
|
}
|
||||||
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
(*pExaScr->info->accel.DoneSolid) (pPixmap);
|
||||||
exaMarkSync(pDrawable->pScreen);
|
exaMarkSync(pDrawable->pScreen);
|
||||||
|
exaDrawableDirty (pDrawable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fbFillRegionSolid (pDrawable, pRegion, 0,
|
fbFillRegionSolid (pDrawable, pRegion, 0,
|
||||||
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -103,6 +103,7 @@ typedef struct {
|
||||||
int devKind;
|
int devKind;
|
||||||
DevUnion devPrivate;
|
DevUnion devPrivate;
|
||||||
Bool dirty;
|
Bool dirty;
|
||||||
|
unsigned int size;
|
||||||
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
||||||
|
|
||||||
|
|
||||||
|
@ -246,6 +247,12 @@ exaPixmapUseScreen (PixmapPtr pPixmap);
|
||||||
void
|
void
|
||||||
exaPixmapUseMemory (PixmapPtr pPixmap);
|
exaPixmapUseMemory (PixmapPtr pPixmap);
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPrepareAccess(DrawablePtr pDrawable, int index);
|
||||||
|
|
||||||
|
void
|
||||||
|
exaFinishAccess(DrawablePtr pDrawable, int index);
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty(DrawablePtr pDrawable);
|
exaDrawableDirty(DrawablePtr pDrawable);
|
||||||
|
|
||||||
|
|
|
@ -262,13 +262,8 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
else
|
else
|
||||||
pSrcPix = (PixmapPtr) (pSrc->pDrawable);
|
pSrcPix = (PixmapPtr) (pSrc->pDrawable);
|
||||||
|
|
||||||
/* If source is offscreen, we need to sync the accelerator
|
|
||||||
* before accessing it. We'd prefer for it to be in memory.
|
|
||||||
*/
|
|
||||||
if (exaPixmapIsOffscreen(pSrcPix)) {
|
|
||||||
exaWaitSync(pDst->pDrawable->pScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
exaPrepareAccess(&pSrcPix->drawable, EXA_PREPARE_SRC);
|
||||||
pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
|
pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
|
||||||
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
||||||
pSrc->format))
|
pSrc->format))
|
||||||
|
@ -276,6 +271,8 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess(&pSrcPix->drawable, EXA_PREPARE_SRC);
|
||||||
|
|
||||||
exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
||||||
pDst->format);
|
pDst->format);
|
||||||
|
|
||||||
|
|
|
@ -33,18 +33,18 @@ void
|
||||||
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
|
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
|
||||||
DDXPointPtr ppt, int *pwidth, int fSorted)
|
DDXPointPtr ppt, int *pwidth, int fSorted)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
|
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
|
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
|
||||||
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
|
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
|
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -52,18 +52,24 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
|
||||||
int x, int y, int w, int h, int leftPad, int format,
|
int x, int y, int w, int h, int leftPad, int format,
|
||||||
char *bits)
|
char *bits)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||||
int srcx, int srcy, int w, int h, int dstx, int dsty)
|
int srcx, int srcy, int w, int h, int dstx, int dsty)
|
||||||
{
|
{
|
||||||
exaWaitSync (pSrc->pScreen);
|
RegionPtr ret;
|
||||||
exaDrawableDirty (pDst);
|
|
||||||
return fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
|
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
ret = fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
|
||||||
|
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -71,19 +77,25 @@ ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||||
int srcx, int srcy, int w, int h, int dstx, int dsty,
|
int srcx, int srcy, int w, int h, int dstx, int dsty,
|
||||||
unsigned long bitPlane)
|
unsigned long bitPlane)
|
||||||
{
|
{
|
||||||
exaWaitSync (pSrc->pScreen);
|
RegionPtr ret;
|
||||||
exaDrawableDirty (pDst);
|
|
||||||
return fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
|
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
|
||||||
bitPlane);
|
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
ret = fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
|
||||||
|
bitPlane);
|
||||||
|
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
|
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
|
||||||
DDXPointPtr pptInit)
|
DDXPointPtr pptInit)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
|
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -92,10 +104,11 @@ ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,10 +117,11 @@ ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nsegInit, xSegment *pSegInit)
|
int nsegInit, xSegment *pSegInit)
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,8 +130,10 @@ ExaCheckPolyRectangle (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nrects, xRectangle *prect)
|
int nrects, xRectangle *prect)
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
||||||
}
|
}
|
||||||
|
@ -128,12 +144,12 @@ ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0)
|
if (pGC->lineWidth == 0)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyArc (pDrawable, pGC, narcs, pArcs);
|
fbPolyArc (pDrawable, pGC, narcs, pArcs);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
miPolyArc (pDrawable, pGC, narcs, pArcs);
|
||||||
miPolyArc (pDrawable, pGC, narcs, pArcs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -141,9 +157,9 @@ void
|
||||||
ExaCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int shape, int mode, int count, DDXPointPtr pPts)
|
int shape, int mode, int count, DDXPointPtr pPts)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbFillPolygon (pDrawable, pGC, mode, count, pPts);
|
fbFillPolygon (pDrawable, pGC, mode, count, pPts);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -151,18 +167,18 @@ void
|
||||||
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nrect, xRectangle *prect)
|
int nrect, xRectangle *prect)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int narcs, xArc *pArcs)
|
int narcs, xArc *pArcs)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyFillArc (pDrawable, pGC, narcs, pArcs);
|
fbPolyFillArc (pDrawable, pGC, narcs, pArcs);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -170,9 +186,9 @@ ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int x, int y, unsigned int nglyph,
|
int x, int y, unsigned int nglyph,
|
||||||
CharInfoPtr *ppci, pointer pglyphBase)
|
CharInfoPtr *ppci, pointer pglyphBase)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -180,9 +196,9 @@ ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int x, int y, unsigned int nglyph,
|
int x, int y, unsigned int nglyph,
|
||||||
CharInfoPtr *ppci, pointer pglyphBase)
|
CharInfoPtr *ppci, pointer pglyphBase)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -190,9 +206,9 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
|
||||||
DrawablePtr pDrawable,
|
DrawablePtr pDrawable,
|
||||||
int w, int h, int x, int y)
|
int w, int h, int x, int y)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
|
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -201,8 +217,9 @@ ExaCheckGetImage (DrawablePtr pDrawable,
|
||||||
unsigned int format, unsigned long planeMask,
|
unsigned int format, unsigned long planeMask,
|
||||||
char *d)
|
char *d)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
|
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -213,8 +230,9 @@ ExaCheckGetSpans (DrawablePtr pDrawable,
|
||||||
int nspans,
|
int nspans,
|
||||||
char *pdstStart)
|
char *pdstStart)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -224,9 +242,9 @@ ExaCheckSaveAreas (PixmapPtr pPixmap,
|
||||||
int yorg,
|
int yorg,
|
||||||
WindowPtr pWin)
|
WindowPtr pWin)
|
||||||
{
|
{
|
||||||
exaWaitSync(pWin->drawable.pScreen);
|
exaPrepareAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (&pPixmap->drawable);
|
|
||||||
fbSaveAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
fbSaveAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
||||||
|
exaFinishAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -236,17 +254,17 @@ ExaCheckRestoreAreas (PixmapPtr pPixmap,
|
||||||
int yorg,
|
int yorg,
|
||||||
WindowPtr pWin)
|
WindowPtr pWin)
|
||||||
{
|
{
|
||||||
exaWaitSync(pWin->drawable.pScreen);
|
exaPrepareAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty ((DrawablePtr)pWin);
|
|
||||||
fbRestoreAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
fbRestoreAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
||||||
|
exaFinishAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
|
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
|
||||||
{
|
{
|
||||||
exaWaitSync (pWin->drawable.pScreen);
|
exaPrepareAccess (&pWin->drawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty ((DrawablePtr)pWin);
|
|
||||||
fbPaintWindow (pWin, pRegion, what);
|
fbPaintWindow (pWin, pRegion, what);
|
||||||
|
exaFinishAccess (&pWin->drawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -263,8 +281,10 @@ ExaCheckComposite (CARD8 op,
|
||||||
CARD16 width,
|
CARD16 width,
|
||||||
CARD16 height)
|
CARD16 height)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDst->pDrawable->pScreen);
|
exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDst->pDrawable);
|
exaPrepareAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
|
||||||
|
if (pMask)
|
||||||
|
exaPrepareAccess (pMask->pDrawable, EXA_PREPARE_MASK);
|
||||||
fbComposite (op,
|
fbComposite (op,
|
||||||
pSrc,
|
pSrc,
|
||||||
pMask,
|
pMask,
|
||||||
|
@ -277,6 +297,10 @@ ExaCheckComposite (CARD8 op,
|
||||||
yDst,
|
yDst,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
if (pMask)
|
||||||
|
exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
|
||||||
|
exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -33,18 +33,18 @@ void
|
||||||
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
|
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
|
||||||
DDXPointPtr ppt, int *pwidth, int fSorted)
|
DDXPointPtr ppt, int *pwidth, int fSorted)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
|
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
|
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
|
||||||
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
|
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
|
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -52,18 +52,24 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
|
||||||
int x, int y, int w, int h, int leftPad, int format,
|
int x, int y, int w, int h, int leftPad, int format,
|
||||||
char *bits)
|
char *bits)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||||
int srcx, int srcy, int w, int h, int dstx, int dsty)
|
int srcx, int srcy, int w, int h, int dstx, int dsty)
|
||||||
{
|
{
|
||||||
exaWaitSync (pSrc->pScreen);
|
RegionPtr ret;
|
||||||
exaDrawableDirty (pDst);
|
|
||||||
return fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
|
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
ret = fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
|
||||||
|
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
@ -71,19 +77,25 @@ ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||||
int srcx, int srcy, int w, int h, int dstx, int dsty,
|
int srcx, int srcy, int w, int h, int dstx, int dsty,
|
||||||
unsigned long bitPlane)
|
unsigned long bitPlane)
|
||||||
{
|
{
|
||||||
exaWaitSync (pSrc->pScreen);
|
RegionPtr ret;
|
||||||
exaDrawableDirty (pDst);
|
|
||||||
return fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
|
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
|
||||||
bitPlane);
|
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
ret = fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
|
||||||
|
bitPlane);
|
||||||
|
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
|
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
|
||||||
DDXPointPtr pptInit)
|
DDXPointPtr pptInit)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
|
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -92,10 +104,11 @@ ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,10 +117,11 @@ ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nsegInit, xSegment *pSegInit)
|
int nsegInit, xSegment *pSegInit)
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,8 +130,10 @@ ExaCheckPolyRectangle (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nrects, xRectangle *prect)
|
int nrects, xRectangle *prect)
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0) {
|
if (pGC->lineWidth == 0) {
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
fbPolyRectangle (pDrawable, pGC, nrects, prect);
|
||||||
}
|
}
|
||||||
|
@ -128,12 +144,12 @@ ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
{
|
{
|
||||||
if (pGC->lineWidth == 0)
|
if (pGC->lineWidth == 0)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyArc (pDrawable, pGC, narcs, pArcs);
|
fbPolyArc (pDrawable, pGC, narcs, pArcs);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
miPolyArc (pDrawable, pGC, narcs, pArcs);
|
||||||
miPolyArc (pDrawable, pGC, narcs, pArcs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -141,9 +157,9 @@ void
|
||||||
ExaCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int shape, int mode, int count, DDXPointPtr pPts)
|
int shape, int mode, int count, DDXPointPtr pPts)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbFillPolygon (pDrawable, pGC, mode, count, pPts);
|
fbFillPolygon (pDrawable, pGC, mode, count, pPts);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -151,18 +167,18 @@ void
|
||||||
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int nrect, xRectangle *prect)
|
int nrect, xRectangle *prect)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
|
ExaCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int narcs, xArc *pArcs)
|
int narcs, xArc *pArcs)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyFillArc (pDrawable, pGC, narcs, pArcs);
|
fbPolyFillArc (pDrawable, pGC, narcs, pArcs);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -170,9 +186,9 @@ ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int x, int y, unsigned int nglyph,
|
int x, int y, unsigned int nglyph,
|
||||||
CharInfoPtr *ppci, pointer pglyphBase)
|
CharInfoPtr *ppci, pointer pglyphBase)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -180,9 +196,9 @@ ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int x, int y, unsigned int nglyph,
|
int x, int y, unsigned int nglyph,
|
||||||
CharInfoPtr *ppci, pointer pglyphBase)
|
CharInfoPtr *ppci, pointer pglyphBase)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -190,9 +206,9 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
|
||||||
DrawablePtr pDrawable,
|
DrawablePtr pDrawable,
|
||||||
int w, int h, int x, int y)
|
int w, int h, int x, int y)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDrawable);
|
|
||||||
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
|
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -201,8 +217,9 @@ ExaCheckGetImage (DrawablePtr pDrawable,
|
||||||
unsigned int format, unsigned long planeMask,
|
unsigned int format, unsigned long planeMask,
|
||||||
char *d)
|
char *d)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
|
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -213,8 +230,9 @@ ExaCheckGetSpans (DrawablePtr pDrawable,
|
||||||
int nspans,
|
int nspans,
|
||||||
char *pdstStart)
|
char *pdstStart)
|
||||||
{
|
{
|
||||||
exaWaitSync(pDrawable->pScreen);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
||||||
|
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -224,9 +242,9 @@ ExaCheckSaveAreas (PixmapPtr pPixmap,
|
||||||
int yorg,
|
int yorg,
|
||||||
WindowPtr pWin)
|
WindowPtr pWin)
|
||||||
{
|
{
|
||||||
exaWaitSync(pWin->drawable.pScreen);
|
exaPrepareAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (&pPixmap->drawable);
|
|
||||||
fbSaveAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
fbSaveAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
||||||
|
exaFinishAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -236,17 +254,17 @@ ExaCheckRestoreAreas (PixmapPtr pPixmap,
|
||||||
int yorg,
|
int yorg,
|
||||||
WindowPtr pWin)
|
WindowPtr pWin)
|
||||||
{
|
{
|
||||||
exaWaitSync(pWin->drawable.pScreen);
|
exaPrepareAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty ((DrawablePtr)pWin);
|
|
||||||
fbRestoreAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
fbRestoreAreas (pPixmap, prgnSave, xorg, yorg, pWin);
|
||||||
|
exaFinishAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
|
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
|
||||||
{
|
{
|
||||||
exaWaitSync (pWin->drawable.pScreen);
|
exaPrepareAccess (&pWin->drawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty ((DrawablePtr)pWin);
|
|
||||||
fbPaintWindow (pWin, pRegion, what);
|
fbPaintWindow (pWin, pRegion, what);
|
||||||
|
exaFinishAccess (&pWin->drawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -263,8 +281,10 @@ ExaCheckComposite (CARD8 op,
|
||||||
CARD16 width,
|
CARD16 width,
|
||||||
CARD16 height)
|
CARD16 height)
|
||||||
{
|
{
|
||||||
exaWaitSync (pDst->pDrawable->pScreen);
|
exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||||
exaDrawableDirty (pDst->pDrawable);
|
exaPrepareAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
|
||||||
|
if (pMask)
|
||||||
|
exaPrepareAccess (pMask->pDrawable, EXA_PREPARE_MASK);
|
||||||
fbComposite (op,
|
fbComposite (op,
|
||||||
pSrc,
|
pSrc,
|
||||||
pMask,
|
pMask,
|
||||||
|
@ -277,6 +297,10 @@ ExaCheckComposite (CARD8 op,
|
||||||
yDst,
|
yDst,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
if (pMask)
|
||||||
|
exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
|
||||||
|
exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
|
||||||
|
exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -262,13 +262,8 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
else
|
else
|
||||||
pSrcPix = (PixmapPtr) (pSrc->pDrawable);
|
pSrcPix = (PixmapPtr) (pSrc->pDrawable);
|
||||||
|
|
||||||
/* If source is offscreen, we need to sync the accelerator
|
|
||||||
* before accessing it. We'd prefer for it to be in memory.
|
|
||||||
*/
|
|
||||||
if (exaPixmapIsOffscreen(pSrcPix)) {
|
|
||||||
exaWaitSync(pDst->pDrawable->pScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
exaPrepareAccess(&pSrcPix->drawable, EXA_PREPARE_SRC);
|
||||||
pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
|
pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
|
||||||
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
||||||
pSrc->format))
|
pSrc->format))
|
||||||
|
@ -276,6 +271,8 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
exaFinishAccess(&pSrcPix->drawable, EXA_PREPARE_SRC);
|
||||||
|
|
||||||
exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
||||||
pDst->format);
|
pDst->format);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue