Bugzilla #4226: Change the pixmap migration strategy for the CopyNtoN case.
Now, if either source or dest were in framebuffer, try to get both there, but prefer system memory for both otherwise. Required making exaasync.c go through the try-acceleration path. This significantly improves window resizing under composite, because previously the pattern of creating a new pixmap and copying default contents from the screen caused a fallback every time due to the new destination pixmap being in system memory.
This commit is contained in:
parent
2261710fe0
commit
0711502f18
19
exa/exa.c
19
exa/exa.c
|
@ -605,12 +605,21 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
int dst_off_x, dst_off_y;
|
||||
STRACE;
|
||||
|
||||
/* Migrate pixmaps to same place as destination */
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
|
||||
if (exaDrawableIsOffscreen (pDstDrawable))
|
||||
/* If either drawable is already in framebuffer, try to get both of them
|
||||
* there. Otherwise, be happy with where they are.
|
||||
*/
|
||||
if (exaDrawableIsOffscreen(pDstDrawable) ||
|
||||
exaDrawableIsOffscreen(pSrcDrawable))
|
||||
{
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pSrcDrawable);
|
||||
else
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pDstDrawable);
|
||||
} else {
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||
}
|
||||
|
||||
if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
|
||||
|
@ -645,7 +654,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
exaDrawableDirty (pDstDrawable);
|
||||
}
|
||||
|
||||
static RegionPtr
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
|
|
|
@ -605,12 +605,21 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
int dst_off_x, dst_off_y;
|
||||
STRACE;
|
||||
|
||||
/* Migrate pixmaps to same place as destination */
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
|
||||
if (exaDrawableIsOffscreen (pDstDrawable))
|
||||
/* If either drawable is already in framebuffer, try to get both of them
|
||||
* there. Otherwise, be happy with where they are.
|
||||
*/
|
||||
if (exaDrawableIsOffscreen(pDstDrawable) ||
|
||||
exaDrawableIsOffscreen(pSrcDrawable))
|
||||
{
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pSrcDrawable);
|
||||
else
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pDstDrawable);
|
||||
} else {
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||
}
|
||||
|
||||
if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
|
||||
|
@ -645,7 +654,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
exaDrawableDirty (pDstDrawable);
|
||||
}
|
||||
|
||||
static RegionPtr
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
|
|
|
@ -605,12 +605,21 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
int dst_off_x, dst_off_y;
|
||||
STRACE;
|
||||
|
||||
/* Migrate pixmaps to same place as destination */
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
|
||||
if (exaDrawableIsOffscreen (pDstDrawable))
|
||||
/* If either drawable is already in framebuffer, try to get both of them
|
||||
* there. Otherwise, be happy with where they are.
|
||||
*/
|
||||
if (exaDrawableIsOffscreen(pDstDrawable) ||
|
||||
exaDrawableIsOffscreen(pSrcDrawable))
|
||||
{
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pSrcDrawable);
|
||||
else
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pDstDrawable);
|
||||
} else {
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||
}
|
||||
|
||||
if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
|
||||
|
@ -645,7 +654,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
exaDrawableDirty (pDstDrawable);
|
||||
}
|
||||
|
||||
static RegionPtr
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
|
|
|
@ -261,6 +261,10 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp);
|
|||
void
|
||||
exaMoveInPixmap (PixmapPtr pPixmap);
|
||||
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty);
|
||||
|
||||
void
|
||||
exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||
DrawablePtr pDstDrawable,
|
||||
|
|
|
@ -280,13 +280,14 @@ ExaCheckComposite (CARD8 op,
|
|||
}
|
||||
|
||||
/*
|
||||
* Only need to stall for copyarea/copyplane
|
||||
* Only need to stall for CopyArea/CopyPlane, but we want to have the chance to
|
||||
* do migration for CopyArea.
|
||||
*/
|
||||
const GCOps exaAsyncPixmapGCOps = {
|
||||
fbFillSpans,
|
||||
fbSetSpans,
|
||||
fbPutImage,
|
||||
ExaCheckCopyArea,
|
||||
exaCopyArea,
|
||||
ExaCheckCopyPlane,
|
||||
fbPolyPoint,
|
||||
fbPolyLine,
|
||||
|
|
|
@ -605,12 +605,21 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
int dst_off_x, dst_off_y;
|
||||
STRACE;
|
||||
|
||||
/* Migrate pixmaps to same place as destination */
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
|
||||
if (exaDrawableIsOffscreen (pDstDrawable))
|
||||
/* If either drawable is already in framebuffer, try to get both of them
|
||||
* there. Otherwise, be happy with where they are.
|
||||
*/
|
||||
if (exaDrawableIsOffscreen(pDstDrawable) ||
|
||||
exaDrawableIsOffscreen(pSrcDrawable))
|
||||
{
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pSrcDrawable);
|
||||
else
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pDstDrawable);
|
||||
} else {
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||
}
|
||||
|
||||
if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
|
||||
|
@ -645,7 +654,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
exaDrawableDirty (pDstDrawable);
|
||||
}
|
||||
|
||||
static RegionPtr
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
|
|
|
@ -261,6 +261,10 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp);
|
|||
void
|
||||
exaMoveInPixmap (PixmapPtr pPixmap);
|
||||
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty);
|
||||
|
||||
void
|
||||
exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||
DrawablePtr pDstDrawable,
|
||||
|
|
|
@ -605,12 +605,21 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
int dst_off_x, dst_off_y;
|
||||
STRACE;
|
||||
|
||||
/* Migrate pixmaps to same place as destination */
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
|
||||
if (exaDrawableIsOffscreen (pDstDrawable))
|
||||
/* If either drawable is already in framebuffer, try to get both of them
|
||||
* there. Otherwise, be happy with where they are.
|
||||
*/
|
||||
if (exaDrawableIsOffscreen(pDstDrawable) ||
|
||||
exaDrawableIsOffscreen(pSrcDrawable))
|
||||
{
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pSrcDrawable);
|
||||
else
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pDstDrawable);
|
||||
} else {
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||
}
|
||||
|
||||
if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
|
||||
|
@ -645,7 +654,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
exaDrawableDirty (pDstDrawable);
|
||||
}
|
||||
|
||||
static RegionPtr
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
|
|
|
@ -605,12 +605,21 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
int dst_off_x, dst_off_y;
|
||||
STRACE;
|
||||
|
||||
/* Migrate pixmaps to same place as destination */
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
|
||||
if (exaDrawableIsOffscreen (pDstDrawable))
|
||||
/* If either drawable is already in framebuffer, try to get both of them
|
||||
* there. Otherwise, be happy with where they are.
|
||||
*/
|
||||
if (exaDrawableIsOffscreen(pDstDrawable) ||
|
||||
exaDrawableIsOffscreen(pSrcDrawable))
|
||||
{
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pSrcDrawable);
|
||||
else
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseScreen ((PixmapPtr) pDstDrawable);
|
||||
} else {
|
||||
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
|
||||
if (pDstDrawable->type == DRAWABLE_PIXMAP)
|
||||
exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
|
||||
}
|
||||
|
||||
if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
|
||||
|
@ -645,7 +654,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
exaDrawableDirty (pDstDrawable);
|
||||
}
|
||||
|
||||
static RegionPtr
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
|
|
|
@ -261,6 +261,10 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp);
|
|||
void
|
||||
exaMoveInPixmap (PixmapPtr pPixmap);
|
||||
|
||||
RegionPtr
|
||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty);
|
||||
|
||||
void
|
||||
exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||
DrawablePtr pDstDrawable,
|
||||
|
|
|
@ -280,13 +280,14 @@ ExaCheckComposite (CARD8 op,
|
|||
}
|
||||
|
||||
/*
|
||||
* Only need to stall for copyarea/copyplane
|
||||
* Only need to stall for CopyArea/CopyPlane, but we want to have the chance to
|
||||
* do migration for CopyArea.
|
||||
*/
|
||||
const GCOps exaAsyncPixmapGCOps = {
|
||||
fbFillSpans,
|
||||
fbSetSpans,
|
||||
fbPutImage,
|
||||
ExaCheckCopyArea,
|
||||
exaCopyArea,
|
||||
ExaCheckCopyPlane,
|
||||
fbPolyPoint,
|
||||
fbPolyLine,
|
||||
|
|
|
@ -280,13 +280,14 @@ ExaCheckComposite (CARD8 op,
|
|||
}
|
||||
|
||||
/*
|
||||
* Only need to stall for copyarea/copyplane
|
||||
* Only need to stall for CopyArea/CopyPlane, but we want to have the chance to
|
||||
* do migration for CopyArea.
|
||||
*/
|
||||
const GCOps exaAsyncPixmapGCOps = {
|
||||
fbFillSpans,
|
||||
fbSetSpans,
|
||||
fbPutImage,
|
||||
ExaCheckCopyArea,
|
||||
exaCopyArea,
|
||||
ExaCheckCopyPlane,
|
||||
fbPolyPoint,
|
||||
fbPolyLine,
|
||||
|
|
Loading…
Reference in New Issue
Block a user