From patchwork Mon May 4 20:36:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Helt X-Patchwork-Id: 26861 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id E198AB6F56 for ; Tue, 5 May 2009 06:55:48 +1000 (EST) Received: by ozlabs.org (Postfix) id CC7E2DDDA9; Tue, 5 May 2009 06:55:48 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 72310DDDA0 for ; Tue, 5 May 2009 06:55:48 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754500AbZEDUzb (ORCPT ); Mon, 4 May 2009 16:55:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754178AbZEDUzb (ORCPT ); Mon, 4 May 2009 16:55:31 -0400 Received: from smtp239.poczta.interia.pl ([217.74.64.239]:17520 "EHLO smtp239.poczta.interia.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754500AbZEDUza (ORCPT ); Mon, 4 May 2009 16:55:30 -0400 Received: by smtp239.poczta.interia.pl (INTERIA.PL, from userid 502) id 5C6E7270579; Mon, 4 May 2009 22:55:29 +0200 (CEST) Received: from poczta.interia.pl (mi02.poczta.interia.pl [10.217.12.2]) by smtp239.poczta.interia.pl (INTERIA.PL) with ESMTP id BFFBD270815; Mon, 4 May 2009 22:32:09 +0200 (CEST) Received: by poczta.interia.pl (INTERIA.PL, from userid 502) id AE1032BC4E8; Mon, 4 May 2009 22:32:09 +0200 (CEST) Received: from krzysio.net (93-181-133-4.as.kn.pl [93.181.133.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by www.poczta.fm (INTERIA.PL) with ESMTP id 420B52BC528; Mon, 4 May 2009 22:32:08 +0200 (CEST) Date: Mon, 4 May 2009 22:36:50 +0200 From: Krzysztof Helt To: sparclinux , Linux-fbdev-devel Subject: [PATCH] cg14: use standard fields for framebuffer physical address and length Message-Id: <20090504223650.27f50a51.krzysztof.h1@poczta.fm> X-Mailer: Sylpheed 2.4.3 (GTK+ 2.11.0; i686-pc-linux-gnu) Mime-Version: 1.0 X-EMID: c8c0b138 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Krzysztof Helt Use standard fields fbinfo.fix.smem_start and fbinfo.fix.smem_len for physical address and length of framebuffer. This also fixes output of the 'fbset -i' command - address and length of the framebuffer is displayed correctly. Signed-off-by: Krzysztof Helt --- ---------------------------------------------------------------------- Wygraj wycieczke do Eurodisneylandu! Sprawdz >> http://link.interia.pl/f2153 -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -urp linux-orig/drivers/video/cg14.c linux-2.6.30/drivers/video/cg14.c --- linux-orig/drivers/video/cg14.c 2008-10-13 18:03:36.000000000 +0200 +++ linux-2.6.30/drivers/video/cg14.c 2009-05-04 00:47:24.000000000 +0200 @@ -196,9 +196,7 @@ struct cg14_par { u32 flags; #define CG14_FLAG_BLANKED 0x00000001 - unsigned long physbase; unsigned long iospace; - unsigned long fbsize; struct sbus_mmap_map mmap_map[CG14_MMAP_ENTRIES]; @@ -271,7 +269,7 @@ static int cg14_mmap(struct fb_info *inf struct cg14_par *par = (struct cg14_par *) info->par; return sbusfb_mmap_helper(par->mmap_map, - par->physbase, par->fbsize, + info->fix.smem_start, info->fix.smem_len, par->iospace, vma); } @@ -343,7 +341,8 @@ static int cg14_ioctl(struct fb_info *in default: ret = sbusfb_ioctl_helper(cmd, arg, info, - FBTYPE_MDICOLOR, 8, par->fbsize); + FBTYPE_MDICOLOR, 8, + info->fix.smem_len); break; }; @@ -462,7 +461,7 @@ static void cg14_unmap_regs(struct of_de par->cursor, sizeof(struct cg14_cursor)); if (info->screen_base) of_iounmap(&op->resource[1], - info->screen_base, par->fbsize); + info->screen_base, info->fix.smem_len); } static int __devinit cg14_probe(struct of_device *op, const struct of_device_id *match) @@ -488,14 +487,14 @@ static int __devinit cg14_probe(struct o linebytes = of_getintprop_default(dp, "linebytes", info->var.xres); - par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); + info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres); if (!strcmp(dp->parent->name, "sbus") || !strcmp(dp->parent->name, "sbi")) { - par->physbase = op->resource[0].start; + info->fix.smem_start = op->resource[0].start; par->iospace = op->resource[0].flags & IORESOURCE_BITS; } else { - par->physbase = op->resource[1].start; + info->fix.smem_start = op->resource[1].start; par->iospace = op->resource[0].flags & IORESOURCE_BITS; } @@ -507,7 +506,7 @@ static int __devinit cg14_probe(struct o sizeof(struct cg14_cursor), "cg14 cursor"); info->screen_base = of_ioremap(&op->resource[1], 0, - par->fbsize, "cg14 ram"); + info->fix.smem_len, "cg14 ram"); if (!par->regs || !par->clut || !par->cursor || !info->screen_base) goto out_unmap_regs; @@ -557,7 +556,7 @@ static int __devinit cg14_probe(struct o printk(KERN_INFO "%s: cgfourteen at %lx:%lx, %dMB\n", dp->full_name, - par->iospace, par->physbase, + par->iospace, info->fix.smem_start, par->ramsize >> 20); return 0;