From patchwork Thu Jul 19 00:39:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1213621 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E18C440D2D for ; Thu, 19 Jul 2012 00:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751064Ab2GSAjb (ORCPT ); Wed, 18 Jul 2012 20:39:31 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:52317 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752497Ab2GSAjZ (ORCPT ); Wed, 18 Jul 2012 20:39:25 -0400 Received: from avalon.ideasonboard.com (unknown [91.178.56.248]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 73CA735A8A; Thu, 19 Jul 2012 02:39:21 +0200 (CEST) From: Laurent Pinchart To: linux-fbdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 5/9] fbdev: sh_mobile_lcdc: Fix line pitch computation Date: Thu, 19 Jul 2012 02:39:18 +0200 Message-Id: <1342658362-19491-6-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1342658362-19491-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1342658362-19491-1-git-send-email-laurent.pinchart@ideasonboard.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Line pitch depends on the virtual horizontal resolution, compute it accordingly. Signed-off-by: Laurent Pinchart --- drivers/video/sh_mobile_lcdcfb.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 644c230..67877cc 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -1580,9 +1580,9 @@ static int sh_mobile_lcdc_overlay_set_par(struct fb_info *info) ovl->yres_virtual = info->var.yres_virtual; if (ovl->format->yuv) - ovl->pitch = info->var.xres; + ovl->pitch = info->var.xres_virtual; else - ovl->pitch = info->var.xres * ovl->format->bpp / 8; + ovl->pitch = info->var.xres_virtual * ovl->format->bpp / 8; sh_mobile_lcdc_overlay_setup(ovl); @@ -2024,9 +2024,9 @@ static int sh_mobile_lcdc_set_par(struct fb_info *info) ch->yres_virtual = info->var.yres_virtual; if (ch->format->yuv) - ch->pitch = info->var.xres; + ch->pitch = info->var.xres_virtual; else - ch->pitch = info->var.xres * ch->format->bpp / 8; + ch->pitch = info->var.xres_virtual * ch->format->bpp / 8; ret = sh_mobile_lcdc_start(ch->lcdc); if (ret < 0) @@ -2539,9 +2539,9 @@ sh_mobile_lcdc_overlay_init(struct sh_mobile_lcdc_priv *priv, ovl->yres_virtual = ovl->yres * 2; if (!format->yuv) - ovl->pitch = ovl->xres * format->bpp / 8; + ovl->pitch = ovl->xres_virtual * format->bpp / 8; else - ovl->pitch = ovl->xres; + ovl->pitch = ovl->xres_virtual; /* Allocate frame buffer memory. */ ovl->fb_size = ovl->cfg->max_xres * ovl->cfg->max_yres @@ -2628,10 +2628,10 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv, if (!format->yuv) { ch->colorspace = V4L2_COLORSPACE_SRGB; - ch->pitch = ch->xres * format->bpp / 8; + ch->pitch = ch->xres_virtual * format->bpp / 8; } else { ch->colorspace = V4L2_COLORSPACE_REC709; - ch->pitch = ch->xres; + ch->pitch = ch->xres_virtual; } ch->display.width = cfg->panel_cfg.width;