From patchwork Tue Sep 4 16:36:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 1403401 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id B689D4025E for ; Tue, 4 Sep 2012 16:37:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B04EE9F009 for ; Tue, 4 Sep 2012 09:37:05 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f53.google.com (mail-yw0-f53.google.com [209.85.213.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E3819ECE0 for ; Tue, 4 Sep 2012 09:36:25 -0700 (PDT) Received: by mail-yw0-f53.google.com with SMTP id 3so1402092yhp.26 for ; Tue, 04 Sep 2012 09:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=/FCXwC5N2Qm/amTEcbUXYOHDQ5wz5Wh8C07/oilRdpc=; b=Mm7RZ4+zSeYfqbMx7l1q/N/yInkQRxiSk3rn3KR5m1xx8B56URRiai4ixNq/gXu2FL k8FxEFqYGe3ORrj6oa2RBCDEGUbx1cgW+VO8bXz6J+1B9EJ/Ax6K2iTQxXDLx9Op2Hmp MlukbKrNO1S0AowoKfGsF6bOoqpWE5on6Q23PLLiXEhX3NUQK6zUOmvOJ8qXguveWsaY DmHYGor3qnsoNuCzyIiDgitSohjP+PwEq8bqYPW5lWCuaZIS4fNVARBxSLXVUE0rZRp7 zebYIB0sU9cCnrjfH6ta+mfbYoJPc8NmSemSBxAQGKYTbRsyysNXWQ6R94pySBNBiR8w 8LRA== Received: by 10.236.133.243 with SMTP id q79mr18757334yhi.122.1346776585210; Tue, 04 Sep 2012 09:36:25 -0700 (PDT) Received: from localhost (ppp-70-129-131-42.dsl.rcsntx.swbell.net. [70.129.131.42]) by mx.google.com with ESMTPS id t57sm30711837yhg.0.2012.09.04.09.36.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 09:36:24 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org Subject: [PATCH 2/2] drm/omap: invert dimensions on crtc when rotated Date: Tue, 4 Sep 2012 11:36:20 -0500 Message-Id: <1346776580-13136-1-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 Cc: Greg KH , Rob Clark , patches@linaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Rob Clark If rotated 90 or 270, we need to invert the dimensions used by drm core for calculating if the dimensions of an attached fb are correct. Signed-off-by: Rob Clark --- drivers/staging/omapdrm/omap_crtc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c index 98a10bc..dade3de 100644 --- a/drivers/staging/omapdrm/omap_crtc.c +++ b/drivers/staging/omapdrm/omap_crtc.c @@ -195,6 +195,13 @@ static int omap_crtc_set_property(struct drm_crtc *crtc, struct drm_property *property, uint64_t val) { struct omap_crtc *omap_crtc = to_omap_crtc(crtc); + struct omap_drm_private *priv = crtc->dev->dev_private; + + if (property == priv->rotation_prop) { + crtc->invert_dimensions = + !!(val & ((1LL << DRM_ROTATE_90) | (1LL << DRM_ROTATE_270))); + } + return omap_plane_set_property(omap_crtc->plane, property, val); }