xserver: Branch 'master' - 3 commits
Keith Packard
keithp at kemper.freedesktop.org
Fri Apr 20 04:20:15 EEST 2007
hw/xfree86/modes/xf86Rotate.c | 26 +++++++++++++++-----------
mi/misprite.c | 37 ++++---------------------------------
mi/misprite.h | 2 --
mi/mispritest.h | 1 -
4 files changed, 19 insertions(+), 47 deletions(-)
New commits:
diff-tree 96ef0f78438b60436c3940817980a3ab4070c7e8 (from 7ca4baffb5569ea12b578a4a3f69e93d272d6c6d)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Apr 19 17:39:51 2007 -0700
Disable SourceValidate in rotation to capture cursor.
SourceValidate is used exclusively by the software cursor code to pull the
cursor off of the screen before using the screen as a source operand. This
eliminates the software cursor from the frame buffer while painting the
rotated image though. Disabling this function by temporarily setting the
screen function pointer to NULL causes the cursor image to be captured.
(cherry picked from commit 05e1c45ade9c558820685bfd2541617a2e8de816)
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 94f95a0..359501e 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -278,8 +278,18 @@ xf86RotateRedisplay(ScreenPtr pScreen)
region = DamageRegion(damage);
if (REGION_NOTEMPTY(pScreen, region))
{
- int c;
-
+ int c;
+ SourceValidateProcPtr SourceValidate;
+
+ /*
+ * SourceValidate is used by the software cursor code
+ * to pull the cursor off of the screen when reading
+ * bits from the frame buffer. Bypassing this function
+ * leaves the software cursor in place
+ */
+ SourceValidate = pScreen->SourceValidate;
+ pScreen->SourceValidate = NULL;
+
for (c = 0; c < xf86_config->num_crtc; c++)
{
xf86CrtcPtr crtc = xf86_config->crtc[c];
@@ -304,6 +314,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
REGION_UNINIT (pScreen, &crtc_damage);
}
}
+ pScreen->SourceValidate = SourceValidate;
DamageEmpty(damage);
}
}
diff-tree 7ca4baffb5569ea12b578a4a3f69e93d272d6c6d (from 806a537e644d8cc9e53f3ac52efb49453e5aa1fb)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Apr 19 17:37:18 2007 -0700
Was accidentally disabling rotation updates in mode set.
Setting a mode on an unrotated CRTC was causing all of the rotation updates
to be disabled; the loop looking for active rotation wasn't actually looking
at each crtc, it was looking at the modified crtc many times.
(cherry picked from commit 8b217dee3a6c46b13fc9571a4a9a95bc55686cdb)
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index e8fafd0..94f95a0 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -284,7 +284,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
{
xf86CrtcPtr crtc = xf86_config->crtc[c];
- if (crtc->rotation != RR_Rotate_0)
+ if (crtc->rotation != RR_Rotate_0 && crtc->enabled)
{
BoxRec box;
RegionRec crtc_damage;
@@ -338,7 +338,8 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
}
for (c = 0; c < xf86_config->num_crtc; c++)
- if (crtc->rotatedPixmap || crtc->rotatedData)
+ if (xf86_config->crtc[c]->rotatedPixmap ||
+ xf86_config->crtc[c]->rotatedData)
return;
/*
diff-tree 806a537e644d8cc9e53f3ac52efb49453e5aa1fb (from 0a9239ec258828ec1da6c208634a55fc4053d7da)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Apr 19 17:49:34 2007 -0700
Revert "Suppress software cursor removal during rotated shadow buffer drawing."
This reverts commit 999b681cf3973af4191506e49cde06963b11a774.
Replacing this with simpler code that just disables SourceValidate
during rotation redisplay.
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 5127c15..e8fafd0 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -39,7 +39,6 @@
#include "xf86Crtc.h"
#include "xf86Modes.h"
#include "xf86RandR12.h"
-#include "misprite.h"
#include "X11/extensions/render.h"
#define DPMS_SERVER
#include "X11/extensions/dpms.h"
@@ -280,11 +279,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
if (REGION_NOTEMPTY(pScreen, region))
{
int c;
-
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(7,2,0,0,dummy)
- /* Disable software cursor removal for this drawing */
- miSpriteDrawInternal(pScreen, TRUE);
-#endif
+
for (c = 0; c < xf86_config->num_crtc; c++)
{
xf86CrtcPtr crtc = xf86_config->crtc[c];
@@ -309,9 +304,6 @@ xf86RotateRedisplay(ScreenPtr pScreen)
REGION_UNINIT (pScreen, &crtc_damage);
}
}
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(7,2,0,0,dummy)
- miSpriteDrawInternal(pScreen, FALSE);
-#endif
DamageEmpty(damage);
}
}
diff --git a/mi/misprite.c b/mi/misprite.c
index 71e6ab0..c0560a4 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -288,8 +288,7 @@ miSpriteGetImage (pDrawable, sx, sy, w,
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pScreenPriv->internalDraw == 0 &&
- pDrawable->type == DRAWABLE_WINDOW &&
+ if (pDrawable->type == DRAWABLE_WINDOW &&
pScreenPriv->isUp &&
ORG_OVERLAP(&pScreenPriv->saved,pDrawable->x,pDrawable->y, sx, sy, w, h))
{
@@ -319,8 +318,7 @@ miSpriteGetSpans (pDrawable, wMax, ppt,
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pScreenPriv->internalDraw == 0 &&
- pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp)
+ if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp)
{
DDXPointPtr pts;
int *widths;
@@ -362,8 +360,7 @@ miSpriteSourceValidate (pDrawable, x, y,
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pScreenPriv->internalDraw == 0 &&
- pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp &&
+ if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp &&
ORG_OVERLAP(&pScreenPriv->saved, pDrawable->x, pDrawable->y,
x, y, width, height))
{
@@ -389,8 +386,7 @@ miSpriteCopyWindow (WindowPtr pWindow, D
/*
* Damage will take care of destination check
*/
- if (pScreenPriv->internalDraw == 0 &&
- pScreenPriv->isUp &&
+ if (pScreenPriv->isUp &&
RECT_IN_REGION (pScreen, prgnSrc, &pScreenPriv->saved) != rgnOUT)
{
SPRITE_DEBUG (("CopyWindow remove\n"));
@@ -831,28 +827,3 @@ miSpriteComputeSaved (pScreen)
pScreenPriv->saved.x2 = pScreenPriv->saved.x1 + w + wpad * 2;
pScreenPriv->saved.y2 = pScreenPriv->saved.y1 + h + hpad * 2;
}
-
-/**
- * Enables internal drawing support, which disables removal of the
- * cursor when the screen pixmap is sourced from.
- *
- * This can be used to allow software cursors to be read by RandR rotation
- * shadow code.
- */
-void
-miSpriteDrawInternal(ScreenPtr pScreen, Bool enable)
-{
- miSpriteScreenPtr pScreenPriv;
-
- /* Check that miSprite has been set up this generation */
- if (miSpriteGeneration != serverGeneration)
- return;
-
- pScreenPriv = (miSpriteScreenPtr)
- pScreen->devPrivates[miSpriteScreenIndex].ptr;
-
- if (enable)
- pScreenPriv->internalDraw++;
- else
- pScreenPriv->internalDraw--;
-}
diff --git a/mi/misprite.h b/mi/misprite.h
index 0a1bcc1..5173b77 100644
--- a/mi/misprite.h
+++ b/mi/misprite.h
@@ -92,5 +92,3 @@ extern Bool miSpriteInitialize(
miSpriteCursorFuncPtr /*cursorFuncs*/,
miPointerScreenFuncPtr /*screenFuncs*/
);
-
-void miSpriteDrawInternal(ScreenPtr pScreen, Bool enable);
diff --git a/mi/mispritest.h b/mi/mispritest.h
index 2deaa45..5075f05 100644
--- a/mi/mispritest.h
+++ b/mi/mispritest.h
@@ -76,7 +76,6 @@ typedef struct {
WindowPtr pCacheWin; /* window the cursor last seen in */
Bool isInCacheWin;
Bool checkPixels; /* check colormap collision */
- int internalDraw;
xColorItem colors[2];
ColormapPtr pInstalledMap;
ColormapPtr pColormap;
More information about the xorg-commit
mailing list