2008-08-29 11:50:58

by Phil Endecott

[permalink] [raw]
Subject: [PATCH] intelfb: support 945GME (as used in ASUS Eee 901)

The following patch adds support for Intel's 945GME graphics chip to
the intelfb driver. I have assumed that the 945GME is identical to the
already-supported 945GM apart from its PCI IDs; this is based on a quick
look at the X driver for these chips which seems to treat them
identically.

Signed-off-by: Phil Endecott <[email protected]>

---

The 945GME is used in the ASUS Eee 901, and I coded this in the hope that
I'd be able to use it to get a console at the native 1024x600 resolution
which is not known to the BIOS. I realised too late that the intelfb
driver does not support mode changing on laptops, so it won't be any
use for me. But rather than throw it away I will post it here as
essentially "untested"; maybe someone who knows more about this driver,
and with more useful hardware to test on, can pick it up.

diff --git a/Documentation/fb/intelfb.txt b/Documentation/fb/intelfb.txt
index 27a3160..dd9e944 100644
--- a/Documentation/fb/intelfb.txt
+++ b/Documentation/fb/intelfb.txt
@@ -14,6 +14,7 @@ graphics devices. These would include:
Intel 915GM
Intel 945G
Intel 945GM
+ Intel 945GME
Intel 965G
Intel 965GM

diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h
index 3325fbd..a50bea6 100644
--- a/drivers/video/intelfb/intelfb.h
+++ b/drivers/video/intelfb/intelfb.h
@@ -12,9 +12,9 @@
#endif

/*** Version/name ***/
-#define INTELFB_VERSION "0.9.5"
+#define INTELFB_VERSION "0.9.6"
#define INTELFB_MODULE_NAME "intelfb"
-#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM"
+#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/945GME/965G/965GM"


/*** Debug/feature defines ***/
@@ -58,6 +58,7 @@
#define PCI_DEVICE_ID_INTEL_915GM 0x2592
#define PCI_DEVICE_ID_INTEL_945G 0x2772
#define PCI_DEVICE_ID_INTEL_945GM 0x27A2
+#define PCI_DEVICE_ID_INTEL_945GME 0x27AE
#define PCI_DEVICE_ID_INTEL_965G 0x29A2
#define PCI_DEVICE_ID_INTEL_965GM 0x2A02

@@ -160,6 +161,7 @@ enum intel_chips {
INTEL_915GM,
INTEL_945G,
INTEL_945GM,
+ INTEL_945GME,
INTEL_965G,
INTEL_965GM,
};
@@ -363,6 +365,7 @@ struct intelfb_info {
((dinfo)->chipset == INTEL_915GM) || \
((dinfo)->chipset == INTEL_945G) || \
((dinfo)->chipset == INTEL_945GM) || \
+ ((dinfo)->chipset == INTEL_945GME) || \
((dinfo)->chipset == INTEL_965G) || \
((dinfo)->chipset == INTEL_965GM))

diff --git a/drivers/video/intelfb/intelfb_i2c.c b/drivers/video/intelfb/intelfb_i2c.c
index fcf9fad..5d896b8 100644
--- a/drivers/video/intelfb/intelfb_i2c.c
+++ b/drivers/video/intelfb/intelfb_i2c.c
@@ -171,6 +171,7 @@ void intelfb_create_i2c_busses(struct intelfb_info *dinfo)
/* has some LVDS + tv-out */
case INTEL_945G:
case INTEL_945GM:
+ case INTEL_945GME:
case INTEL_965G:
case INTEL_965GM:
/* SDVO ports have a single control bus - 2 devices */
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index e44303f..a09e236 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -2,7 +2,7 @@
* intelfb
*
* Linux framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G/915G/915GM/
- * 945G/945GM/965G/965GM integrated graphics chips.
+ * 945G/945GM/945GME/965G/965GM integrated graphics chips.
*
* Copyright © 2002, 2003 David Dawes <[email protected]>
* 2004 Sylvain Meyer
@@ -102,6 +102,9 @@
*
* 04/2008 - Version 0.9.5
* Add support for 965G/965GM. (Maik Broemme <[email protected]>)
+ *
+ * 08/2008 - Version 0.9.6
+ * Add support for 945GME. (Phil Endecott <[email protected]>)
*/

