From patchwork Thu Nov 22 19:37:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1786661 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 3BD843FC64 for ; Thu, 22 Nov 2012 19:37:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 140F0436F1 for ; Thu, 22 Nov 2012 11:37:38 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E12AE5EC2 for ; Thu, 22 Nov 2012 11:37:25 -0800 (PST) Received: from mailbox.adnet.avionic-design.de (mailbox.avionic-design.de [109.75.18.3]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MSJh5-1Thpgq2FDP-00TRMN; Thu, 22 Nov 2012 20:37:19 +0100 Received: from localhost (localhost [127.0.0.1]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id DE3C42A280FD; Thu, 22 Nov 2012 20:37:18 +0100 (CET) X-Virus-Scanned: amavisd-new at avionic-design.de Received: from mailbox.adnet.avionic-design.de ([127.0.0.1]) by localhost (mailbox.avionic-design.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v6jfmxW0wcSK; Thu, 22 Nov 2012 20:37:17 +0100 (CET) Received: from localhost (avionic-0098.adnet.avionic-design.de [172.20.31.233]) (Authenticated sender: thierry.reding) by mailbox.adnet.avionic-design.de (Postfix) with ESMTPA id C628E2A280F1; Thu, 22 Nov 2012 20:37:17 +0100 (CET) From: Thierry Reding To: Dave Airlie Subject: [PATCH] drm: tegra: Use framebuffer pitch as line stride Date: Thu, 22 Nov 2012 20:37:17 +0100 Message-Id: <1353613037-15808-1-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.8.0 X-Provags-ID: V02:K0:Q/K25D5wUFLcFpfYFaBHnAW9XkfPixjpigIgBVPWyuX rnTTNyjWeHTi1FUFHFxaCeDWtoegoi5A4U/yRr4X0EmJ7DBZ4s qSbVfrIboakRkw4cjz6bmCcBrcy4qPhIMp/W+ns0nOpUIbozz+ IMkDLk+DkO/K/Fse6fDejh1kppff8CC+ZovPqQET/KzZKGbBr0 8539mdwMDIewkcj0vi+o4utl+5Fnrz2MrYMt4pk3JmbGaogTyB 7En/PJd/XYJDwv5kh2nmMA3deFc2ER3Sj2btSLbMH2L7weXF6Z MGcRuE6f9zxjEke2QhfS+Mkip4Dkb0IeEwBrnSDDJingVforrL 6S6mEdXrnhR1jUFIvZ1sqTm3Q3qA0plylXkyb8Ix9iR71/uj1z XDdkYRhV9DZ2OEpjk9OtusjYK5OFtO7eA04N7QcaUrnHTOPqaX /YNWP Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, Marc Dietrich 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 Instead of using the stride derived from the display mode, use the pitch associated with the currently active framebuffer. This fixes a bug where the LCD display content would be skewed when enabling HDMI with a video mode different from that of the LCD. Signed-off-by: Thierry Reding Tested-by: Terje Bergstrom Tested-by: Mark Zhang Tested-by: Stephen Warren --- drivers/gpu/drm/tegra/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 94686e5..41cde76 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -218,7 +218,7 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, } bpp = crtc->fb->bits_per_pixel / 8; - win.stride = win.outw * bpp; + win.stride = crtc->fb->pitches[0]; /* program window registers */ value = tegra_dc_readl(dc, DC_CMD_DISPLAY_WINDOW_HEADER);