From patchwork Mon May 4 20:37:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Helt X-Patchwork-Id: 26858 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 2F9B1B6F56 for ; Tue, 5 May 2009 06:42:05 +1000 (EST) Received: by ozlabs.org (Postfix) id 945D5DDE23; Tue, 5 May 2009 06:42:02 +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 A1E19DDF11 for ; Tue, 5 May 2009 06:42:01 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752907AbZEDUl7 (ORCPT ); Mon, 4 May 2009 16:41:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753117AbZEDUl7 (ORCPT ); Mon, 4 May 2009 16:41:59 -0400 Received: from smtp239.poczta.interia.pl ([217.74.64.239]:19499 "EHLO smtp239.poczta.interia.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752907AbZEDUl6 (ORCPT ); Mon, 4 May 2009 16:41:58 -0400 Received: by smtp239.poczta.interia.pl (INTERIA.PL, from userid 502) id 7C97343002B; Mon, 4 May 2009 22:41:54 +0200 (CEST) Received: from poczta.interia.pl (mi04.poczta.interia.pl [10.217.12.4]) by smtp239.poczta.interia.pl (INTERIA.PL) with ESMTP id CE1584300A5; Mon, 4 May 2009 22:33:06 +0200 (CEST) Received: by poczta.interia.pl (INTERIA.PL, from userid 502) id 132E3142E98; Mon, 4 May 2009 22:33:06 +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 7CFE3142E85; Mon, 4 May 2009 22:33:04 +0200 (CEST) Date: Mon, 4 May 2009 22:37:46 +0200 From: Krzysztof Helt To: Linux-fbdev-devel , sparclinux Subject: [PATCH] cg3: use standard fields for framebuffer physical address and length Message-Id: <20090504223746.c204fb8c.krzysztof.h1@poczta.fm> X-Mailer: Sylpheed 2.4.3 (GTK+ 2.11.0; i686-pc-linux-gnu) Mime-Version: 1.0 X-EMID: c0b138 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/cg3.c linux-2.6.30/drivers/video/cg3.c --- linux-orig/drivers/video/cg3.c 2008-10-13 18:03:36.000000000 +0200 +++ linux-2.6.30/drivers/video/cg3.c 2009-05-04 00:49:43.000000000 +0200 @@ -118,9 +118,7 @@ struct cg3_par { #define CG3_FLAG_BLANKED 0x00000001 #define CG3_FLAG_RDI 0x00000002 - unsigned long physbase; unsigned long which_io; - unsigned long fbsize; }; /** @@ -231,17 +229,15 @@ static int cg3_mmap(struct fb_info *info struct cg3_par *par = (struct cg3_par *)info->par; return sbusfb_mmap_helper(cg3_mmap_map, - par->physbase, par->fbsize, + info->fix.smem_start, info->fix.smem_len, par->which_io, vma); } static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { - struct cg3_par *par = (struct cg3_par *) info->par; - return sbusfb_ioctl_helper(cmd, arg, info, - FBTYPE_SUN3COLOR, 8, par->fbsize); + FBTYPE_SUN3COLOR, 8, info->fix.smem_len); } /* @@ -368,7 +364,7 @@ static int __devinit cg3_probe(struct of spin_lock_init(&par->lock); - par->physbase = op->resource[0].start; + info->fix.smem_start = op->resource[0].start; par->which_io = op->resource[0].flags & IORESOURCE_BITS; sbusfb_fill_var(&info->var, dp, 8); @@ -382,7 +378,7 @@ static int __devinit cg3_probe(struct of 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); par->regs = of_ioremap(&op->resource[0], CG3_REGS_OFFSET, sizeof(struct cg3_regs), "cg3 regs"); @@ -392,7 +388,7 @@ static int __devinit cg3_probe(struct of info->flags = FBINFO_DEFAULT; info->fbops = &cg3_ops; info->screen_base = of_ioremap(&op->resource[0], CG3_RAM_OFFSET, - par->fbsize, "cg3 ram"); + info->fix.smem_len, "cg3 ram"); if (!info->screen_base) goto out_unmap_regs; @@ -418,7 +414,7 @@ static int __devinit cg3_probe(struct of dev_set_drvdata(&op->dev, info); printk(KERN_INFO "%s: cg3 at %lx:%lx\n", - dp->full_name, par->which_io, par->physbase); + dp->full_name, par->which_io, info->fix.smem_start); return 0; @@ -426,7 +422,7 @@ out_dealloc_cmap: fb_dealloc_cmap(&info->cmap); out_unmap_screen: - of_iounmap(&op->resource[0], info->screen_base, par->fbsize); + of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); out_unmap_regs: of_iounmap(&op->resource[0], par->regs, sizeof(struct cg3_regs)); @@ -447,7 +443,7 @@ static int __devexit cg3_remove(struct o fb_dealloc_cmap(&info->cmap); of_iounmap(&op->resource[0], par->regs, sizeof(struct cg3_regs)); - of_iounmap(&op->resource[0], info->screen_base, par->fbsize); + of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); framebuffer_release(info);