#include <linux/module.h>
@@ -183,6 +186,7 @@ static struct pci_device_id intelfb_pci_table[] __devinitdata = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_915GM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_915GM },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_945G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_945G },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_945GM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_945GM },
+ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_945GME, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_945GME },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_965G },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965GM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_965GM },
{ 0, }
@@ -555,6 +559,7 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev,
(ent->device == PCI_DEVICE_ID_INTEL_915GM) ||
(ent->device == PCI_DEVICE_ID_INTEL_945G) ||
(ent->device == PCI_DEVICE_ID_INTEL_945GM) ||
+ (ent->device == PCI_DEVICE_ID_INTEL_945GME) ||
(ent->device == PCI_DEVICE_ID_INTEL_965G) ||
(ent->device == PCI_DEVICE_ID_INTEL_965GM)) {

diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 8e6d6a4..8b26b27 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -143,6 +143,12 @@ int intelfbhw_get_chipset(struct pci_dev *pdev, struct intelfb_info *dinfo)
dinfo->mobile = 1;
dinfo->pll_index = PLLS_I9xx;
return 0;
+ case PCI_DEVICE_ID_INTEL_945GME:
+ dinfo->name = "Intel(R) 945GME";
+ dinfo->chipset = INTEL_945GME;
+ dinfo->mobile = 1;
+ dinfo->pll_index = PLLS_I9xx;
+ return 0;
case PCI_DEVICE_ID_INTEL_965G:
dinfo->name = "Intel(R) 965G";
dinfo->chipset = INTEL_965G;
@@ -186,6 +192,7 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
case PCI_DEVICE_ID_INTEL_915GM:
case PCI_DEVICE_ID_INTEL_945G:
case PCI_DEVICE_ID_INTEL_945GM:
+ case PCI_DEVICE_ID_INTEL_945GME:
case PCI_DEVICE_ID_INTEL_965G:
case PCI_DEVICE_ID_INTEL_965GM:
/* 915, 945 and 965 chipsets support a 256MB aperture.


2008-08-31 07:20:56

by Krzysztof Helt

[permalink] [raw]
Subject: Re: [Linux-fbdev-devel] [PATCH] intelfb: support 945GME (as used in ASUS Eee 901)

On Fri, 29 Aug 2008 12:50:45 +0100
"Phil Endecott" <[email protected]> wrote:

> The following patch adds support for Intel's 945GME graphics chip to
> the intelfb driver. I have assumed that the 945GME is identical to the
> already-supported 945GM apart from its PCI IDs; this is based on a quick
> look at the X driver for these chips which seems to treat them
> identically.
>
> Signed-off-by: Phil Endecott <[email protected]>
>
> ---
>
> The 945GME is used in the ASUS Eee 901, and I coded this in the hope that
> I'd be able to use it to get a console at the native 1024x600 resolution
> which is not known to the BIOS. I realised too late that the intelfb
> driver does not support mode changing on laptops, so it won't be any
> use for me. But rather than throw it away I will post it here as
> essentially "untested"; maybe someone who knows more about this driver,
> and with more useful hardware to test on, can pick it up.
>
> diff --git a/Documentation/fb/intelfb.txt b/Documentation/fb/intelfb.txt
> index 27a3160..dd9e944 100644
> --- a/Documentation/fb/intelfb.txt
> +++ b/Documentation/fb/intelfb.txt
> @@ -14,6 +14,7 @@ graphics devices. These would include:
> Intel 915GM
> Intel 945G
> Intel 945GM
> + Intel 945GME
> Intel 965G
> Intel 965GM
>
> diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h
> index 3325fbd..a50bea6 100644
> --- a/drivers/video/intelfb/intelfb.h
> +++ b/drivers/video/intelfb/intelfb.h
> @@ -12,9 +12,9 @@
> #endif
>
> /*** Version/name ***/
> -#define INTELFB_VERSION "0.9.5"
> +#define INTELFB_VERSION "0.9.6"
> #define INTELFB_MODULE_NAME "intelfb"
> -#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM"
> +#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/945GME/965G/965GM"
>

Acked-by: Krzysztof Helt <[email protected]>

BTW, Is it possible to shorten this list by something like "830/845/852/865/915/945/965 models G, GM and GME" or
"830M/8x5G/8x5GM/9x5G/9x5GM/9x5GME" or maybe something else?

Regards,
Krzysztof


----------------------------------------------------------------------
>> Sprawdz, czy do siebie pasujecie!
>> http://link.interia.pl/f1eea

2008-08-31 15:35:19

by Phil Endecott

[permalink] [raw]
Subject: Re: [Linux-fbdev-devel] [PATCH] intelfb: support 945GME (as used in ASUS Eee 901)

Krzysztof Helt wrote:
> On Fri, 29 Aug 2008 12:50:45 +0100
> "Phil Endecott" <[email protected]> wrote:
>
>> The following patch adds support for Intel's 945GME graphics chip to
>> the intelfb driver. I have assumed that the 945GME is identical to the
>> already-supported 945GM apart from its PCI IDs; this is based on a quick
>> look at the X driver for these chips which seems to treat them
>> identically.

[snip]

>> -#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM"
>> +#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/945GME/965G/965GM"
>>
>
> Acked-by: Krzysztof Helt <[email protected]>
>
> BTW, Is it possible to shorten this list by something like "830/845/852/865/915/945/965 models G, GM and GME" or
> "830M/8x5G/8x5GM/9x5G/9x5GM/9x5GME" or maybe something else?

Doing so would reduce grep-ability. I did a lot of "grep -r 945GM ."
while trying to understand this.


Phil.


2008-10-13 01:09:44

by Geoffroy Carrier

[permalink] [raw]
Subject: Re: [PATCH] intelfb: support 945GME (as used in ASUS Eee 901)

On Fri, Aug 29, 2008 at 13:50, Phil Endecott
<[email protected]> wrote:
> The following patch adds support for Intel's 945GME graphics chip to
> the intelfb driver. I have assumed that the 945GME is identical to the
> already-supported 945GM apart from its PCI IDs; this is based on a quick
> look at the X driver for these chips which seems to treat them
> identically.
>
> Signed-off-by: Phil Endecott <[email protected]>
>
> ---
>
> The 945GME is used in the ASUS Eee 901, and I coded this in the hope that
> I'd be able to use it to get a console at the native 1024x600 resolution
> which is not known to the BIOS. I realised too late that the intelfb
> driver does not support mode changing on laptops, so it won't be any
> use for me. But rather than throw it away I will post it here as
> essentially "untested"; maybe someone who knows more about this driver,
> and with more useful hardware to test on, can pick it up.
>
> diff --git a/Documentation/fb/intelfb.txt b/Documentation/fb/intelfb.txt
> index 27a3160..dd9e944 100644
> --- a/Documentation/fb/intelfb.txt
> +++ b/Documentation/fb/intelfb.txt
> @@ -14,6 +14,7 @@ graphics devices. These would include:
> Intel 915GM
> Intel 945G
> Intel 945GM
> + Intel 945GME
> Intel 965G
> Intel 965GM
>
> diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h
> index 3325fbd..a50bea6 100644
> --- a/drivers/video/intelfb/intelfb.h
> +++ b/drivers/video/intelfb/intelfb.h
> @@ -12,9 +12,9 @@
> #endif
>
> /*** Version/name ***/
> -#define INTELFB_VERSION "0.9.5"
> +#define INTELFB_VERSION "0.9.6"
> #define INTELFB_MODULE_NAME "intelfb"
> -#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM"
> +#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/945GME/965G/965GM"
>
>
> /*** Debug/feature defines ***/
> @@ -58,6 +58,7 @@
> #define PCI_DEVICE_ID_INTEL_915GM 0x2592
> #define PCI_DEVICE_ID_INTEL_945G 0x2772
> #define PCI_DEVICE_ID_INTEL_945GM 0x27A2
> +#define PCI_DEVICE_ID_INTEL_945GME 0x27AE
> #define PCI_DEVICE_ID_INTEL_965G 0x29A2
> #define PCI_DEVICE_ID_INTEL_965GM 0x2A02
>
> @@ -160,6 +161,7 @@ enum intel_chips {
> INTEL_915GM,
> INTEL_945G,
> INTEL_945GM,
> + INTEL_945GME,
> INTEL_965G,
> INTEL_965GM,
> };
> @@ -363,6 +365,7 @@ struct intelfb_info {
> ((dinfo)->chipset == INTEL_915GM) || \
> ((dinfo)->chipset == INTEL_945G) || \
> ((dinfo)->chipset == INTEL_945GM) || \
> + ((dinfo)->chipset == INTEL_945GME) || \
> ((dinfo)->chipset == INTEL_965G) || \
> ((dinfo)->chipset == INTEL_965GM))
>
> diff --git a/drivers/video/intelfb/intelfb_i2c.c b/drivers/video/intelfb/intelfb_i2c.c
> index fcf9fad..5d896b8 100644
> --- a/drivers/video/intelfb/intelfb_i2c.c
> +++ b/drivers/video/intelfb/intelfb_i2c.c
> @@ -171,6 +171,7 @@ void intelfb_create_i2c_busses(struct intelfb_info *dinfo)
> /* has some LVDS + tv-out */
> case INTEL_945G:
> case INTEL_945GM:
> + case INTEL_945GME:
> case INTEL_965G:
> case INTEL_965GM:
> /* SDVO ports have a single control bus - 2 devices */
> diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
> index e44303f..a09e236 100644
> --- a/drivers/video/intelfb/intelfbdrv.c
> +++ b/drivers/video/intelfb/intelfbdrv.c
> @@ -2,7 +2,7 @@
> * intelfb
> *
> * Linux framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G/915G/915GM/
> - * 945G/945GM/965G/965GM integrated graphics chips.
> + * 945G/945GM/945GME/965G/965GM integrated graphics chips.
> *
> * Copyright (c) 2002, 2003 David Dawes <[email protected]>
> * 2004 Sylvain Meyer
> @@ -102,6 +102,9 @@
> *
> * 04/2008 - Version 0.9.5
> * Add support for 965G/965GM. (Maik Broemme <[email protected]>)
> + *
> + * 08/2008 - Version 0.9.6
> + * Add support for 945GME. (Phil Endecott <[email protected]>)
> */
>
> #include <linux/module.h>
> @@ -183,6 +186,7 @@ static struct pci_device_id intelfb_pci_table[] __devinitdata = {
> { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_915GM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_915GM },
> { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_945G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_945G },
> { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_945GM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_945GM },
> + { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_945GME, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_945GME },
> { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_965G },
> { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965GM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_965GM },
> { 0, }
> @@ -555,6 +559,7 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev,
> (ent->device == PCI_DEVICE_ID_INTEL_915GM) ||
> (ent->device == PCI_DEVICE_ID_INTEL_945G) ||
> (ent->device == PCI_DEVICE_ID_INTEL_945GM) ||
> + (ent->device == PCI_DEVICE_ID_INTEL_945GME) ||
> (ent->device == PCI_DEVICE_ID_INTEL_965G) ||
> (ent->device == PCI_DEVICE_ID_INTEL_965GM)) {
>
> diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
> index 8e6d6a4..8b26b27 100644
> --- a/drivers/video/intelfb/intelfbhw.c
> +++ b/drivers/video/intelfb/intelfbhw.c
> @@ -143,6 +143,12 @@ int intelfbhw_get_chipset(struct pci_dev *pdev, struct intelfb_info *dinfo)
> dinfo->mobile = 1;
> dinfo->pll_index = PLLS_I9xx;
> return 0;
> + case PCI_DEVICE_ID_INTEL_945GME:
> + dinfo->name = "Intel(R) 945GME";
> + dinfo->chipset = INTEL_945GME;
> + dinfo->mobile = 1;
> + dinfo->pll_index = PLLS_I9xx;
> + return 0;
> case PCI_DEVICE_ID_INTEL_965G:
> dinfo->name = "Intel(R) 965G";
> dinfo->chipset = INTEL_965G;
> @@ -186,6 +192,7 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
> case PCI_DEVICE_ID_INTEL_915GM:
> case PCI_DEVICE_ID_INTEL_945G:
> case PCI_DEVICE_ID_INTEL_945GM:
> + case PCI_DEVICE_ID_INTEL_945GME:
> case PCI_DEVICE_ID_INTEL_965G:
> case PCI_DEVICE_ID_INTEL_965GM:
> /* 915, 945 and 965 chipsets support a 256MB aperture.

Acked-by: Geoffroy Carrier <[email protected]>

Used with success on mainline 2.6.27.

For your resolution problem, here is my solution.
Set modes in grub2, thanks to the 915resolution module from:
http://www.nathancoulson.com/proj_eee.shtml
It didn't work with 0.5.2-2 (unrecognized chipset), but 0.5.2-3
includes its support. The new patch was originally written for the
eeepc901 (AFAIK), but works fine on my laptop (MSI Wind U100).

FYI, I used in grub.cfg:
insmod 915resolution
915resolution 32 1024 600
[...]
linux /boot/[...] vga=789

I can't wait for kernel modesetting...

--
Geoffroy Carrier