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: 11167 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 692B823E00 for ; Tue, 4 Sep 2012 16:36:27 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 76F12A18B32 for ; Tue, 4 Sep 2012 16:35:36 +0000 (UTC) Received: by iafj25 with SMTP id j25so8623014iaf.11 for ; Tue, 04 Sep 2012 09:36:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=/FCXwC5N2Qm/amTEcbUXYOHDQ5wz5Wh8C07/oilRdpc=; b=BQHb2DrMP/EGgSJr6RxQ7tSkOzGmNcyquaSFmZDdqsON7IoDHA1GUB/8loZ6weiNaS Vm6+RVJqhG/+Jq9F5w7N9K9L0XQlG2HUQqc5bF5iJ5/9VzAUopKKN+mW6tacn+oil21O XBMWDU6pmIuWK9mphnmeAWE5R5oWDvwbHMsj1025CD7Q3Pa1Q22ryjP2Z7IPECauUqVq btohlh7NxmEW7aptTEdIpuuAcFdpAFH5ur35lrLfYn/fJptlTbcOublQ4tgmpetWfs3D +E5r67cWDr2jkRdcBSUs6oLoE2BzuEL/3RQPi7VivYEjiQH3wtt2omjJNXbua3yW+c2+ owFg== Received: by 10.50.7.212 with SMTP id l20mr14599757iga.43.1346776586505; Tue, 04 Sep 2012 09:36:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp201151igc; Tue, 4 Sep 2012 09:36:25 -0700 (PDT) Received: by 10.100.84.3 with SMTP id h3mr5805304anb.56.1346776585482; Tue, 04 Sep 2012 09:36:25 -0700 (PDT) Received: from mail-gg0-f178.google.com (mail-gg0-f178.google.com [209.85.161.178]) by mx.google.com with ESMTPS id r5si6229615ani.14.2012.09.04.09.36.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 09:36:25 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.161.178 as permitted sender) client-ip=209.85.161.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.161.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by ggeh3 with SMTP id h3so1278751gge.37 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) Sender: Rob Clark 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 X-Gm-Message-State: ALoCoQnHzd6FGd+YCzd0HrMCPnqmtwQO75aQNunZSoe3Ru/eI8mTTdlrWOMFAphh7n8TybEHe9ZX 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); }