From patchwork Wed Dec 7 12:18:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Starkey X-Patchwork-Id: 9464381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0D6BE60512 for ; Wed, 7 Dec 2016 12:18:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0045A284E2 for ; Wed, 7 Dec 2016 12:18:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E806F284F9; Wed, 7 Dec 2016 12:18:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8CF6D284E2 for ; Wed, 7 Dec 2016 12:18:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE7836E570; Wed, 7 Dec 2016 12:18:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by gabe.freedesktop.org (Postfix) with ESMTP id 99DF56E570 for ; Wed, 7 Dec 2016 12:18:25 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1BC51AD7; Wed, 7 Dec 2016 04:18:25 -0800 (PST) Received: from e106950-lin.cambridge.arm.com (e106950-lin.cambridge.arm.com [10.2.133.193]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CA073F477; Wed, 7 Dec 2016 04:18:24 -0800 (PST) From: Brian Starkey To: dri-devel@lists.freedesktop.org, ville.syrjala@linux.intel.com Subject: [PATCH] drm/atomic: Don't reject reflect-only rotations Date: Wed, 7 Dec 2016 12:18:19 +0000 Message-Id: <1481113099-4788-1-git-send-email-brian.starkey@arm.com> X-Mailer: git-send-email 1.7.9.5 Cc: liviu.dudau@arm.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The check to reject combinations of multiple rotation angles is overly restrictive and has the side-effect of also failing any rotation value which consists only of reflections. Fix this by relaxing the check to ignore values which contain no rotation flags. Fixes: 6e0c7c3358d4 ("drm/atomic: Reject attempts to use multiple rotation angles at once") Signed-off-by: Brian Starkey Reviewed-by: Gustavo Padovan --- drivers/gpu/drm/drm_atomic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 362e3ea..44f4030 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -846,7 +846,8 @@ int drm_atomic_plane_set_property(struct drm_plane *plane, } else if (property == config->prop_src_h) { state->src_h = val; } else if (property == plane->rotation_property) { - if (!is_power_of_2(val & DRM_ROTATE_MASK)) + if ((val & DRM_ROTATE_MASK) && + !is_power_of_2(val & DRM_ROTATE_MASK)) return -EINVAL; state->rotation = val; } else if (property == plane->zpos_property) {