From patchwork Thu Aug 13 23:51:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paauwe, Bob J" X-Patchwork-Id: 7011521 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 108609F39D for ; Thu, 13 Aug 2015 23:49:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 44CA020708 for ; Thu, 13 Aug 2015 23:49:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D091F20705 for ; Thu, 13 Aug 2015 23:49:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0DCE6E0FC; Thu, 13 Aug 2015 16:49:51 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E85B6E0FC for ; Thu, 13 Aug 2015 16:49:50 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 13 Aug 2015 16:49:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,673,1432623600"; d="scan'208";a="748240267" Received: from bpaauwe-desk.fm.intel.com ([10.1.134.218]) by orsmga001.jf.intel.com with ESMTP; 13 Aug 2015 16:49:49 -0700 From: Bob Paauwe To: intel-gfx Date: Thu, 13 Aug 2015 16:51:37 -0700 Message-Id: <1439509897-12151-1-git-send-email-bob.j.paauwe@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [Intel-gfx] [PATCH] sna: Fix the reduction of xy reflection onto rotations. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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) &&