From patchwork Sat Apr 5 18:33:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 3943571 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE5409F38E for ; Sun, 6 Apr 2014 15:48:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 245FF20386 for ; Sun, 6 Apr 2014 15:48:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2F12920398 for ; Sun, 6 Apr 2014 15:48:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98A616E3AD; Sun, 6 Apr 2014 08:48:16 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F5236E2A8 for ; Sat, 5 Apr 2014 11:33:54 -0700 (PDT) Received: by mail-we0-f175.google.com with SMTP id q58so4834829wes.6 for ; Sat, 05 Apr 2014 11:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=LG6xclBA6bQ5m49SQUS6Us/0Ock+YITUUXVKDWtWcQk=; b=Vy/g/P7OSzdC+QwcrmdKEuhyKZ6ktmAtj4ixvngWPtVv+tFTMkQKsrcB34IW34RZQZ +MBR4MWn3m+PRwDlF/Z0tv86f2cb61qbPqiafa90PA4QJOIH/RVpLcuou4q+XXcWQDdv 18nOkZdGIxo5i58BzZZ9bxZ33XGu6j8V/80Hlf5MgqXW6RpKpKPygfjiPsCsHnGT3Zx+ viblflDcEzmRs7i7R9AZZbAMKjVTILKno/OrxgHqDt6kGv81/nRaAeaqxCCARt2Cx/2X JDq9z5xxer72O6imXrF/WEeQdnvmvTP5Y4IEuhak081x4eBB5m0ZiOi3yEfOaffYk1kS 6/hg== X-Received: by 10.180.89.211 with SMTP id bq19mr13593131wib.58.1396722833534; Sat, 05 Apr 2014 11:33:53 -0700 (PDT) Received: from localhost.localdomain (ip-88-119-226-136.static.b4net.lt. [88.119.226.136]) by mx.google.com with ESMTPSA id t44sm28790156eeo.6.2014.04.05.11.33.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 05 Apr 2014 11:33:52 -0700 (PDT) From: Grazvydas Ignotas To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/omap: fix plane rotation Date: Sat, 5 Apr 2014 21:33:51 +0300 Message-Id: <1396722831-22761-1-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-Mailman-Approved-At: Sun, 06 Apr 2014 08:48:15 -0700 Cc: Grazvydas Ignotas X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Plane rotation with omapdrm is currently broken. It seems omap_plane_mode_set() expects width and height in screen coordinates, so pass it like that. Cc: Rob Clark Signed-off-by: Grazvydas Ignotas Reviewed-by: Rob Clark --- drivers/gpu/drm/omapdrm/omap_plane.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index 370580c..5611f15 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -253,6 +253,14 @@ static int omap_plane_update(struct drm_plane *plane, drm_framebuffer_reference(fb); + /* omap_plane_mode_set() takes adjusted src */ + switch (omap_plane->win.rotation & 0xf) { + case BIT(DRM_ROTATE_90): + case BIT(DRM_ROTATE_270): + swap(src_w, src_h); + break; + } + return omap_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h,