aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/modes/xf86Rotate.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-10-05 17:44:57 +0200
committermarha <marha@users.sourceforge.net>2011-10-05 17:44:57 +0200
commit8af87a5b60e37ae84fdd759e2c1602be38be4905 (patch)
tree2e621c7fbdc4dfe9eb8d733af4cc232bc03643d4 /xorg-server/hw/xfree86/modes/xf86Rotate.c
parent8238de0fe0c28bd54b3e6cdd1fc94513cf21d3cc (diff)
parentf7025b4baa1ba35ee796785641f04eac5bedb0a6 (diff)
downloadvcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.tar.gz
vcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.tar.bz2
vcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mapi/glapi/glapi.h mesalib/src/mesa/main/syncobj.h xorg-server/dix/events.c xorg-server/dix/getevents.c xorg-server/include/misc.h
Diffstat (limited to 'xorg-server/hw/xfree86/modes/xf86Rotate.c')
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Rotate.c135
1 files changed, 71 insertions, 64 deletions
diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c
index 57c3499ac..ff7000b5a 100644
--- a/xorg-server/hw/xfree86/modes/xf86Rotate.c
+++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2006 Keith Packard
+ * Copyright © 2011 Aaron Plattner
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -84,7 +85,10 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region)
int n = RegionNumRects(region);
BoxPtr b = RegionRects(region);
XID include_inferiors = IncludeInferiors;
-
+
+ if (crtc->driverIsPerformingTransform)
+ return;
+
src = CreatePicture (None,
&root->drawable,
format,
@@ -194,7 +198,7 @@ xf86RotatePrepare (ScreenPtr pScreen)
if (!xf86_config->rotation_damage_registered)
{
/* Hook damage to screen pixmap */
- DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+ DamageRegister (&pScreen->root->drawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = TRUE;
EnableLimitedSchedulingLatency();
@@ -290,7 +294,7 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
}
for (c = 0; c < xf86_config->num_crtc; c++)
- if (xf86_config->crtc[c]->transform_in_use)
+ if (xf86_config->crtc[c]->rotatedData)
return;
/*
@@ -301,7 +305,7 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
/* Free damage structure */
if (xf86_config->rotation_damage_registered)
{
- DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+ DamageUnregister (&pScreen->root->drawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = FALSE;
DisableLimitedSchedulingLatency();
@@ -414,52 +418,73 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
}
else
{
- /*
- * these are the size of the shadow pixmap, which
- * matches the mode, not the pre-rotated copy in the
- * frame buffer
- */
- int width = crtc->mode.HDisplay;
- int height = crtc->mode.VDisplay;
- void *shadowData = crtc->rotatedData;
- PixmapPtr shadow = crtc->rotatedPixmap;
- int old_width = shadow ? shadow->drawable.width : 0;
- int old_height = shadow ? shadow->drawable.height : 0;
-
- /* Allocate memory for rotation */
- if (old_width != width || old_height != height)
- {
- if (shadow || shadowData)
+ if (crtc->driverIsPerformingTransform) {
+ xf86RotateDestroy(crtc);
+ } else {
+ /*
+ * these are the size of the shadow pixmap, which
+ * matches the mode, not the pre-rotated copy in the
+ * frame buffer
+ */
+ int width = crtc->mode.HDisplay;
+ int height = crtc->mode.VDisplay;
+ void *shadowData = crtc->rotatedData;
+ PixmapPtr shadow = crtc->rotatedPixmap;
+ int old_width = shadow ? shadow->drawable.width : 0;
+ int old_height = shadow ? shadow->drawable.height : 0;
+
+ /* Allocate memory for rotation */
+ if (old_width != width || old_height != height)
{
- crtc->funcs->shadow_destroy (crtc, shadow, shadowData);
- crtc->rotatedPixmap = NULL;
- crtc->rotatedData = NULL;
+ if (shadow || shadowData)
+ {
+ crtc->funcs->shadow_destroy (crtc, shadow, shadowData);
+ crtc->rotatedPixmap = NULL;
+ crtc->rotatedData = NULL;
+ }
+ shadowData = crtc->funcs->shadow_allocate (crtc, width, height);
+ if (!shadowData)
+ goto bail1;
+ crtc->rotatedData = shadowData;
+ /* shadow will be damaged in xf86RotatePrepare */
+ }
+ else
+ {
+ /* mark shadowed area as damaged so it will be repainted */
+ damage = TRUE;
}
- shadowData = crtc->funcs->shadow_allocate (crtc, width, height);
- if (!shadowData)
- goto bail1;
- crtc->rotatedData = shadowData;
- /* shadow will be damaged in xf86RotatePrepare */
- }
- else
- {
- /* mark shadowed area as damaged so it will be repainted */
- damage = TRUE;
- }
- if (!xf86_config->rotation_damage)
- {
- /* Create damage structure */
- xf86_config->rotation_damage = DamageCreate (NULL, NULL,
- DamageReportNone,
- TRUE, pScreen, pScreen);
if (!xf86_config->rotation_damage)
- goto bail2;
-
- /* Wrap block handler */
- if (!xf86_config->BlockHandler) {
- xf86_config->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = xf86RotateBlockHandler;
+ {
+ /* Create damage structure */
+ xf86_config->rotation_damage = DamageCreate (NULL, NULL,
+ DamageReportNone,
+ TRUE, pScreen, pScreen);
+ if (!xf86_config->rotation_damage)
+ goto bail2;
+
+ /* Wrap block handler */
+ if (!xf86_config->BlockHandler) {
+ xf86_config->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = xf86RotateBlockHandler;
+ }
+ }
+
+ if (0)
+ {
+ bail2:
+ if (shadow || shadowData)
+ {
+ crtc->funcs->shadow_destroy (crtc, shadow, shadowData);
+ crtc->rotatedPixmap = NULL;
+ crtc->rotatedData = NULL;
+ }
+ bail1:
+ if (old_width && old_height)
+ crtc->rotatedPixmap =
+ crtc->funcs->shadow_create (crtc, NULL, old_width,
+ old_height);
+ return FALSE;
}
}
#ifdef RANDR_12_INTERFACE
@@ -482,24 +507,6 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
}
}
#endif
-
- if (0)
- {
- bail2:
- if (shadow || shadowData)
- {
- crtc->funcs->shadow_destroy (crtc, shadow, shadowData);
- crtc->rotatedPixmap = NULL;
- crtc->rotatedData = NULL;
- }
- bail1:
- if (old_width && old_height)
- crtc->rotatedPixmap = crtc->funcs->shadow_create (crtc,
- NULL,
- old_width,
- old_height);
- return FALSE;
- }
crtc->transform_in_use = TRUE;
}
crtc->crtc_to_framebuffer = crtc_to_fb;