[PATCH 2/3] Set sprite transforms from RRSetCrtcConfigs

Keith Packard keithp at keithp.com
Sun Dec 5 21:05:49 PST 2010


These were getting ignored.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xfree86/modes/xf86RandR12.c |    4 ++--
 randr/mirrcrtc.c               |   23 +++++++++++++++--------
 randr/randrstr.h               |    6 ++++--
 randr/rrcrtc.c                 |   27 ++++++++++++---------------
 4 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index b0eabdd..dfe2cc3 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -1819,8 +1819,8 @@ xf86RRConvertCrtcConfig(xf86CrtcSetConfigPtr	xf86_config,
 	return FALSE;
     for (o = 0; o < rr_config->numOutputs; o++)
 	xf86_config->outputs[o] = rr_config->outputs[o]->devPrivate;
-    xf86_config->sprite_position_transform = rr_config->sprite_position_transform;
-    xf86_config->sprite_image_transform = rr_config->sprite_image_transform;
+    xf86_config->sprite_position_transform = rr_config->sprite_position_f_transform;
+    xf86_config->sprite_image_transform = rr_config->sprite_image_f_transform;
     xf86_config->pixmap = rr_config->pixmap;
     xf86_config->pixmap_x = rr_config->pixmap_x;
     xf86_config->pixmap_y = rr_config->pixmap_y;
diff --git a/randr/mirrcrtc.c b/randr/mirrcrtc.c
index cc76797..d493a0e 100644
--- a/randr/mirrcrtc.c
+++ b/randr/mirrcrtc.c
@@ -60,14 +60,21 @@ miRRSetCrtcConfig(RRCrtcConfigPtr crtc_config)
 	x = crtc_config->pixmap_x;
 	y = crtc_config->pixmap_y;
     }
-    return RRCrtcSet(crtc_config->crtc,
-		     crtc_config->mode,
-		     x,
-		     y,
-		     crtc_config->rotation,
-		     crtc_config->numOutputs,
-		     crtc_config->outputs,
-		     crtc_config->pixmap);
+    if (!RRCrtcSet(crtc_config->crtc,
+		   crtc_config->mode,
+		   x,
+		   y,
+		   crtc_config->rotation,
+		   crtc_config->numOutputs,
+		   crtc_config->outputs,
+		   crtc_config->pixmap))
+	return FALSE;
+    RRCrtcSpriteTransformSet(crtc_config->crtc,
+			     &crtc_config->sprite_position_transform,
+			     &crtc_config->sprite_image_transform,
+			     &crtc_config->sprite_position_f_transform,
+			     &crtc_config->sprite_image_f_transform);
+    return TRUE;
 }
 
 Bool
diff --git a/randr/randrstr.h b/randr/randrstr.h
index c231972..8240824 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -154,8 +154,10 @@ struct _rrCrtcConfig {
     Rotation			rotation;
     int				numOutputs;
     RROutputPtr			*outputs;
-    struct pict_f_transform	sprite_position_transform;
-    struct pict_f_transform	sprite_image_transform;
+    PictTransform		sprite_position_transform;
+    PictTransform		sprite_image_transform;
+    struct pict_f_transform	sprite_position_f_transform;
+    struct pict_f_transform	sprite_image_f_transform;
     PixmapPtr			pixmap;
     int				pixmap_x, pixmap_y;
 };
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 12982a8..0b2bc28 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -430,8 +430,10 @@ RRCrtcCurrentConfig(RRCrtcPtr crtc,
     if (!crtc_config->outputs)
 	return FALSE;
     memcpy(crtc_config->outputs, crtc->outputs, crtc->numOutputs * sizeof (RROutputPtr));
-    crtc_config->sprite_position_transform = crtc->client_sprite_f_position_transform;
-    crtc_config->sprite_image_transform = crtc->client_sprite_f_image_transform;
+    crtc_config->sprite_position_transform = crtc->client_sprite_position_transform;
+    crtc_config->sprite_image_transform = crtc->client_sprite_image_transform;
+    crtc_config->sprite_position_f_transform = crtc->client_sprite_f_position_transform;
+    crtc_config->sprite_image_f_transform = crtc->client_sprite_f_image_transform;
 
     /* XXX add pixmap stuff */
     crtc_config->pixmap = NULL;
@@ -718,8 +720,8 @@ RRScreenCoversCrtc(RRScreenConfigPtr screen_config,
 			crtc_config->mode->mode.width, crtc_config->mode->mode.height,
 			crtc_config->rotation,
 			client_transform,
-			&crtc_config->sprite_position_transform,
-			&crtc_config->sprite_image_transform,
+			&crtc_config->sprite_position_f_transform,
+			&crtc_config->sprite_image_f_transform,
 			NULL, &f_transform, NULL, NULL, NULL, NULL);
 
     RRModeGetScanoutSize (crtc_config->mode, &f_transform,
@@ -1469,15 +1471,6 @@ ProcRRGetCrtcTransform (ClientPtr client)
     return Success;
 }
 
-static void
-pixman_f_transform_from_xRenderTransform(struct pixman_f_transform *f_transform,
-					 xRenderTransform *x_transform)
-{
-    struct pixman_transform	transform;
-    PictTransform_from_xRenderTransform(&transform, x_transform);
-    pixman_f_transform_from_pixman_transform(f_transform, &transform);
-}
-
 static int
 RRConvertCrtcConfig(ClientPtr client, ScreenPtr screen,
 		    RRScreenConfigPtr screen_config,
@@ -1594,10 +1587,14 @@ RRConvertCrtcConfig(ClientPtr client, ScreenPtr screen,
     config->rotation = x->rotation;
     config->numOutputs = x->nOutput;
     config->outputs = outputs;
-    pixman_f_transform_from_xRenderTransform(&config->sprite_position_transform,
+    PictTransform_from_xRenderTransform(&config->sprite_position_transform,
 					     &x->spritePositionTransform);
-    pixman_f_transform_from_xRenderTransform(&config->sprite_image_transform,
+    PictTransform_from_xRenderTransform(&config->sprite_image_transform,
 					     &x->spriteImageTransform);
+    pixman_f_transform_from_pixman_transform(&config->sprite_position_f_transform,
+					     &config->sprite_position_transform);
+    pixman_f_transform_from_pixman_transform(&config->sprite_image_f_transform,
+					     &config->sprite_image_transform);
     config->pixmap = pixmap;
     config->pixmap_x = x->xPixmap;
     config->pixmap_y = x->yPixmap;
-- 
1.7.2.3



More information about the xorg-devel mailing list