public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] add-imacfb-docu-and-detection.patch
@ 2006-07-31  8:25 Edgar Hucek
  2006-07-31 15:51 ` Olaf Hering
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Edgar Hucek @ 2006-07-31  8:25 UTC (permalink / raw)
  To: LKML, Linus Torvalds, akpm

This Patch add basic Machine detection to imacfb and
some Ducumentation bits for imacfb.

Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>


diff -uNr linux-2.6.18-rc2/Documentation/fb/imacfb.txt linux-2.6.18-rc2.mactel/Documentation/fb/imacfb.txt
--- linux-2.6.18-rc2/Documentation/fb/imacfb.txt	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.18-rc2.mactel/Documentation/fb/imacfb.txt	2006-07-26 20:54:07.000000000 +0200
@@ -0,0 +1,31 @@
+
+What is imacfb?
+===============
+
+This is a generic EFI platform driver for Intel based Apple computers.
+Imacfb is only for EFI booted Intel Macs.
+
+Supported Hardware
+==================
+
+iMac 17"/20"
+Macbook
+Macbook Pro 15"/17"
+MacMini
+
+How to use it?
+==============
+
+Imacfb does not have any kind of autodetection of your machine.
+You have to add the fillowing kernel parameters in your elilo.conf:
+	Macbook :
+		video=imacfb:macbook
+	MacMini :
+		video=imacfb:mini
+	Macbook Pro 15", iMac 17" :
+		video=imacfb:i17
+	Macbook Pro 17", iMac 20" :
+		video=imacfb:i20
+
+--
+Edgar Hucek <gimli@dark-green.com>
diff -uNr linux-2.6.18-rc2/drivers/video/imacfb.c linux-2.6.18-rc2.mactel/drivers/video/imacfb.c
--- linux-2.6.18-rc2/drivers/video/imacfb.c	2006-07-16 10:38:27.000000000 +0200
+++ linux-2.6.18-rc2.mactel/drivers/video/imacfb.c	2006-07-25 13:53:35.000000000 +0200
@@ -18,6 +18,8 @@
 #include <linux/screen_info.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/dmi.h>
+#include <linux/efi.h>
 
 #include <asm/io.h>
 
@@ -28,7 +30,7 @@
 	M_I20,
 	M_MINI,
 	M_MACBOOK,
-	M_NEW
+	M_UNKNOWN
 } MAC_TYPE;
 
 /* --------------------------------------------------------------------- */
@@ -52,10 +54,36 @@
 };
 
 static int inverse;
-static int model		= M_NEW;
+static int model		= M_UNKNOWN;
 static int manual_height;
 static int manual_width;
 
+static int set_system(struct dmi_system_id *id)
+{
+	printk(KERN_INFO "imacfb: %s detected - set system to %ld\n",
+		id->ident, (long)id->driver_data);
+	
+	model = (long)id->driver_data;
+	
+	return 0;
+}
+
+static struct dmi_system_id __initdata dmi_system_table[] = {
+	{ set_system, "iMac4,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_BIOS_VERSION,"iMac4,1") }, (void*)M_I17},
+	{ set_system, "MacBookPro1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_BIOS_VERSION,"MacBookPro1,1") }, (void*)M_I17},
+	{ set_system, "MacBook1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_PRODUCT_NAME,"MacBook1,1")}, (void *)M_MACBOOK},
+	{ set_system, "Macmini1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_PRODUCT_NAME,"Macmini1,1")}, (void *)M_MINI},
+	{},
+};
+
 #define	DEFAULT_FB_MEM	1024*1024*16
 
 /* --------------------------------------------------------------------- */
@@ -149,7 +177,6 @@
 		screen_info.lfb_linelength = 1472 * 4;
 		screen_info.lfb_base = 0x80010000;
 		break;
-	case M_NEW:
 	case M_I20:
 		screen_info.lfb_width = 1680;
 		screen_info.lfb_height = 1050;
@@ -207,6 +234,10 @@
 		size_remap = size_total;
 	imacfb_fix.smem_len = size_remap;
 
+#ifndef __i386__
+	screen_info.imacpm_seg = 0;
+#endif
+
 	if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) {
 		printk(KERN_WARNING
 		       "imacfb: cannot reserve video memory at 0x%lx\n",
@@ -324,8 +355,16 @@
 	int ret;
 	char *option = NULL;
 
-	/* ignore error return of fb_get_options */
-	fb_get_options("imacfb", &option);
+	if (!efi_enabled)
+		return -ENODEV;
+	if (!dmi_check_system(dmi_system_table))
+		return -ENODEV;
+	if (model == M_UNKNOWN)
+		return -ENODEV;
+
+	if (fb_get_options("imacfb", &option))
+		return -ENODEV;
+
 	imacfb_setup(option);
 	ret = platform_driver_register(&imacfb_driver);
 
diff -uNr linux-2.6.18-rc2/drivers/video/Kconfig linux-2.6.18-rc2.mactel/drivers/video/Kconfig
--- linux-2.6.18-rc2/drivers/video/Kconfig	2006-07-16 10:38:27.000000000 +0200
+++ linux-2.6.18-rc2.mactel/drivers/video/Kconfig	2006-07-25 13:30:55.000000000 +0200
@@ -552,7 +552,7 @@
 
 config FB_IMAC
 	bool "Intel-based Macintosh Framebuffer Support"
-	depends on (FB = y) && X86
+	depends on (FB = y) && X86 && EFI
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT



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

* Re: [PATCH 1/3] add-imacfb-docu-and-detection.patch
  2006-07-31  8:25 [PATCH 1/3] add-imacfb-docu-and-detection.patch Edgar Hucek
@ 2006-07-31 15:51 ` Olaf Hering
  2006-07-31 18:35   ` Randy.Dunlap
  2006-07-31 19:32 ` Joseph Fannin
  2006-08-01  9:33 ` Andrey Panin
  2 siblings, 1 reply; 7+ messages in thread
From: Olaf Hering @ 2006-07-31 15:51 UTC (permalink / raw)
  To: Edgar Hucek; +Cc: LKML, Linus Torvalds, akpm

 On Mon, Jul 31, Edgar Hucek wrote:

> This Patch add basic Machine detection to imacfb and
> some Ducumentation bits for imacfb.

> +Supported Hardware
> +==================
> +
> +iMac 17"/20"
> +Macbook
> +Macbook Pro 15"/17"
> +MacMini

Why is it called imacfb when it is supposed to drive castrated PowerBooks?
I suggest a better name for driver.

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

* Re: [PATCH 1/3] add-imacfb-docu-and-detection.patch
  2006-07-31 15:51 ` Olaf Hering
