[PATCH 6/6] exa: clean up some usage of the word offscreen
Maarten Maathuis
madman2003 at gmail.com
Wed Nov 18 12:23:13 PST 2009
Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
---
exa/exa.c | 8 ++++----
exa/exa_classic.c | 4 ++--
exa/exa_driver.c | 9 +++++----
exa/exa_glyphs.c | 8 ++++----
exa/exa_migration_classic.c | 14 +++++++-------
exa/exa_migration_mixed.c | 9 +++++----
exa/exa_mixed.c | 8 ++++----
exa/exa_offscreen.c | 8 ++++----
exa/exa_render.c | 2 +-
9 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/exa/exa.c b/exa/exa.c
index 2aa0d01..023288c 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -291,7 +291,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv (pScreen);
ExaPixmapPriv(pPixmap);
- Bool offscreen;
+ Bool has_gpu_copy;
int i;
if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS))
@@ -321,9 +321,9 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
pPixmap->devPrivate.ptr));
}
- offscreen = exaPixmapHasGpuCopy(pPixmap);
+ has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
- if (offscreen && pExaPixmap->fb_ptr)
+ if (has_gpu_copy && pExaPixmap->fb_ptr)
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
else
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
@@ -332,7 +332,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
pExaScr->access[index].pixmap = pPixmap;
pExaScr->access[index].count = 1;
- if (!offscreen)
+ if (!has_gpu_copy)
return FALSE;
exaWaitSync (pScreen);
diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index fee3fde..c31e2d4 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -168,7 +168,7 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int dept
/* Classic EXA:
* - Framebuffer.
- * - Scratch pixmap with offscreen memory.
+ * - Scratch pixmap with gpu memory.
*/
if (pExaScr->info->memoryBase && pPixData) {
if ((CARD8 *)pPixData >= pExaScr->info->memoryBase &&
@@ -189,7 +189,7 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int dept
}
/* Pixmaps subject to ModifyPixmapHeader will be pinned to system or
- * offscreen memory, so there's no need to track damage.
+ * gpu memory, so there's no need to track damage.
*/
if (pExaPixmap->pDamage) {
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
diff --git a/exa/exa_driver.c b/exa/exa_driver.c
index 6b80763..c721b7c 100644
--- a/exa/exa_driver.c
+++ b/exa/exa_driver.c
@@ -71,8 +71,8 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
bpp = pPixmap->drawable.bitsPerPixel;
- /* Set this before driver hooks, to allow for !offscreen pixmaps.
- * !offscreen pixmaps have a valid pointer at all times.
+ /* Set this before driver hooks, to allow for driver pixmaps without gpu
+ * memory to back it. These pixmaps have a valid pointer at all times.
*/
pPixmap->devPrivate.ptr = NULL;
@@ -157,8 +157,9 @@ exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth
ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth,
bitsPerPixel, devKind, pPixData);
/* For EXA_HANDLES_PIXMAPS, we set pPixData to NULL.
- * If pPixmap->devPrivate.ptr is non-NULL, then we've got a non-offscreen pixmap.
- * We need to store the pointer, because PrepareAccess won't be called.
+ * If pPixmap->devPrivate.ptr is non-NULL, then we've got a
+ * !has_gpu_copy pixmap. We need to store the pointer,
+ * because PrepareAccess won't be called.
*/
if (!pPixData && pPixmap->devPrivate.ptr && pPixmap->devKind) {
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr;
diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c
index 1f8e73b..4f406c7 100644
--- a/exa/exa_glyphs.c
+++ b/exa/exa_glyphs.c
@@ -347,11 +347,11 @@ exaGlyphCacheHashRemove(ExaGlyphCachePtr cache,
/* The most efficient thing to way to upload the glyph to the screen
* is to use the UploadToScreen() driver hook; this allows us to
- * pipeline glyph uploads and to avoid creating offscreen pixmaps for
+ * pipeline glyph uploads and to avoid creating gpu backed pixmaps for
* glyphs that we'll never use again.
*
- * If we can't do it with UploadToScreen (because the glyph is offscreen, etc),
- * we fall back to CompositePicture.
+ * If we can't do it with UploadToScreen (because the glyph has a gpu copy,
+ * etc), we fall back to CompositePicture.
*
* We need to damage the cache pixmap manually in either case because the damage
* layer unwrapped the picture screen before calling exaGlyphs.
@@ -384,7 +384,7 @@ exaGlyphCacheUploadGlyph(ScreenPtr pScreen,
if (pExaScr->do_migration) {
ExaMigrationRec pixmaps[1];
- /* cache pixmap must be offscreen. */
+ /* cache pixmap must have a gpu copy. */
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
pixmaps[0].pPix = pCachePixmap;
diff --git a/exa/exa_migration_classic.c b/exa/exa_migration_classic.c
index 0226a2d..95189be 100644
--- a/exa/exa_migration_classic.c
+++ b/exa/exa_migration_classic.c
@@ -111,7 +111,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
ExaPixmapPriv (pPixmap);
RegionPtr damage = DamageRegion (pExaPixmap->pDamage);
RegionRec CopyReg;
- Bool save_offscreen;
+ Bool save_use_gpu_copy;
int save_pitch;
BoxPtr pBox;
int nbox;
@@ -200,7 +200,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
pBox = REGION_RECTS(&CopyReg);
nbox = REGION_NUM_RECTS(&CopyReg);
- save_offscreen = pExaPixmap->use_gpu_copy;
+ save_use_gpu_copy = pExaPixmap->use_gpu_copy;
save_pitch = pPixmap->devKind;
pExaPixmap->use_gpu_copy = TRUE;
pPixmap->devKind = pExaPixmap->fb_pitch;
@@ -242,7 +242,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
pBox++;
}
- pExaPixmap->use_gpu_copy = save_offscreen;
+ pExaPixmap->use_gpu_copy = save_use_gpu_copy;
pPixmap->devKind = save_pitch;
/* Try to prevent source valid region from growing too many rects by
@@ -523,7 +523,7 @@ exaAssertNotDirty (PixmapPtr pPixmap)
RegionRec ValidReg;
int dst_pitch, src_pitch, cpp, y, nbox, save_pitch;
BoxPtr pBox;
- Bool ret = TRUE, save_offscreen;
+ Bool ret = TRUE, save_use_gpu_copy;
if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL)
return ret;
@@ -542,7 +542,7 @@ exaAssertNotDirty (PixmapPtr pPixmap)
src_pitch = pExaPixmap->fb_pitch;
cpp = pPixmap->drawable.bitsPerPixel / 8;
- save_offscreen = pExaPixmap->use_gpu_copy;
+ save_use_gpu_copy = pExaPixmap->use_gpu_copy;
save_pitch = pPixmap->devKind;
pExaPixmap->use_gpu_copy = TRUE;
pPixmap->devKind = pExaPixmap->fb_pitch;
@@ -579,7 +579,7 @@ exaAssertNotDirty (PixmapPtr pPixmap)
skip:
exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
- pExaPixmap->use_gpu_copy = save_offscreen;
+ pExaPixmap->use_gpu_copy = save_use_gpu_copy;
pPixmap->devKind = save_pitch;
out:
@@ -714,7 +714,7 @@ exaDoMigration_classic (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
}
}
- /* Yay, everything's offscreen, mark memory as used */
+ /* Yay, everything has a gpu copy, mark memory as used */
for (i = 0; i < npixmaps; i++) {
ExaOffscreenMarkUsed (pixmaps[i].pPix);
}
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index 9349ba9..8b01418 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -139,7 +139,7 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
ExaPixmapPriv(pPixmap);
if (!ExaDoPrepareAccess(pPixmap, index)) {
- Bool is_offscreen = exaPixmapHasGpuCopy(pPixmap);
+ Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
ExaMigrationRec pixmaps[1];
/* Do we need to allocate our system buffer? */
@@ -161,7 +161,8 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = pReg;
- if (!pExaPixmap->pDamage && (is_offscreen || !exaPixmapIsPinned(pPixmap))) {
+ if (!pExaPixmap->pDamage &&
+ (has_gpu_copy || !exaPixmapIsPinned(pPixmap))) {
Bool as_dst = pixmaps[0].as_dst;
/* Set up damage tracking */
@@ -174,7 +175,7 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
/* This is used by exa to optimize migration. */
DamageSetReportAfterOp(pExaPixmap->pDamage, TRUE);
- if (is_offscreen) {
+ if (has_gpu_copy) {
exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
pPixmap->drawable.height);
@@ -193,7 +194,7 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
if (as_dst)
exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
pPixmap->drawable.height);
- } else if (is_offscreen) {
+ } else if (has_gpu_copy) {
pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToSys(pixmaps);
}
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index 9bdac5f..764c7dd 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -111,7 +111,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPrivPtr pExaScr;
ExaPixmapPrivPtr pExaPixmap;
- Bool ret, is_offscreen;
+ Bool ret, has_gpu_copy;
if (!pPixmap)
return FALSE;
@@ -145,8 +145,8 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
}
}
- is_offscreen = exaPixmapHasGpuCopy(pPixmap);
- if (is_offscreen) {
+ has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
+ if (has_gpu_copy) {
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
pPixmap->devKind = pExaPixmap->fb_pitch;
} else {
@@ -168,7 +168,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
swap(pExaScr, pScreen, ModifyPixmapHeader);
out:
- if (is_offscreen) {
+ if (has_gpu_copy) {
pExaPixmap->fb_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->fb_pitch = pPixmap->devKind;
} else {
diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
index f8a2f39..acdf439 100644
--- a/exa/exa_offscreen.c
+++ b/exa/exa_offscreen.c
@@ -531,7 +531,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen)
ExaOffscreenArea *prev = area->prev;
PixmapPtr pSrcPix;
ExaPixmapPrivPtr pExaSrcPix;
- Bool save_offscreen;
+ Bool save_use_gpu_copy;
int save_pitch;
if (area->state != ExaOffscreenAvail ||
@@ -576,7 +576,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen)
continue;
}
- save_offscreen = pExaSrcPix->use_gpu_copy;
+ save_use_gpu_copy = pExaSrcPix->use_gpu_copy;
save_pitch = pSrcPix->devKind;
pExaSrcPix->use_gpu_copy = TRUE;
@@ -589,7 +589,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen)
pDstPix->drawable.bitsPerPixel = pSrcPix->drawable.bitsPerPixel;
if (!pExaScr->info->PrepareCopy (pSrcPix, pDstPix, -1, -1, GXcopy, ~0)) {
- pExaSrcPix->use_gpu_copy = save_offscreen;
+ pExaSrcPix->use_gpu_copy = save_use_gpu_copy;
pSrcPix->devKind = save_pitch;
area = prev;
continue;
@@ -646,7 +646,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen)
#endif
pExaSrcPix->fb_ptr = pExaDstPix->fb_ptr;
- pExaSrcPix->use_gpu_copy = save_offscreen;
+ pExaSrcPix->use_gpu_copy = save_use_gpu_copy;
pSrcPix->devKind = save_pitch;
}
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 3cbe60b..1b68e1c 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -540,7 +540,7 @@ exaCompositeRects(CARD8 op,
/* We have to manage the damage ourselves, since CompositeRects isn't
* something in the screen that can be managed by the damage extension,
* and EXA depends on damage to track what needs to be migrated between
- * offscreen and onscreen.
+ * the gpu and the cpu.
*/
/* Compute the overall extents of the composited region - we're making
--
1.6.5.2
More information about the xorg-devel
mailing list