From patchwork Wed Aug 31 11:00:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1115492 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7VB0ZOU023798 for ; Wed, 31 Aug 2011 11:00:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755084Ab1HaLAh (ORCPT ); Wed, 31 Aug 2011 07:00:37 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:54384 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754997Ab1HaLAg (ORCPT ); Wed, 31 Aug 2011 07:00:36 -0400 Received: from localhost.localdomain (unknown [91.178.27.34]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C1BB035AAB; Wed, 31 Aug 2011 11:00:33 +0000 (UTC) From: Laurent Pinchart To: linux-fbdev@vger.kernel.org Cc: linux-sh@vger.kernel.org, magnus.damm@gmail.com, dhobsong@igel.co.jp Subject: [PATCH v2 5/8] fbdev: sh_mobile_lcdc: Update fix.line_length in .fb_set_par() Date: Wed, 31 Aug 2011 13:00:56 +0200 Message-Id: <1314788459-31791-6-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1314788459-31791-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1314788459-31791-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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 31 Aug 2011 11:00:38 +0000 (UTC) Instead of updating the fixed screen information line length manually after calling fb_set_var() in sh_mobile_fb_reconfig(), update the field in the .fb_set_par() operation handler. Signed-off-by: Laurent Pinchart --- drivers/video/sh_mobile_lcdcfb.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 1ff215c..b6da1d6 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -998,11 +998,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) /* Couldn't reconfigure, hopefully, can continue as before */ return; - if (info->var.nonstd) - info->fix.line_length = mode1.xres; - else - info->fix.line_length = mode1.xres * (ch->cfg.bpp / 8); - /* * fb_set_var() calls the notifier change internally, only if * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a @@ -1157,12 +1152,22 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in static int sh_mobile_set_par(struct fb_info *info) { struct sh_mobile_lcdc_chan *ch = info->par; + u32 line_length = info->fix.line_length; int ret; sh_mobile_lcdc_stop(ch->lcdc); + + if (info->var.nonstd) + info->fix.line_length = info->var.xres; + else + info->fix.line_length = info->var.xres + * info->var.bits_per_pixel / 8; + ret = sh_mobile_lcdc_start(ch->lcdc); - if (ret < 0) + if (ret < 0) { dev_err(info->dev, "%s: unable to restart LCDC\n", __func__); + info->fix.line_length = line_length; + } return ret; }