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: 1403391 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D2A17402E1 for ; Tue, 4 Sep 2012 16:36:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932204Ab2IDQg0 (ORCPT ); Tue, 4 Sep 2012 12:36:26 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:33741 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757357Ab2IDQgZ (ORCPT ); Tue, 4 Sep 2012 12:36:25 -0400 Received: by ghrr11 with SMTP id r11so1286386ghr.19 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 Cc: patches@linaro.org, Greg KH , Tomi Valkeinen , Andy Gross , Rob Clark 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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); }