Page 1 of 2

Few modes for Vbe on EeePc 900 (now "Problems getting EDID")

Posted: Tue Jun 15, 2010 2:04 pm
by AlfaOmega08
I'm working on my vbe driver. I've prepared it so that it shows a bunch of informations. I am testing this on many real pcs. While the first 3 pcs with nVidia cards show a lot of modes with different resolutions and bpps, my EeePc 900 shows only 9 modes, where the first 3 (0x105, 0x117, 0x118) are zeroed. The others are 640x480 (0x112, 0x101, 0x111) and 800x600 (0x114, 0x115, 0x103) at 8, 16 and 32 bpp. Now the EeePc has a maximum resolution of 1024x600. Am I missing something or is this happening to you too? Also the frame buffer is not just the common 0xE0000000 but 0xD0000000. I sow on wikipedia that 0x105, 0x117 and 0x118 are the mode number for 1024x768. So it's all right, I should not be able to use them. But why are they present in the mode list? And why I can't see any 1027x600 mode?

Thanks in advance...

P.S.: the Oem string in the Vbe information block is: "Intel(r)915GM/910ML/915MS Graphics Chip Accelerated VGA BIOS"

Re: Few modes for Vbe on EeePc 900

Posted: Tue Jun 15, 2010 2:59 pm
by astrocrep
I am pretty sure Vesa 2.0 does not support wide-screen modes.

-Rich

Re: Few modes for Vbe on EeePc 900

Posted: Tue Jun 15, 2010 6:32 pm
by inx
This is actually an issue particular to the Eee's. Neither the 700 or 900 series report their native resolution. Even the linux community has a bit of issue with it.
The most common workaround (and what I always end up using on my 900) is the 915resolution patch to grub2 to get the mode set. http://nathancoulson.com/proj_eee.shtml has a short, non-technical description of the issue along with a link to the 915resolution patch for grub2. My reason for pointing you there is that perhaps the patch itself will yield some useful information.

Re: Few modes for Vbe on EeePc 900

Posted: Wed Jun 16, 2010 1:09 am
by Brendan
Hi,
AlfaOmega08 wrote:Also the frame buffer is not just the common 0xE0000000 but 0xD0000000.
The framebuffer address usually depends on the video device's PCI BARs, which depends on how the BIOS felt like configuring PCI device resources (e.g. it can change when you add/remove unrelated PCI devices, etc). You probably shouldn't assume that any address is "common" or expected.
AlfaOmega08 wrote:I sow on wikipedia that 0x105, 0x117 and 0x118 are the mode number for 1024x768. So it's all right, I should not be able to use them. But why are they present in the mode list?
The "ModeAttributes" field (in the "ModeInfoBlock" structure returned by VBE for the mode) probably has bit 0 clear to indicate that the video mode is not supported by the hardware (monitor). You should consider yourself lucky, because most video card ROMs ignore what the monitor is capable of handling and let you use video modes that aren't supported by the monitor. If you were using an external monitor instead of the built-in screen, then maybe VBE would let you use the disabled video modes.
AlfaOmega08 wrote:And why I can't see any 1027x600 mode?
astrocrep wrote:I am pretty sure Vesa 2.0 does not support wide-screen modes.
VBE is capable of supporting (almost) any mode you can think of, including wide-screen modes and modes created using VESA's "Generic Timing Formula" (including silly modes like "2048*200"). I wouldn't be surprised if VESA's original intent was for video cards to support a very wide variety of video modes (and then use EDID from the monitor to disable modes that the monitor doesn't support). The problem is that the people who write the video card's ROM are typically lazy (and don't care much about VBE anymore) and only worry about "standard" modes (so they don't get so many complaints when the video card allows resolutions that are less likely to be supported by the monitor).

To make it worse, the people that make the EeePc 900 probably took a generic video card ROM for Intel graphics and tweaked it a little to suit the EeePc 900; rather than doing any extensive customisation for the EeePc 900.
inx wrote:The most common workaround (and what I always end up using on my 900) is the 915resolution patch to grub2 to get the mode set.
I'm not sure what's more scary: the way this patch scans for patterns in the video card's ROM then unlocks the "legacy ROM" area in the memory controller and modifies the copy of the video card's ROM stored ("shadowed") in that RAM; or that Xorg's video driver for Intel's graphics actually uses VBE to set video modes... ;)


Cheers,

Brendan

Re: Few modes for Vbe on EeePc 900

Posted: Wed Jun 16, 2010 2:44 am
by AlfaOmega08
Thank you for answering. I believe I'll stick on that 800x600x32 mode :).
This morning however I integrated read-edid in my os. It works fine on almost any pc I have at hand, but still the EeePc do not work. The Vbe call for 0x4f15 returns 0x014f in eax, so error... any suggestion?

Re: Few modes for Vbe on EeePc 900

Posted: Wed Jun 16, 2010 4:26 am
by Brendan
Hi,
AlfaOmega08 wrote:This morning however I integrated read-edid in my os. It works fine on almost any pc I have at hand, but still the EeePc do not work. The Vbe call for 0x4f15 returns 0x014f in eax, so error... any suggestion?
For the previous version of my boot code, if there's no EDID (e.g. the video card and/or the monitor doesn't support it) then it assumes the monitor is an old "VGA only" thing (max. resolution of 600 *480). This is mostly because all modern hardware should support EDID (and old "VGA only" monitors have a tendency to blow up when you attempt higher resolutions). Also, it allowed the EDID to be "forced", where the EDID comes from a file (in the Boot Image) and the monitor isn't asked. This is useful for some KVMs (I've had trouble in some cases, especially when a different computer is selected on the KVM); and would also be useful for people using hardware that doesn't support EDID (e.g. EeePc 900). Unfortunately it also means that the end-user gets "VGA only" until they've set things up right. The other thing I did is; when the EDID did come from the monitor, I use the vendor ID and product ID from that EDID to check for a file containing newer/updated/corrected EDID information (in the Boot Image), so that if a monitor is known to return dodgy or incomplete EDID data it can be automatically corrected (I've never seen a monitor with the ability to reflash the EDID, so when a monitor manufacturer gets it wrong it's nice to be able to fix it).

To make it work there's a directory (in my boot image) that contains "EDID files"; where the vendor ID and product ID is used to construct the file name for each file (to make it easy to find the right file). For example, if the monitor's EDID says that the vendor ID is "VSC" and the product ID is "591E" (which is a ViewSonic monitor I have here), then I check for the file "/sys/dev/monitor/edid/VSC_591E.edid" in the boot image and (if the file is present) I use that instead; and (if the file is present) the user can put the line "OverrideEDID /sys/dev/monitor/edid/VSC_591E.edid" in the boot script to force the boot code to use this EDID information instead of asking the monitor.

In hindsight, it would've made more sense if I had an "if there is no EDID then use <file>" feature (instead of just the "force the use of <file>" feature, or in addition to this feature).

It'd be interesting to find out if you do get EDID if an external monitor is plugged in...


Cheers,

Brendan

Re: Few modes for Vbe on EeePc 900

Posted: Wed Jun 16, 2010 8:24 am
by AlfaOmega08
Thanks Brendan for your two complete answers. I have already read http://forum.osdev.org/viewtopic.php?f=1&t=19119, which is my bible at the moment, so what you wrote there isn't new to me. However it seems strange that the EeePc which is recent, do not have support for Edid. This is the first laptop I'm programming for. Is edid present on others?

To satisfy your curiosity I've plugged in an external monitor. I get the Edid of that monitor!!! You can choose using Fn+F5 whether the external monitor should be on, off, or on together with the built-in one. In any case you get the edid from the monitor. Disconnecting the cable and rebooting (I didn't test twice (with and without the monitor plugged-in) without reboot however) the edid disappears.

What if I choose a resolution which is usable on the external monitor and not on the built-in one? Can I choose different resolutions for each screen (seems crazy to me)?

Re: Few modes for Vbe on EeePc 900

Posted: Wed Jun 16, 2010 2:18 pm
by AlfaOmega08
Ok another strange case: the monitor (LG M2262D) I tested as external on the EeePc, which reported EDID, used on my primary computer, fails the EDID call (AX = 0x4F15, BX=1, CX=0) and returns 0x014F...
The only explanation I can imagine is that the graphics card (nVidia GeForce 210 GTX) do not support fetching EDID informations. But in that case I would not have AL=4F as return code (correct me if I'm wrong). Probably I should test my pc with another monitor or this monitor or another pc. How can win or linux know that my monitor support full hd resolution or any other resolution if they can't get edid?

Re: Few modes for Vbe on EeePc 900

Posted: Wed Jun 16, 2010 2:30 pm
by Owen
Perhaps the VGA BIOS doesn't report the EDID?

I have a hunch: You have a dual head graphics card, and a bug in the VGA BIOS means VBE only reports EDID info for one of the ports.

Re: Few modes for Vbe on EeePc 900

Posted: Wed Jun 16, 2010 2:39 pm
by AlfaOmega08
Owen wrote:You have a dual head graphics card, and a bug in the VGA BIOS means VBE only reports EDID info for one of the ports.
Do you mean I have two ports on the same card? True. I have a VGA port and a DVI port. And currently I'm using the VGA one. I have a DVI-to-VGA adapter somewhere. If I found it I'll try to use the DVI one. However this do not solve my question about how win and linux know about resolutions.

Thanks

Re: Few modes for Vbe on EeePc 900

Posted: Wed Jun 16, 2010 2:41 pm
by Owen
They don't ask VBE

Re: Few modes for Vbe on EeePc 900 (now "Problems getting ED

Posted: Wed Jun 16, 2010 2:55 pm
by AlfaOmega08
Ok. DVI port tried. Didn't work. I tried to use another pc too (single vga port). Neither. I'm now believing that my fresh new monitor do not support edid. Maybe this because it is not properly a monitor, but a TV with a vga port for monitor-like use #-o ? I feel disappointed -_-"

I think I need to investigate linux code a bit...

Re: Few modes for Vbe on EeePc 900 (now "Problems getting ED

Posted: Wed Jun 16, 2010 3:31 pm
by Brynet-Inc
Almost all monitors support DDC and EDID, since the mid to late 90's.. the problem you're facing is with the BIOS interrupts related to fetching the information.

Drivers for modern operating systems do not query for the information in this way, they have native drivers for the hardware.. and can directly probe for the EDID data.

Re: Few modes for Vbe on EeePc 900 (now "Problems getting ED

Posted: Wed Jun 16, 2010 4:28 pm
by AlfaOmega08
Since I'm to lazy to reboot each time, I am running get-edid from ubuntu. It does not work as in my os. But... browsing its code I sow that it is fixed to controller 0 (parameter ecx to 0x4F15/0x01). As I put 1 as controller, I get DDC2 available in capabilities (0x4F15/0x00) of that controller. However reading from controller 1 returns a wrong header... I got specifications from the vesa website, I'll have a look there. I found a VBE/SCI standard, which seems almost unknown to most of the world and as far as I can see with my tired eyes it can be used to read EDID data. Is SCI supported by many cards/monitors?

Now where I live is 0.20 and I'm really tired. See you tomorrow. Nightly answers are welcome :D

Thanks to those who answered and thanks in advance to the ones who will answer. You had far too much patience with me today...

Re: Few modes for Vbe on EeePc 900 (now "Problems getting ED

Posted: Thu Jun 17, 2010 1:13 am
by Brendan
Hi,

I'd assume that the monitor does support EDID (as it worked when plugged into the EeePc 900). I'd also assume that most modern video cards do implement the "Read EDID" function (0x4F15/0x01). For my computers and monitors, all the modern hardware supports EDID (and the VBE function) - it's only the old hardware (e.g. stuff from last century) that doesn't.

However...
AlfaOmega08 wrote:As I put 1 as controller, I get DDC2 available in capabilities (0x4F15/0x00) of that controller. However reading from controller 1 returns a wrong header...
For the "Read EDID" function, "CX = 0x0000" means "the primary controller". The primary controller is the one you need to use (and the only one where you can set a video mode, etc using VBE).

I'd assume that (for multi-head video cards) VBE uses "logical numbering", where the "primary controller" might be the first interface, the second interface, the third interface, etc. "CX = 0x0001" might return information for the second monitor that's connected (regardless of which interface is being used for the first monitor and which interface is being used for the second monitor); however because this is rarely used I wouldn't be surprised if it didn't work on some video cards.

Also, I have an (unconfirmed) suspicion that for some video cards, sometimes you can only get the EDID once and need to turn the computer off and on again before you can get it a second time. I'm not too sure about this - back when I started messing with EDID I wasn't too sure which problems were caused by my KVMs and which weren't; and since then my code only asks for the EDID once during boot anyway. If I get time over the weekend I might do some more thorough testing.

I should also point out that I don't have any laptops here; and I'm not sure how well VBE typically handles EDID for the built-in display vs. external display/s (I'd assume that EDID works for the built-in display for most laptops, but the cheaper the hardware is the less likely it is that EDID works correctly, and for low-end gear like notebooks it might be a case of "cross your fingers and hope").


Cheers,

Brendan