xf86-video-intel: 2 commits - src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Oct 9 07:43:54 PDT 2015


 src/sna/sna_display.c |   34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

New commits:
commit df72bc57610bb2f58eec9801820ea11628b244eb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Oct 9 15:40:58 2015 +0100

    sna: Avoid truncating the cursor when scaling up
    
    The affine_blt walks the destination image sampling from the source, so
    we need to walk all the output pixels and not the source size.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 554c270..a617218 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5405,14 +5405,14 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
 			if (transformed) {
 				affine_blt(image, cursor->image, 32,
 					   0, 0, width, height, size * 4,
-					   0, 0, width, height, size * 4,
+					   0, 0, size, size, size * 4,
 					   &to_sna_crtc(crtc)->cursor_to_fb);
 				image = cursor->image;
 			}
 		} else if (transformed) {
 			affine_blt(argb, cursor->image, 32,
 				   0, 0, width, height, width * 4,
-				   0, 0, width, height, size * 4,
+				   0, 0, size, size, size * 4,
 				   &to_sna_crtc(crtc)->cursor_to_fb);
 			image = cursor->image;
 		} else
commit 5793183c8247b42baa3c4577a3d84d554d589160
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Oct 9 15:17:58 2015 +0100

    sna: Compute rotation cursor transformation
    
    A confusion over the use of marking when we need to compute a
    transformed cursor image using pixman version when we need to compute
    transformed cursor coordinates meant that we failed to compute the
    required transformation after simply rotating the monitor.
    
    Should fix the regression from
    commit bbbcc4101ca01a5c8bec5169e47d703dd742494b
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Fri Sep 18 12:17:07 2015 +0100
    
        sna: Apply cursor hotspot transformation
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    References: https://bugs.archlinux.org/task/46606

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index a763d18..554c270 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5340,17 +5340,17 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
 
 		pixman_f_transform_bounds(&crtc->f_crtc_to_framebuffer, &box);
 		size = __cursor_size(box.x2 - box.x1, box.y2 - box.y1);
-
-		RRTransformCompute(0, 0,
-				   sna->cursor.ref->bits->width,
-				   sna->cursor.ref->bits->height,
-				   crtc->rotation, &crtc->transform,
-				   &cursor_to_fb,
-				   &to_sna_crtc(crtc)->cursor_to_fb,
-				   &to_sna_crtc(crtc)->fb_to_cursor);
 	} else
 		size = sna->cursor.size;
 
+	if (crtc->transform_in_use)
+                RRTransformCompute(0, 0, size, size,
+                                   crtc->rotation,
+                                   crtc->transformPresent ? &crtc->transform : NULL,
+                                   &cursor_to_fb,
+                                   &to_sna_crtc(crtc)->cursor_to_fb,
+                                   &to_sna_crtc(crtc)->fb_to_cursor);
+
 	cursor = to_sna_crtc(crtc)->cursor;
 	if (cursor && cursor->alloc < 4*size*size)
 		cursor = NULL;
@@ -5726,18 +5726,18 @@ sna_set_cursor_position(ScrnInfoPtr scrn, int x, int y)
 			int yhot = sna->cursor.ref->bits->yhot;
 			struct pict_f_vector v, hot;
 
-			v.v[0] = (x + xhot) + 0.5;
-			v.v[1] = (y + yhot) + 0.5;
-			v.v[2] = 1;
+			v.v[0] = x + xhot + .5;
+			v.v[1] = y + yhot + .5;
+			v.v[2] = 1.;
 			pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &v);
 
-			hot.v[0] = xhot + .5;
-			hot.v[1] = yhot + .5;
+			hot.v[0] = xhot;
+			hot.v[1] = yhot;
 			hot.v[2] = 1.;
 			pixman_f_transform_point(&sna_crtc->fb_to_cursor, &hot);
 
-			arg.x = floor(v.v[0]) - floor(hot.v[0]);
-			arg.y = floor(v.v[1]) - floor(hot.v[1]);
+			arg.x = floor(v.v[0] - hot.v[0]);
+			arg.y = floor(v.v[1] - hot.v[1]);
 		} else {
 			arg.x = x - crtc->x;
 			arg.y = y - crtc->y;


More information about the xorg-commit mailing list