Add an additional meaning to the "dirty" flag. Now, if !dirty && !area, the
pixmaps's contents are undefined, so we won't need to upload the undefined contents in MoveIn. Use the ExaCheck* for async ops as well, so that dirty is always tracked. While the performance impact for my ls -lR test was not significant (though the avoiding-upload path was being hit), it's likely to be important for the upcoming Get/PutImage acceleration from ajax.
This commit is contained in:
parent
21e7339c1e
commit
744aa34ca5
14
exa/exa.c
14
exa/exa.c
|
@ -159,6 +159,10 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
|
||||||
pPixmap->devPrivate.ptr = dst;
|
pPixmap->devPrivate.ptr = dst;
|
||||||
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pExaPixmap->area = NULL;
|
pExaPixmap->area = NULL;
|
||||||
|
/* Mark it dirty now, to say that there is important data in the
|
||||||
|
* system-memory copy.
|
||||||
|
*/
|
||||||
|
pExaPixmap->dirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -238,6 +242,16 @@ exaMoveInPixmap (PixmapPtr pPixmap)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the "dirty" flag has never been set on the in-memory pixmap, then
|
||||||
|
* nothing has been written to it, so the contents are undefined and we can
|
||||||
|
* avoid the upload.
|
||||||
|
*/
|
||||||
|
if (!pExaPixmap->dirty) {
|
||||||
|
DBG_MIGRATE(("saved upload of %dx%d\n", pPixmap->drawable.width,
|
||||||
|
pPixmap->drawable.height));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pExaPixmap->dirty = FALSE;
|
pExaPixmap->dirty = FALSE;
|
||||||
|
|
||||||
if (pExaScr->info->accel.UploadToScreen)
|
if (pExaScr->info->accel.UploadToScreen)
|
||||||
|
|
|
@ -159,6 +159,10 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
|
||||||
pPixmap->devPrivate.ptr = dst;
|
pPixmap->devPrivate.ptr = dst;
|
||||||
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pExaPixmap->area = NULL;
|
pExaPixmap->area = NULL;
|
||||||
|
/* Mark it dirty now, to say that there is important data in the
|
||||||
|
* system-memory copy.
|
||||||
|
*/
|
||||||
|
pExaPixmap->dirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -238,6 +242,16 @@ exaMoveInPixmap (PixmapPtr pPixmap)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the "dirty" flag has never been set on the in-memory pixmap, then
|
||||||
|
* nothing has been written to it, so the contents are undefined and we can
|
||||||
|
* avoid the upload.
|
||||||
|
*/
|
||||||
|
if (!pExaPixmap->dirty) {
|
||||||
|
DBG_MIGRATE(("saved upload of %dx%d\n", pPixmap->drawable.width,
|
||||||
|
pPixmap->drawable.height));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pExaPixmap->dirty = FALSE;
|
pExaPixmap->dirty = FALSE;
|
||||||
|
|
||||||
if (pExaScr->info->accel.UploadToScreen)
|
if (pExaScr->info->accel.UploadToScreen)
|
||||||
|
|
|
@ -159,6 +159,10 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
|
||||||
pPixmap->devPrivate.ptr = dst;
|
pPixmap->devPrivate.ptr = dst;
|
||||||
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pExaPixmap->area = NULL;
|
pExaPixmap->area = NULL;
|
||||||
|
/* Mark it dirty now, to say that there is important data in the
|
||||||
|
* system-memory copy.
|
||||||
|
*/
|
||||||
|
pExaPixmap->dirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -238,6 +242,16 @@ exaMoveInPixmap (PixmapPtr pPixmap)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the "dirty" flag has never been set on the in-memory pixmap, then
|
||||||
|
* nothing has been written to it, so the contents are undefined and we can
|
||||||
|
* avoid the upload.
|
||||||
|
*/
|
||||||
|
if (!pExaPixmap->dirty) {
|
||||||
|
DBG_MIGRATE(("saved upload of %dx%d\n", pPixmap->drawable.width,
|
||||||
|
pPixmap->drawable.height));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pExaPixmap->dirty = FALSE;
|
pExaPixmap->dirty = FALSE;
|
||||||
|
|
||||||
if (pExaScr->info->accel.UploadToScreen)
|
if (pExaScr->info->accel.UploadToScreen)
|
||||||
|
|
|
@ -119,8 +119,12 @@ typedef struct {
|
||||||
int devKind;
|
int devKind;
|
||||||
DevUnion devPrivate;
|
DevUnion devPrivate;
|
||||||
|
|
||||||
/* True if the in-screen copy has been modified compared to the
|
/* If area is NULL, then dirty == TRUE means that the pixmap has been
|
||||||
* system-memory copy.
|
* modified, so the contents are defined. Used to avoid uploads of
|
||||||
|
* undefined data.
|
||||||
|
* If area is non-NULL, then dirty == TRUE means that the in-framebuffer
|
||||||
|
* copy has been changed from the system-memory copy. Used to avoid
|
||||||
|
* downloads of unmodified data.
|
||||||
*/
|
*/
|
||||||
Bool dirty;
|
Bool dirty;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
|
|
|
@ -331,26 +331,26 @@ ExaCheckComposite (CARD8 op,
|
||||||
* do migration for CopyArea.
|
* do migration for CopyArea.
|
||||||
*/
|
*/
|
||||||
const GCOps exaAsyncPixmapGCOps = {
|
const GCOps exaAsyncPixmapGCOps = {
|
||||||
fbFillSpans,
|
ExaCheckFillSpans,
|
||||||
fbSetSpans,
|
ExaCheckSetSpans,
|
||||||
fbPutImage,
|
ExaCheckPutImage,
|
||||||
exaCopyArea,
|
exaCopyArea,
|
||||||
ExaCheckCopyPlane,
|
ExaCheckCopyPlane,
|
||||||
fbPolyPoint,
|
ExaCheckPolyPoint,
|
||||||
fbPolyLine,
|
ExaCheckPolylines,
|
||||||
fbPolySegment,
|
ExaCheckPolySegment,
|
||||||
fbPolyRectangle,
|
ExaCheckPolyRectangle,
|
||||||
fbPolyArc,
|
ExaCheckPolyArc,
|
||||||
fbFillPolygon,
|
ExaCheckFillPolygon,
|
||||||
fbPolyFillRect,
|
ExaCheckPolyFillRect,
|
||||||
fbPolyFillArc,
|
ExaCheckPolyFillArc,
|
||||||
miPolyText8,
|
miPolyText8,
|
||||||
miPolyText16,
|
miPolyText16,
|
||||||
miImageText8,
|
miImageText8,
|
||||||
miImageText16,
|
miImageText16,
|
||||||
fbImageGlyphBlt,
|
ExaCheckImageGlyphBlt,
|
||||||
fbPolyGlyphBlt,
|
ExaCheckPolyGlyphBlt,
|
||||||
fbPushPixels
|
ExaCheckPushPixels
|
||||||
#ifdef NEED_LINEHELPER
|
#ifdef NEED_LINEHELPER
|
||||||
,NULL
|
,NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -159,6 +159,10 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
|
||||||
pPixmap->devPrivate.ptr = dst;
|
pPixmap->devPrivate.ptr = dst;
|
||||||
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pExaPixmap->area = NULL;
|
pExaPixmap->area = NULL;
|
||||||
|
/* Mark it dirty now, to say that there is important data in the
|
||||||
|
* system-memory copy.
|
||||||
|
*/
|
||||||
|
pExaPixmap->dirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -238,6 +242,16 @@ exaMoveInPixmap (PixmapPtr pPixmap)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the "dirty" flag has never been set on the in-memory pixmap, then
|
||||||
|
* nothing has been written to it, so the contents are undefined and we can
|
||||||
|
* avoid the upload.
|
||||||
|
*/
|
||||||
|
if (!pExaPixmap->dirty) {
|
||||||
|
DBG_MIGRATE(("saved upload of %dx%d\n", pPixmap->drawable.width,
|
||||||
|
pPixmap->drawable.height));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pExaPixmap->dirty = FALSE;
|
pExaPixmap->dirty = FALSE;
|
||||||
|
|
||||||
if (pExaScr->info->accel.UploadToScreen)
|
if (pExaScr->info->accel.UploadToScreen)
|
||||||
|
|
|
@ -119,8 +119,12 @@ typedef struct {
|
||||||
int devKind;
|
int devKind;
|
||||||
DevUnion devPrivate;
|
DevUnion devPrivate;
|
||||||
|
|
||||||
/* True if the in-screen copy has been modified compared to the
|
/* If area is NULL, then dirty == TRUE means that the pixmap has been
|
||||||
* system-memory copy.
|
* modified, so the contents are defined. Used to avoid uploads of
|
||||||
|
* undefined data.
|
||||||
|
* If area is non-NULL, then dirty == TRUE means that the in-framebuffer
|
||||||
|
* copy has been changed from the system-memory copy. Used to avoid
|
||||||
|
* downloads of unmodified data.
|
||||||
*/
|
*/
|
||||||
Bool dirty;
|
Bool dirty;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
|
|
|
@ -159,6 +159,10 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
|
||||||
pPixmap->devPrivate.ptr = dst;
|
pPixmap->devPrivate.ptr = dst;
|
||||||
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pExaPixmap->area = NULL;
|
pExaPixmap->area = NULL;
|
||||||
|
/* Mark it dirty now, to say that there is important data in the
|
||||||
|
* system-memory copy.
|
||||||
|
*/
|
||||||
|
pExaPixmap->dirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -238,6 +242,16 @@ exaMoveInPixmap (PixmapPtr pPixmap)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the "dirty" flag has never been set on the in-memory pixmap, then
|
||||||
|
* nothing has been written to it, so the contents are undefined and we can
|
||||||
|
* avoid the upload.
|
||||||
|
*/
|
||||||
|
if (!pExaPixmap->dirty) {
|
||||||
|
DBG_MIGRATE(("saved upload of %dx%d\n", pPixmap->drawable.width,
|
||||||
|
pPixmap->drawable.height));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pExaPixmap->dirty = FALSE;
|
pExaPixmap->dirty = FALSE;
|
||||||
|
|
||||||
if (pExaScr->info->accel.UploadToScreen)
|
if (pExaScr->info->accel.UploadToScreen)
|
||||||
|
|
|
@ -159,6 +159,10 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
|
||||||
pPixmap->devPrivate.ptr = dst;
|
pPixmap->devPrivate.ptr = dst;
|
||||||
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pExaPixmap->area = NULL;
|
pExaPixmap->area = NULL;
|
||||||
|
/* Mark it dirty now, to say that there is important data in the
|
||||||
|
* system-memory copy.
|
||||||
|
*/
|
||||||
|
pExaPixmap->dirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -238,6 +242,16 @@ exaMoveInPixmap (PixmapPtr pPixmap)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the "dirty" flag has never been set on the in-memory pixmap, then
|
||||||
|
* nothing has been written to it, so the contents are undefined and we can
|
||||||
|
* avoid the upload.
|
||||||
|
*/
|
||||||
|
if (!pExaPixmap->dirty) {
|
||||||
|
DBG_MIGRATE(("saved upload of %dx%d\n", pPixmap->drawable.width,
|
||||||
|
pPixmap->drawable.height));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pExaPixmap->dirty = FALSE;
|
pExaPixmap->dirty = FALSE;
|
||||||
|
|
||||||
if (pExaScr->info->accel.UploadToScreen)
|
if (pExaScr->info->accel.UploadToScreen)
|
||||||
|
|
|
@ -119,8 +119,12 @@ typedef struct {
|
||||||
int devKind;
|
int devKind;
|
||||||
DevUnion devPrivate;
|
DevUnion devPrivate;
|
||||||
|
|
||||||
/* True if the in-screen copy has been modified compared to the
|
/* If area is NULL, then dirty == TRUE means that the pixmap has been
|
||||||
* system-memory copy.
|
* modified, so the contents are defined. Used to avoid uploads of
|
||||||
|
* undefined data.
|
||||||
|
* If area is non-NULL, then dirty == TRUE means that the in-framebuffer
|
||||||
|
* copy has been changed from the system-memory copy. Used to avoid
|
||||||
|
* downloads of unmodified data.
|
||||||
*/
|
*/
|
||||||
Bool dirty;
|
Bool dirty;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
|
|
|
@ -331,26 +331,26 @@ ExaCheckComposite (CARD8 op,
|
||||||
* do migration for CopyArea.
|
* do migration for CopyArea.
|
||||||
*/
|
*/
|
||||||
const GCOps exaAsyncPixmapGCOps = {
|
const GCOps exaAsyncPixmapGCOps = {
|
||||||
fbFillSpans,
|
ExaCheckFillSpans,
|
||||||
fbSetSpans,
|
ExaCheckSetSpans,
|
||||||
fbPutImage,
|
ExaCheckPutImage,
|
||||||
exaCopyArea,
|
exaCopyArea,
|
||||||
ExaCheckCopyPlane,
|
ExaCheckCopyPlane,
|
||||||
fbPolyPoint,
|
ExaCheckPolyPoint,
|
||||||
fbPolyLine,
|
ExaCheckPolylines,
|
||||||
fbPolySegment,
|
ExaCheckPolySegment,
|
||||||
fbPolyRectangle,
|
ExaCheckPolyRectangle,
|
||||||
fbPolyArc,
|
ExaCheckPolyArc,
|
||||||
fbFillPolygon,
|
ExaCheckFillPolygon,
|
||||||
fbPolyFillRect,
|
ExaCheckPolyFillRect,
|
||||||
fbPolyFillArc,
|
ExaCheckPolyFillArc,
|
||||||
miPolyText8,
|
miPolyText8,
|
||||||
miPolyText16,
|
miPolyText16,
|
||||||
miImageText8,
|
miImageText8,
|
||||||
miImageText16,
|
miImageText16,
|
||||||
fbImageGlyphBlt,
|
ExaCheckImageGlyphBlt,
|
||||||
fbPolyGlyphBlt,
|
ExaCheckPolyGlyphBlt,
|
||||||
fbPushPixels
|
ExaCheckPushPixels
|
||||||
#ifdef NEED_LINEHELPER
|
#ifdef NEED_LINEHELPER
|
||||||
,NULL
|
,NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -331,26 +331,26 @@ ExaCheckComposite (CARD8 op,
|
||||||
* do migration for CopyArea.
|
* do migration for CopyArea.
|
||||||
*/
|
*/
|
||||||
const GCOps exaAsyncPixmapGCOps = {
|
const GCOps exaAsyncPixmapGCOps = {
|
||||||
fbFillSpans,
|
ExaCheckFillSpans,
|
||||||
fbSetSpans,
|
ExaCheckSetSpans,
|
||||||
fbPutImage,
|
ExaCheckPutImage,
|
||||||
exaCopyArea,
|
exaCopyArea,
|
||||||
ExaCheckCopyPlane,
|
ExaCheckCopyPlane,
|
||||||
fbPolyPoint,
|
ExaCheckPolyPoint,
|
||||||
fbPolyLine,
|
ExaCheckPolylines,
|
||||||
fbPolySegment,
|
ExaCheckPolySegment,
|
||||||
fbPolyRectangle,
|
ExaCheckPolyRectangle,
|
||||||
fbPolyArc,
|
ExaCheckPolyArc,
|
||||||
fbFillPolygon,
|
ExaCheckFillPolygon,
|
||||||
fbPolyFillRect,
|
ExaCheckPolyFillRect,
|
||||||
fbPolyFillArc,
|
ExaCheckPolyFillArc,
|
||||||
miPolyText8,
|
miPolyText8,
|
||||||
miPolyText16,
|
miPolyText16,
|
||||||
miImageText8,
|
miImageText8,
|
||||||
miImageText16,
|
miImageText16,
|
||||||
fbImageGlyphBlt,
|
ExaCheckImageGlyphBlt,
|
||||||
fbPolyGlyphBlt,
|
ExaCheckPolyGlyphBlt,
|
||||||
fbPushPixels
|
ExaCheckPushPixels
|
||||||
#ifdef NEED_LINEHELPER
|
#ifdef NEED_LINEHELPER
|
||||||
,NULL
|
,NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue