linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ondrej Zajicek <santiago@crfreenet.org>
To: Jordan Crouse <jordan.crouse@amd.com>
Cc: akpm@linux-foundation.org,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, info-linux@geode.amd.com
Subject: Re: [GEODE] Add framebuffer support for the AMD Geode LX
Date: Tue, 10 Jul 2007 19:50:39 +0200	[thread overview]
Message-ID: <20070710175039.GB32055@localhost.localdomain> (raw)
In-Reply-To: <20070709173211.GA6157@cosmic.amd.com>


[-- Attachment #1.1: Type: text/plain, Size: 3350 bytes --]

On Mon, Jul 09, 2007 at 11:32:11AM -0600, Jordan Crouse wrote:
> +const struct fb_videomode geode_modedb[] __initdata = {
> +	/* 640x480-60 */
> +	{ NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2,
> +	  FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> +	  FB_VMODE_NONINTERLACED, 0 },
> +	/* 640x400-70 */
> +	{ NULL, 70, 640, 400, 39770, 40, 8, 28, 5, 96, 2,
> +	  FB_SYNC_HOR_HIGH_ACT,
> +	  FB_VMODE_NONINTERLACED, 0 },
> +	/* 640x480-70 */

This looks like standard timings, is there any reason why not
use modes from modedb.c?

> +static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
> +{
> +	if (var->xres > 1920 || var->yres > 1440)
> +		return -EINVAL;
> +
> +	if (var->bits_per_pixel == 32) {
> +		var->red.offset   = 16; var->red.length   = 8;
> +		var->green.offset =  8; var->green.length = 8;
> +		var->blue.offset  =  0; var->blue.length  = 8;
> +	} else if (var->bits_per_pixel == 16) {
> +		var->red.offset   = 11; var->red.length   = 5;
> +		var->green.offset =  5; var->green.length = 6;
> +		var->blue.offset  =  0; var->blue.length  = 5;
> +	} else if (var->bits_per_pixel == 8) {
> +		var->red.offset   = 0; var->red.length   = 8;
> +		var->green.offset = 0; var->green.length = 8;
> +		var->blue.offset  = 0; var->blue.length  = 8;
> +	} else
> +		return -EINVAL;

Clear var->{color}.msb_right ?

If don't support panning, it should ensure that
xres_virtual == xres and yres_virtual == yres

> +static int __init lxfb_map_video_memory(struct fb_info *info,
> +					struct pci_dev *dev)
> +{
> +	struct lxfb_par *par = info->par;
> +	int ret;
> +
> +	ret = pci_enable_device(dev);
> +
> +	if (ret)
> +		return ret;
> +
> +	ret = pci_request_region(dev, 0, "lxfb-framebuffer");
> +
> +	if (ret)
> +		return ret;
> +
> +	ret = pci_request_region(dev, 1, "lxfb-gp");
> +
> +	if (ret)
> +		return ret;
> +
...

Free allocated regions in a case of a error?

> +
> +	ret = -ENOMEM;
> +
> +	if (info->screen_base == NULL)
> +		return ret;
> +
> +	par->gp_regs = ioremap(pci_resource_start(dev, 1),
> +				pci_resource_len(dev, 1));

pci_iomap(dev, 1, 0) ?

> +static struct fb_info * __init lxfb_init_fbinfo(struct device *dev)
> +{
> +	struct lxfb_par *par;
> +	struct fb_info *info;
> +
> +	/* Alloc enough space for the pseudo palette. */
> +	info = framebuffer_alloc(sizeof(struct lxfb_par) + sizeof(u32) * 16,
> +				 dev);

What about adding u32 pseudo_palette[16] at the end of struct lxfb_par
instead of that trick?

> +module_param(mode_option, charp, 0);
> +MODULE_PARM_DESC(mode_option, "video mode (<x>x<y>[-<bpp>][@<refr>])");
> +
> +module_param(fbsize, int, 0);
> +MODULE_PARM_DESC(fbsize, "video memory size");

What about adding module params for noclear, nopanel and nocrt ?


> +static void lx_set_clock(struct fb_info *info)
> +{
> +	unsigned int diff, min, best = 0;
> +	unsigned int freq, i;
> +
> +	freq = (unsigned int) (0x3b9aca00 / info->var.pixclock);

Here using 0x3b9aca00 instead of 1000000000 is obscuring.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org, jabber: santiago@njs.netlab.cz)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 182 bytes --]

_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

  reply	other threads:[~2007-07-10 17:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09 17:32 [GEODE] Add framebuffer support for the AMD Geode LX Jordan Crouse
2007-07-10 17:50 ` Ondrej Zajicek [this message]
2007-07-11 20:51   ` Antonino A. Daplas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070710175039.GB32055@localhost.localdomain \
    --to=santiago@crfreenet.org \
    --cc=akpm@linux-foundation.org \
    --cc=info-linux@geode.amd.com \
    --cc=jordan.crouse@amd.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).