From patchwork Fri Nov 23 05:54:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Terje Bergstrom X-Patchwork-Id: 1793901 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 A501F3FCDE for ; Fri, 23 Nov 2012 06:40:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5734E63C4 for ; Thu, 22 Nov 2012 22:40:15 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from hqemgate03.nvidia.com (hqemgate03.nvidia.com [216.228.121.140]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E87EE5C2F for ; Thu, 22 Nov 2012 21:50:33 -0800 (PST) Received: from hqnvupgp05.nvidia.com (Not Verified[216.228.121.13]) by hqemgate03.nvidia.com id ; Thu, 22 Nov 2012 21:53:27 -0800 Received: from hqemhub02.nvidia.com ([172.17.108.22]) by hqnvupgp05.nvidia.com (PGP Universal service); Thu, 22 Nov 2012 21:50:26 -0800 X-PGP-Universal: processed; by hqnvupgp05.nvidia.com on Thu, 22 Nov 2012 21:50:26 -0800 Received: from deemhub01.nvidia.com (10.21.69.137) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.279.1; Thu, 22 Nov 2012 21:50:25 -0800 Received: from [10.21.25.183] (10.21.65.27) by deemhub01.nvidia.com (10.21.69.137) with Microsoft SMTP Server id 8.3.279.1; Fri, 23 Nov 2012 06:50:23 +0100 Message-ID: <50AF0F7B.7080601@nvidia.com> Date: Fri, 23 Nov 2012 07:54:03 +0200 From: =?ISO-8859-1?Q?Terje_Bergstr=F6m?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: Thierry Reding Subject: Re: [PATCH] drm: tegra: Use framebuffer pitch as line stride References: <1353613037-15808-1-git-send-email-thierry.reding@avionic-design.de> In-Reply-To: <1353613037-15808-1-git-send-email-thierry.reding@avionic-design.de> X-Mailman-Approved-At: Thu, 22 Nov 2012 22:38:55 -0800 Cc: "linux-tegra@vger.kernel.org" , Dave Airlie , "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: , 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 On 22.11.2012 21:37, Thierry Reding wrote: > 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. Hi This might fix the issue we had with the stride when doing our 2D blitting on frame buffer. I'll test with your patch instead. We were using a different stride due to limitations of 2D unit, so we hacked this into our code: diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_he index fd9d0af..65b12ba 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -214,7 +214,7 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; - mode_cmd.pitches[0] = sizes->surface_width * bytes_per_pixel; + mode_cmd.pitches[0] = roundup(sizes->surface_width * bytes_per_pixel, 32); mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth); diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index b9e5a79..d70c488 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -219,7 +219,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 = roundup(win.outw * bpp, 32); /* program window registers */ value = tegra_dc_readl(dc, DC_CMD_DISPLAY_WINDOW_HEADER);