From patchwork Fri May 13 15:54:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 783462 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4DFswPZ015420 for ; Fri, 13 May 2011 15:54:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932753Ab1EMPyu (ORCPT ); Fri, 13 May 2011 11:54:50 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:40541 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932750Ab1EMPyr (ORCPT ); Fri, 13 May 2011 11:54:47 -0400 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 2C8531853B82; Fri, 13 May 2011 17:54:46 +0200 (CEST) X-Auth-Info: JOUso5kkhLoX5AdrurEGcZPbHyaJgrEzNp+/zwe9jBM= Received: from localhost (p4FDE7278.dip.t-dialin.net [79.222.114.120]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 327721C0009E; Fri, 13 May 2011 17:54:46 +0200 (CEST) From: Anatolij Gustschin To: linux-fbdev@vger.kernel.org Cc: Paul Mundt , Detlev Zundel Subject: [PATCH 1/5] video: mb862xxfb: correct fix.smem_len field initialization Date: Fri, 13 May 2011 17:54:45 +0200 Message-Id: <1305302089-7666-2-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1305302089-7666-1-git-send-email-agust@denx.de> References: <1305302089-7666-1-git-send-email-agust@denx.de> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 13 May 2011 15:54:59 +0000 (UTC) Initialize smem_len field to the actual frame buffer size and not to the whole video RAM size. This prevents overwriting other video memory (which could be used by other layers, cursors or accelerated drivers) by frame buffer applications relying on fix.smem_len. Signed-off-by: Anatolij Gustschin --- drivers/video/mb862xx/mb862xxfb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/video/mb862xx/mb862xxfb.c b/drivers/video/mb862xx/mb862xxfb.c index c76e663..8257958 100644 --- a/drivers/video/mb862xx/mb862xxfb.c +++ b/drivers/video/mb862xx/mb862xxfb.c @@ -336,7 +336,6 @@ static int mb862xxfb_init_fbinfo(struct fb_info *fbi) strcpy(fbi->fix.id, DRV_NAME); fbi->fix.smem_start = (unsigned long)par->fb_base_phys; - fbi->fix.smem_len = par->mapped_vram; fbi->fix.mmio_start = (unsigned long)par->mmio_base_phys; fbi->fix.mmio_len = par->mmio_len; fbi->fix.accel = FB_ACCEL_NONE; @@ -420,6 +419,7 @@ static int mb862xxfb_init_fbinfo(struct fb_info *fbi) FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; fbi->fix.line_length = (fbi->var.xres_virtual * fbi->var.bits_per_pixel) / 8; + fbi->fix.smem_len = fbi->fix.line_length * fbi->var.yres_virtual; return 0; }