All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efifb: dmi set video type
@ 2009-03-21 22:16 Brian Maly
  2009-03-23  2:06 ` Huang Ying
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Maly @ 2009-03-21 22:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: ying.huang

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

The current logic for dmi matching in efifb does not allow efifb to load 
on all hardware that we can dmi match for.

For a real world example, boot with elilo (3.7 or 3.8 vanilla) and on a 
Apple (MacBook) and EFI framebuffer driver will not load (you will have 
no video).
This specific hardware is efi v1.10, so we have UGA and not GOP. Without 
special bootloader magic (i.e. extra elilo patches for UGA graphics 
detection) no screen info will be passed to the kernel and as a result 
efifb will not load.

This patch allows the dmi match to happen by moving it to earlier in 
efifb_init, and sets the video type (in set_system) so that efifb can 
load when we have a valid dmi match and already know the specifics of 
the hardware.

Without this patch the efifb driver will fail to load in the event 
screen info is not found and passed in by the bootloader, being that we 
will never get to look for a dmi match. A primary reason for matching 
with dmi is because not all bootloaders detect the video info properly. 
The solution is that in the event of a dmi match, we should set 
screen_info.orig_video_isVGA. Most bootloaders fail to set screen info 
on Apple hardware, and this is a big problem for people who use Apple 
hardware.

Tested on a MacBook SantaRosa with elilo-3.8 (vanilla) and resolves the 
issue, the dmi match now works, EFI framebuffer now loads and video works.


Signed-off-by: Brian Maly <bmaly@redhat>



[-- Attachment #2: linux-2.6.29-efifb-dmi-set-video_isVGA.patch --]
[-- Type: text/x-patch, Size: 718 bytes --]

--- a/drivers/video/efifb.c	2009-03-21 21:05:08.000000000 -0400
+++ b/drivers/video/efifb.c	2009-03-21 21:16:20.000000000 -0400
@@ -129,6 +129,8 @@ static int set_system(const struct dmi_s
 		screen_info.lfb_width = info->width;
 	if (screen_info.lfb_height == 0)
 		screen_info.lfb_height = info->height;
+	if (screen_info.orig_video_isVGA == 0)
+		screen_info.orig_video_isVGA = VIDEO_TYPE_EFI;
 
 	return 0;
 }
@@ -374,9 +376,10 @@ static int __init efifb_init(void)
 	int ret;
 	char *option = NULL;
 
+	dmi_check_system(dmi_system_table);
+
 	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
 		return -ENODEV;
-	dmi_check_system(dmi_system_table);
 
 	if (fb_get_options("efifb", &option))
 		return -ENODEV;

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

* Re: [PATCH] efifb: dmi set video type
  2009-03-21 22:16 [PATCH] efifb: dmi set video type Brian Maly
@ 2009-03-23  2:06 ` Huang Ying
  0 siblings, 0 replies; 3+ messages in thread
From: Huang Ying @ 2009-03-23  2:06 UTC (permalink / raw)
  To: Brian Maly; +Cc: linux-kernel@vger.kernel.org

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

Hi, Brian,

The patch is OK for me.

Please cc linux-fbdev-devel@lists.sourceforge.net and "Antonino A.
Daplas" <adaplas@pol.net> on framebuffer driver patches.

Best Regards,
Huang Ying

On Sun, 2009-03-22 at 06:16 +0800, Brian Maly wrote:
> The current logic for dmi matching in efifb does not allow efifb to load 
> on all hardware that we can dmi match for.
> 
> For a real world example, boot with elilo (3.7 or 3.8 vanilla) and on a 
> Apple (MacBook) and EFI framebuffer driver will not load (you will have 
> no video).
> This specific hardware is efi v1.10, so we have UGA and not GOP. Without 
> special bootloader magic (i.e. extra elilo patches for UGA graphics 
> detection) no screen info will be passed to the kernel and as a result 
> efifb will not load.
> 
> This patch allows the dmi match to happen by moving it to earlier in 
> efifb_init, and sets the video type (in set_system) so that efifb can 
> load when we have a valid dmi match and already know the specifics of 
> the hardware.
> 
> Without this patch the efifb driver will fail to load in the event 
> screen info is not found and passed in by the bootloader, being that we 
> will never get to look for a dmi match. A primary reason for matching 
> with dmi is because not all bootloaders detect the video info properly. 
> The solution is that in the event of a dmi match, we should set 
> screen_info.orig_video_isVGA. Most bootloaders fail to set screen info 
> on Apple hardware, and this is a big problem for people who use Apple 
> hardware.
> 
> Tested on a MacBook SantaRosa with elilo-3.8 (vanilla) and resolves the 
> issue, the dmi match now works, EFI framebuffer now loads and video works.
> 
> 
> Signed-off-by: Brian Maly <bmaly@redhat>
> 
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* [PATCH] efifb: dmi set video type
@ 2009-03-23 17:49 Brian Maly
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Maly @ 2009-03-23 17:49 UTC (permalink / raw)
  To: linux-fbdev-devel, adaplas; +Cc: ying.huang

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

Hi,

I had posted this to LKML and should have CC'd this list too, so instead 
Im reposting to this list.
Initial post: http://lkml.org/lkml/2009/3/21/284



The current logic for dmi matching in efifb does not allow efifb to load 
on all hardware that we can dmi match for. We should trust a dmi match 
and set video type too if we dont already have one passed in from the 
bootloader. Currently this info needs to be set by the bootloader just 
to proceed to looking for a dmi match.

For a real world example, boot with elilo (3.7 or 3.8 vanilla) and on a 
Apple (MacBook) and EFI framebuffer driver will not load (you will have 
no video).
This specific hardware is efi v1.10, so we have UGA and not GOP. Without 
special bootloader magic (i.e. extra elilo patches for UGA graphics 
detection) no screen info will be passed to the kernel and as a result 
efifb will not load.

This patch allows the dmi match to happen by moving it to earlier in 
efifb_init, and sets the video type (in set_system) so that efifb can 
load when we have a valid dmi match and already know the specifics of 
the hardware.

Without this patch the efifb driver will fail to load in the event 
screen info is not found and passed in by the bootloader, being that we 
will never get to look for a dmi match. A primary reason for matching 
with dmi is because not all bootloaders detect the video info properly. 
The solution is that in the event of a dmi match, we should set 
screen_info.orig_video_isVGA too. Many bootloaders fail to set screen 
info on Apple hardware, and this is a big problem for people who want to 
use Apple hardware.

Tested on a MacBook SantaRosa with elilo-3.8 (vanilla) and resolves the 
issue, the dmi match now works, EFI framebuffer now loads and video works.


Signed-off-by: Brian Maly <bmaly@redhat>


 efifb.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


[-- Attachment #2: linux-2.6.29-efifb-dmi-set-video_isVGA.patch --]
[-- Type: text/x-patch, Size: 718 bytes --]

--- a/drivers/video/efifb.c	2009-03-21 21:05:08.000000000 -0400
+++ b/drivers/video/efifb.c	2009-03-21 21:16:20.000000000 -0400
@@ -129,6 +129,8 @@ static int set_system(const struct dmi_s
 		screen_info.lfb_width = info->width;
 	if (screen_info.lfb_height == 0)
 		screen_info.lfb_height = info->height;
+	if (screen_info.orig_video_isVGA == 0)
+		screen_info.orig_video_isVGA = VIDEO_TYPE_EFI;
 
 	return 0;
 }
@@ -374,9 +376,10 @@ static int __init efifb_init(void)
 	int ret;
 	char *option = NULL;
 
+	dmi_check_system(dmi_system_table);
+
 	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
 		return -ENODEV;
-	dmi_check_system(dmi_system_table);
 
 	if (fb_get_options("efifb", &option))
 		return -ENODEV;

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

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com

[-- Attachment #4: 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

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

end of thread, other threads:[~2009-03-23 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-21 22:16 [PATCH] efifb: dmi set video type Brian Maly
2009-03-23  2:06 ` Huang Ying
  -- strict thread matches above, loose matches on Subject: below --
2009-03-23 17:49 Brian Maly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.