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: 201242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BF0A62C007B for ; Fri, 23 Nov 2012 16:50:35 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327Ab2KWFue (ORCPT ); Fri, 23 Nov 2012 00:50:34 -0500 Received: from hqemgate03.nvidia.com ([216.228.121.140]:3074 "EHLO hqemgate03.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752298Ab2KWFue (ORCPT ); Fri, 23 Nov 2012 00:50:34 -0500 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 CC: Dave Airlie , "dri-devel@lists.freedesktop.org" , "linux-tegra@vger.kernel.org" , Marc Dietrich 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> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.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: --- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);