LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Recognize video=gx1fb:... option
@ 2007-01-19 21:10 Alexey Dobriyan
  2007-01-24  8:48 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2007-01-19 21:10 UTC (permalink / raw)
  To: adaplas, akpm; +Cc: linux-kernel

Juergen Beisert reported that the following option doesn't work for him

	video=gx1fb:1024x768-16@60

though sisfb was able to parse similar option correctly.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 drivers/video/geode/gx1fb_core.c |   29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

--- a/drivers/video/geode/gx1fb_core.c
+++ b/drivers/video/geode/gx1fb_core.c
@@ -401,6 +401,30 @@ static void gx1fb_remove(struct pci_dev 
 	framebuffer_release(info);
 }
 
+#ifndef MODULE
+static void __init gx1fb_setup(char *options)
+{
+	char *this_opt;
+
+	if (!options || !*options)
+		return;
+
+	while ((this_opt = strsep(&options, ","))) {
+		if (!*this_opt)
+			continue;
+
+		if (!strncmp(this_opt, "mode:", 5))
+			strlcpy(mode_option, this_opt + 5, sizeof(mode_option));
+		else if (!strncmp(this_opt, "crt:", 4))
+			crt_option = !!simple_strtoul(this_opt + 4, NULL, 0);
+		else if (!strncmp(this_opt, "panel:", 6))
+			strlcpy(panel_option, this_opt + 6, sizeof(panel_option));
+		else
+			strlcpy(mode_option, this_opt, sizeof(mode_option));
+	}
+}
+#endif
+
 static struct pci_device_id gx1fb_id_table[] = {
 	{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_VIDEO,
 	  PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16,
@@ -420,8 +444,11 @@ static struct pci_driver gx1fb_driver = 
 static int __init gx1fb_init(void)
 {
 #ifndef MODULE
-	if (fb_get_options("gx1fb", NULL))
+	char *option = NULL;
+
+	if (fb_get_options("gx1fb", &option))
 		return -ENODEV;
+	gx1fb_setup(option);
 #endif
 	return pci_register_driver(&gx1fb_driver);
 }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Recognize video=gx1fb:... option
  2007-01-19 21:10 [PATCH] Recognize video=gx1fb:... option Alexey Dobriyan
@ 2007-01-24  8:48 ` Andrew Morton
  2007-01-24 15:51   ` [Linux-fbdev-devel] " Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-01-24  8:48 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: adaplas, linux-kernel, linux-fbdev-devel, Jordan Crouse

On Sat, 20 Jan 2007 00:10:51 +0300
Alexey Dobriyan <adobriyan@gmail.com> wrote:

> Juergen Beisert reported that the following option doesn't work for him
> 
> 	video=gx1fb:1024x768-16@60
> 
> though sisfb was able to parse similar option correctly.
> 

And does this patch fix it for him? ;)

> ---
> 
>  drivers/video/geode/gx1fb_core.c |   29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)
> 
> --- a/drivers/video/geode/gx1fb_core.c
> +++ b/drivers/video/geode/gx1fb_core.c
> @@ -401,6 +401,30 @@ static void gx1fb_remove(struct pci_dev 
>  	framebuffer_release(info);
>  }
>  
> +#ifndef MODULE
> +static void __init gx1fb_setup(char *options)
> +{
> +	char *this_opt;
> +
> +	if (!options || !*options)
> +		return;
> +
> +	while ((this_opt = strsep(&options, ","))) {
> +		if (!*this_opt)
> +			continue;
> +
> +		if (!strncmp(this_opt, "mode:", 5))
> +			strlcpy(mode_option, this_opt + 5, sizeof(mode_option));
> +		else if (!strncmp(this_opt, "crt:", 4))
> +			crt_option = !!simple_strtoul(this_opt + 4, NULL, 0);
> +		else if (!strncmp(this_opt, "panel:", 6))
> +			strlcpy(panel_option, this_opt + 6, sizeof(panel_option));
> +		else
> +			strlcpy(mode_option, this_opt, sizeof(mode_option));
> +	}
> +}
> +#endif
> +
>  static struct pci_device_id gx1fb_id_table[] = {
>  	{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_VIDEO,
>  	  PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16,
> @@ -420,8 +444,11 @@ static struct pci_driver gx1fb_driver = 
>  static int __init gx1fb_init(void)
>  {
>  #ifndef MODULE
> -	if (fb_get_options("gx1fb", NULL))
> +	char *option = NULL;
> +
> +	if (fb_get_options("gx1fb", &option))
>  		return -ENODEV;
> +	gx1fb_setup(option);
>  #endif
>  	return pci_register_driver(&gx1fb_driver);
>  }

Possibly this should go through Jordan's git-geode tree.  But that tree
seems to be kinda dead, so I'll file this under fbdev.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Linux-fbdev-devel] [PATCH] Recognize video=gx1fb:... option
  2007-01-24  8:48 ` Andrew Morton
@ 2007-01-24 15:51   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2007-01-24 15:51 UTC (permalink / raw)
  To: linux-fbdev-devel
  Cc: Andrew Morton, Alexey Dobriyan, adaplas, linux-kernel, Jordan Crouse

On Wed, 24 Jan 2007 00:48:26 -0800 Andrew Morton wrote:

> On Sat, 20 Jan 2007 00:10:51 +0300
> Alexey Dobriyan <adobriyan@gmail.com> wrote:
> 
> > Juergen Beisert reported that the following option doesn't work for him
> > 
> > 	video=gx1fb:1024x768-16@60
> > 
> > though sisfb was able to parse similar option correctly.
> > 
> 
> And does this patch fix it for him? ;)

Yes, Juergen replied to the patch:

Thank you very much. Yes it works. I tried these kernel parameters:

1) video=gx1fb:mode:1280x1024-16@60,crt:1
  -> CRT was active, 160x64 console
2) video=gx1fb:mode:1024x768-16@60,crt:1
  -> CRT was active, 128x48 console
3) video=gx1fb:mode:800x600-16@60,crt:0,panel:800x600
  -> CRT was disabled, 100x37 console
4) video=gx1fb:mode:1024x768-16@60,crt:0,panel:800x600
  -> CRT was disabled, 80x25 console

Sorry, I have no flatpanel, so I cannot test if the "panel" option works 
correctly. But somethings changes when I tried different values (see 3 and 
4).

Regards
Juergen


---
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-24 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-19 21:10 [PATCH] Recognize video=gx1fb:... option Alexey Dobriyan
2007-01-24  8:48 ` Andrew Morton
2007-01-24 15:51   ` [Linux-fbdev-devel] " Randy Dunlap

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).