All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Paauwe <bob.j.paauwe@intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: [PATCH] sna: Fix the reduction of xy reflection onto rotations.
Date: Thu, 13 Aug 2015 16:51:37 -0700	[thread overview]
Message-ID: <1439509897-12151-1-git-send-email-bob.j.paauwe@intel.com> (raw)

When reducing a xy reflection to a 180 degree rotation, make sure
only one rotation bit is set.  Also by rotating the bit left, we
can support cases where xy reflection happens with 90/270 degree
rotation.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 src/sna/sna_display.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5b975c1..c8c2197 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1007,6 +1007,8 @@ static unsigned
 rotation_reduce(struct plane *p, unsigned rotation)
 {
 	unsigned unsupported_rotations = rotation & ~p->rotation.supported;
+	unsigned rr_mask = (RR_Rotate_0 | RR_Rotate_90 |
+			    RR_Rotate_180 | RR_Rotate_270);
 
 	if (unsupported_rotations == 0)
 		return rotation;
@@ -1016,7 +1018,8 @@ rotation_reduce(struct plane *p, unsigned rotation)
 	if ((unsupported_rotations & RR_Reflect_XY) == RR_Reflect_XY &&
 	    p->rotation.supported& RR_Rotate_180) {
 		rotation &= ~RR_Reflect_XY;
-		rotation ^= RR_Rotate_180;
+		rotation = ((rotation << 2 & rr_mask) |
+			    (((rotation << 2) & ~rr_mask) >> 4));
 	}
 
 	if ((unsupported_rotations & RR_Rotate_180) &&
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2015-08-13 23:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 23:51 Bob Paauwe [this message]
2015-08-14  8:18 ` [PATCH] sna: Fix the reduction of xy reflection onto rotations Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439509897-12151-1-git-send-email-bob.j.paauwe@intel.com \
    --to=bob.j.paauwe@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.