xserver: Branch 'master' - 3 commits
Keith Packard
keithp at kemper.freedesktop.org
Wed Jan 5 08:52:01 PST 2011
hw/xfree86/dri2/dri2.c | 11 +++++++++++
hw/xfree86/modes/xf86Modes.c | 33 +++++++++++++++++++++++++--------
2 files changed, 36 insertions(+), 8 deletions(-)
New commits:
commit 0dede200c9ac7adbe8b8c16efacc3edc1f183cd9
Merge: 7714357... 2e78145...
Author: Keith Packard <keithp at keithp.com>
Date: Wed Jan 5 08:51:46 2011 -0800
Merge remote branch 'vsyrjala/misc_fixes'
commit 2e781457d43ec4bf0d633257ac6852cde3b00541
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date: Thu Dec 16 18:22:13 2010 +0200
xfree86/modes: Take rotation into account when checking mode size
Assume that a mode can be used in either landscape or portrait
orientation. I suppose the correct thing to do would be to
collect all the supported rotations from the CRTCs that can be used
with a specific output, but that information doesn't seem to be
readily available when these checks are done. So just assume that
either orientation is fine.
Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 75584cf..c2dc3dc 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -355,15 +355,32 @@ xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList,
{
DisplayModePtr mode;
- for (mode = modeList; mode != NULL; mode = mode->next) {
- if (maxPitch > 0 && mode->HDisplay > maxPitch)
- mode->status = MODE_BAD_WIDTH;
-
- if (maxX > 0 && mode->HDisplay > maxX)
- mode->status = MODE_VIRTUAL_X;
+ if (maxPitch <= 0)
+ maxPitch = MAXINT;
+ if (maxX <= 0)
+ maxX = MAXINT;
+ if (maxY <= 0)
+ maxY = MAXINT;
- if (maxY > 0 && mode->VDisplay > maxY)
- mode->status = MODE_VIRTUAL_Y;
+ for (mode = modeList; mode != NULL; mode = mode->next) {
+ if ((xf86ModeWidth(mode, RR_Rotate_0) > maxPitch ||
+ xf86ModeWidth(mode, RR_Rotate_0) > maxX ||
+ xf86ModeHeight(mode, RR_Rotate_0) > maxY) &&
+ (xf86ModeWidth(mode, RR_Rotate_90) > maxPitch ||
+ xf86ModeWidth(mode, RR_Rotate_90) > maxX ||
+ xf86ModeHeight(mode, RR_Rotate_90) > maxY)) {
+ if (xf86ModeWidth(mode, RR_Rotate_0) > maxPitch ||
+ xf86ModeWidth(mode, RR_Rotate_90) > maxPitch)
+ mode->status = MODE_BAD_WIDTH;
+
+ if (xf86ModeWidth(mode, RR_Rotate_0) > maxX ||
+ xf86ModeWidth(mode, RR_Rotate_90) > maxX)
+ mode->status = MODE_VIRTUAL_X;
+
+ if (xf86ModeHeight(mode, RR_Rotate_0) > maxY ||
+ xf86ModeHeight(mode, RR_Rotate_90) > maxY)
+ mode->status = MODE_VIRTUAL_Y;
+ }
if (mode->next == modeList)
break;
commit 0ce25fd7904c792924c3e0ee6fc21a5f1bec1a68
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date: Fri Dec 3 17:42:16 2010 +0200
dri2: Don't page flip when the window size doesn't match the pixmap size
If the drawable size doesn't match the pixmap size page flipping should
not be allowed.
If the window is larger than the pixmap, page flipping might need to
reposition the CRTC somewhere in the middle of the pixmap. I didn't
spot any code that would handle that at least in the intel driver.
Also the root pixmap could then move to some negative screen
coordinates. Not sure if all bits of code could handle that. Perhaps
when composite is enabled screen_x/y would make it work, but without
composite there's no way that it would work AFAICS.
Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
Reviewed-by: Alex Deucher <alexdeucher at gmail.com>
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index e4693d9..39996f9 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -640,6 +640,17 @@ DRI2CanFlip(DrawablePtr pDraw)
if (!RegionEqual(&pWin->clipList, &pRoot->winSize))
return FALSE;
+ /* Does the window match the pixmap exactly? */
+ if (pDraw->x != 0 ||
+ pDraw->y != 0 ||
+#ifdef COMPOSITE
+ pDraw->x != pWinPixmap->screen_x ||
+ pDraw->y != pWinPixmap->screen_y ||
+#endif
+ pDraw->width != pWinPixmap->drawable.width ||
+ pDraw->height != pWinPixmap->drawable.height)
+ return FALSE;
+
return TRUE;
}
More information about the xorg-commit
mailing list