@ 2006-07-31 18:35   ` Randy.Dunlap
  0 siblings, 0 replies; 7+ messages in thread
From: Randy.Dunlap @ 2006-07-31 18:35 UTC (permalink / raw)
  To: Olaf Hering; +Cc: hostmaster, linux-kernel, torvalds, akpm

On Mon, 31 Jul 2006 17:51:45 +0200 Olaf Hering wrote:

>  On Mon, Jul 31, Edgar Hucek wrote:
> 
> > This Patch add basic Machine detection to imacfb and
> > some Ducumentation bits for imacfb.
> 
> > +Supported Hardware
> > +==================
> > +
> > +iMac 17"/20"
> > +Macbook
> > +Macbook Pro 15"/17"
> > +MacMini
> 
> Why is it called imacfb when it is supposed to drive castrated PowerBooks?

is that a technical comment?  sounds personal.

> I suggest a better name for driver.


---
~Randy

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

* Re: [PATCH 1/3] add-imacfb-docu-and-detection.patch
  2006-07-31  8:25 [PATCH 1/3] add-imacfb-docu-and-detection.patch Edgar Hucek
  2006-07-31 15:51 ` Olaf Hering
@ 2006-07-31 19:32 ` Joseph Fannin
  2006-07-31 19:49   ` Edgar Hucek
  2006-07-31 23:44   ` Antonino A. Daplas
  2006-08-01  9:33 ` Andrey Panin
  2 siblings, 2 replies; 7+ messages in thread
From: Joseph Fannin @ 2006-07-31 19:32 UTC (permalink / raw)
  To: Edgar Hucek; +Cc: LKML, Linus Torvalds, akpm

On Mon, Jul 31, 2006 at 10:25:01AM +0200, Edgar Hucek wrote:
> This Patch add basic Machine detection to imacfb and
> some Ducumentation bits for imacfb.

> +Imacfb does not have any kind of autodetection of your machine.
> +You have to add the fillowing kernel parameters in your elilo.conf:
> +	Macbook :
> +		video=imacfb:macbook
> +	MacMini :
> +		video=imacfb:mini
> +	Macbook Pro 15", iMac 17" :
> +		video=imacfb:i17
> +	Macbook Pro 17", iMac 20" :
> +		video=imacfb:i20

> -	/* ignore error return of fb_get_options */
> -	fb_get_options("imacfb", &option);
> +	if (!efi_enabled)
> +		return -ENODEV;
> +	if (!dmi_check_system(dmi_system_table))
> +		return -ENODEV;
> +	if (model == M_UNKNOWN)
> +		return -ENODEV;

    So imacfb now defaults to off?  That would be good, especially
since it cannot be a module, and doesn't work with the Apple "BIOS"
stuff.

    If not, a video=imacfb:off option would be much appreciated.

--
Joseph Fannin
jfannin@gmail.com


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

* Re: [PATCH 1/3] add-imacfb-docu-and-detection.patch
  2006-07-31 19:32 ` Joseph Fannin
@ 2006-07-31 19:49   ` Edgar Hucek
  2006-07-31 23:44   ` Antonino A. Daplas
  1 sibling, 0 replies; 7+ messages in thread
From: Edgar Hucek @ 2006-07-31 19:49 UTC (permalink / raw)
  To: Edgar Hucek, LKML, Linus Torvalds, akpm

Joseph Fannin schrieb:
> On Mon, Jul 31, 2006 at 10:25:01AM +0200, Edgar Hucek wrote:
>> This Patch add basic Machine detection to imacfb and
>> some Ducumentation bits for imacfb.
> 
>> +Imacfb does not have any kind of autodetection of your machine.
>> +You have to add the fillowing kernel parameters in your elilo.conf:
>> +	Macbook :
>> +		video=imacfb:macbook
>> +	MacMini :
>> +		video=imacfb:mini
>> +	Macbook Pro 15", iMac 17" :
>> +		video=imacfb:i17
>> +	Macbook Pro 17", iMac 20" :
>> +		video=imacfb:i20
> 
>> -	/* ignore error return of fb_get_options */
>> -	fb_get_options("imacfb", &option);
>> +	if (!efi_enabled)
>> +		return -ENODEV;
>> +	if (!dmi_check_system(dmi_system_table))
>> +		return -ENODEV;
>> +	if (model == M_UNKNOWN)
>> +		return -ENODEV;
> 
>     So imacfb now defaults to off?  That would be good, especially
> since it cannot be a module, and doesn't work with the Apple "BIOS"
> stuff.
> 
>     If not, a video=imacfb:off option would be much appreciated.

Yes. Imacfb only works when efi an efi boot is detected and a supported
Apple device is found.

cu

Edgar Hucek

> --
> Joseph Fannin
> jfannin@gmail.com
> 
> 


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

* Re: [PATCH 1/3] add-imacfb-docu-and-detection.patch
  2006-07-31 19:32 ` Joseph Fannin
  2006-07-31 19:49   ` Edgar Hucek
@ 2006-07-31 23:44   ` Antonino A. Daplas
  1 sibling, 0 replies; 7+ messages in thread
From: Antonino A. Daplas @ 2006-07-31 23:44 UTC (permalink / raw)
  To: Edgar Hucek, LKML, Linus Torvalds, akpm

Joseph Fannin wrote:
> On Mon, Jul 31, 2006 at 10:25:01AM +0200, Edgar Hucek wrote:
> 
>     So imacfb now defaults to off?  That would be good, especially
> since it cannot be a module, and doesn't work with the Apple "BIOS"
> stuff.
> 
>     If not, a video=imacfb:off option would be much appreciated.

Yes, this patch will support the above option too.

Tony

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

* Re: [PATCH 1/3] add-imacfb-docu-and-detection.patch
  2006-07-31  8:25 [PATCH 1/3] add-imacfb-docu-and-detection.patch Edgar Hucek
  2006-07-31 15:51 ` Olaf Hering
  2006-07-31 19:32 ` Joseph Fannin
@ 2006-08-01  9:33 ` Andrey Panin
  2 siblings, 0 replies; 7+ messages in thread
From: Andrey Panin @ 2006-08-01  9:33 UTC (permalink / raw)
  To: Edgar Hucek; +Cc: LKML, Linus Torvalds, akpm

[-- Attachment #1: Type: text/plain, Size: 5176 bytes --]

On 212, 07 31, 2006 at 10:25:01AM +0200, Edgar Hucek wrote:
> This Patch add basic Machine detection to imacfb and
> some Ducumentation bits for imacfb.
> 
> Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>
> 
> 
> diff -uNr linux-2.6.18-rc2/Documentation/fb/imacfb.txt linux-2.6.18-rc2.mactel/Documentation/fb/imacfb.txt
> --- linux-2.6.18-rc2/Documentation/fb/imacfb.txt	1970-01-01 01:00:00.000000000 +0100
> +++ linux-2.6.18-rc2.mactel/Documentation/fb/imacfb.txt	2006-07-26 20:54:07.000000000 +0200
> @@ -0,0 +1,31 @@
> +
> +What is imacfb?
> +===============
> +
> +This is a generic EFI platform driver for Intel based Apple computers.
> +Imacfb is only for EFI booted Intel Macs.
> +
> +Supported Hardware
> +==================
> +
> +iMac 17"/20"
> +Macbook
> +Macbook Pro 15"/17"
> +MacMini
> +
> +How to use it?
> +==============
> +
> +Imacfb does not have any kind of autodetection of your machine.
> +You have to add the fillowing kernel parameters in your elilo.conf:
> +	Macbook :
> +		video=imacfb:macbook
> +	MacMini :
> +		video=imacfb:mini
> +	Macbook Pro 15", iMac 17" :
> +		video=imacfb:i17
> +	Macbook Pro 17", iMac 20" :
> +		video=imacfb:i20
> +
> +--
> +Edgar Hucek <gimli@dark-green.com>
> diff -uNr linux-2.6.18-rc2/drivers/video/imacfb.c linux-2.6.18-rc2.mactel/drivers/video/imacfb.c
> --- linux-2.6.18-rc2/drivers/video/imacfb.c	2006-07-16 10:38:27.000000000 +0200
> +++ linux-2.6.18-rc2.mactel/drivers/video/imacfb.c	2006-07-25 13:53:35.000000000 +0200
> @@ -18,6 +18,8 @@
>  #include <linux/screen_info.h>
>  #include <linux/slab.h>
>  #include <linux/string.h>
> +#include <linux/dmi.h>
> +#include <linux/efi.h>
>  
>  #include <asm/io.h>
>  
> @@ -28,7 +30,7 @@
>  	M_I20,
>  	M_MINI,
>  	M_MACBOOK,
> -	M_NEW
> +	M_UNKNOWN
>  } MAC_TYPE;
>  
>  /* --------------------------------------------------------------------- */
> @@ -52,10 +54,36 @@
>  };
>  
>  static int inverse;
> -static int model		= M_NEW;
> +static int model		= M_UNKNOWN;
>  static int manual_height;
>  static int manual_width;
>  
> +static int set_system(struct dmi_system_id *id)

Missing __init ?

> +{
> +	printk(KERN_INFO "imacfb: %s detected - set system to %ld\n",
> +		id->ident, (long)id->driver_data);
> +	
> +	model = (long)id->driver_data;
> +	
> +	return 0;
> +}
> +
> +static struct dmi_system_id __initdata dmi_system_table[] = {
> +	{ set_system, "iMac4,1", {
> +	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
> +	  DMI_MATCH(DMI_BIOS_VERSION,"iMac4,1") }, (void*)M_I17},
> +	{ set_system, "MacBookPro1,1", {
> +	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
> +	  DMI_MATCH(DMI_BIOS_VERSION,"MacBookPro1,1") }, (void*)M_I17},
> +	{ set_system, "MacBook1,1", {
> +	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
> +	  DMI_MATCH(DMI_PRODUCT_NAME,"MacBook1,1")}, (void *)M_MACBOOK},
> +	{ set_system, "Macmini1,1", {
> +	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
> +	  DMI_MATCH(DMI_PRODUCT_NAME,"Macmini1,1")}, (void *)M_MINI},
> +	{},
> +};
> +
>  #define	DEFAULT_FB_MEM	1024*1024*16
>  
>  /* --------------------------------------------------------------------- */
> @@ -149,7 +177,6 @@
>  		screen_info.lfb_linelength = 1472 * 4;
>  		screen_info.lfb_base = 0x80010000;
>  		break;
> -	case M_NEW:
>  	case M_I20:
>  		screen_info.lfb_width = 1680;
>  		screen_info.lfb_height = 1050;
> @@ -207,6 +234,10 @@
>  		size_remap = size_total;
>  	imacfb_fix.smem_len = size_remap;
>  
> +#ifndef __i386__
> +	screen_info.imacpm_seg = 0;
> +#endif
> +
>  	if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) {
>  		printk(KERN_WARNING
>  		       "imacfb: cannot reserve video memory at 0x%lx\n",
> @@ -324,8 +355,16 @@
>  	int ret;
>  	char *option = NULL;
>  
> -	/* ignore error return of fb_get_options */
> -	fb_get_options("imacfb", &option);
> +	if (!efi_enabled)
> +		return -ENODEV;
> +	if (!dmi_check_system(dmi_system_table))
> +		return -ENODEV;
> +	if (model == M_UNKNOWN)
> +		return -ENODEV;
> +
> +	if (fb_get_options("imacfb", &option))
> +		return -ENODEV;
> +
>  	imacfb_setup(option);
>  	ret = platform_driver_register(&imacfb_driver);
>  
> diff -uNr linux-2.6.18-rc2/drivers/video/Kconfig linux-2.6.18-rc2.mactel/drivers/video/Kconfig
> --- linux-2.6.18-rc2/drivers/video/Kconfig	2006-07-16 10:38:27.000000000 +0200
> +++ linux-2.6.18-rc2.mactel/drivers/video/Kconfig	2006-07-25 13:30:55.000000000 +0200
> @@ -552,7 +552,7 @@
>  
>  config FB_IMAC
>  	bool "Intel-based Macintosh Framebuffer Support"
> -	depends on (FB = y) && X86
> +	depends on (FB = y) && X86 && EFI
>  	select FB_CFB_FILLRECT
>  	select FB_CFB_COPYAREA
>  	select FB_CFB_IMAGEBLIT
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Andrey Panin		| Linux and UNIX system administrator
pazke@donpac.ru		| PGP key: wwwkeys.pgp.net

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2006-08-01  9:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-31  8:25 [PATCH 1/3] add-imacfb-docu-and-detection.patch Edgar Hucek
2006-07-31 15:51 ` Olaf Hering
2006-07-31 18:35   ` Randy.Dunlap
2006-07-31 19:32 ` Joseph Fannin
2006-07-31 19:49   ` Edgar Hucek
2006-07-31 23:44   ` Antonino A. Daplas
2006-08-01  9:33 ` Andrey Panin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox