documentation for graphics drivers?
documentation for graphics drivers?
Hello,i whant to make a graphic driver to be able to set up 1024*600 videomode on my netbook.
This videomode is not vesa and the hardware (950gme) is not vga compatible.
I already read some intel docs but they do not explain very much ,and linux sources are hard to understand.
somebody knows where to find good documentation?
This videomode is not vesa and the hardware (950gme) is not vga compatible.
I already read some intel docs but they do not explain very much ,and linux sources are hard to understand.
somebody knows where to find good documentation?
- CmpXchg
- Member
- Posts: 61
- Joined: Mon Apr 28, 2008 12:14 pm
- Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime
Re: documentation for graphics drivers?
Go find a DataSheet for this device
Every Man Must Learn David DeAngelo's Stuff, Period.
http://www.doubleyourdating.com/Catalog
http://www.doubleyourdating.com/Catalog
Re: documentation for graphics drivers?
I know this site and dowloaded some pdf files from there ,but these docs only explay the pci configuration part,not the memory mapped registers of the video chip and any thing about the comand set or protocol.Combuster wrote:http://www.x.org/docs/intel/
I think there is no documentation,linux guys still have to do reverse enginiering or wait for the manufacturer closed source driver.
Re: documentation for graphics drivers?
Did you actually try to enumerate all available VESA modes to see if it is supported? If not, you may wanna do so.octavio wrote:Hello,i whant to make a graphic driver to be able to set up 1024*600 videomode on my netbook.
This videomode is not vesa
JAL
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: documentation for graphics drivers?
octavio wrote:I know this site and dowloaded some pdf files from there ,but these docs only explay the pci configuration part,not the memory mapped registers of the video chip and any thing about the comand set or protocol.Combuster wrote:http://www.x.org/docs/intel/
That is complete and utter BS. I suggest you try and learn to actually read. I needed only 5 seconds (after downloading) to find the mode setting documentation.
Re: documentation for graphics drivers?
Hi,
Then there's a counter that counts how many "pixel clocks" have passed, which is reset when it reaches the "horizontal total". The horizontal total is the total number of pixels sent to the monitor for each screen line, and includes left blanking, an optional left margin, the visible pixels, an optional right margin, and the right blanking. There's also a horizontal sync pulse in there too (but that's considered part of the right blanking). Basically, when this counter reaches the horizontal total then the video card knows it needs to move to the next screen line.
Then there's a counter that counts how many screen lines have passed, which is reset when it reaches the "vertical total". The vertical total is just like the horizontal total, and counts the number of lines sent to the monitor per frame (and includes top blanking, an optional top margin, the visible lines of pixels, an optional bottom margin and the bottom blanking; with a vertical sync pulse in the bottom blanking). When this counter reaches the vertical total the video card knows it needs to start the next frame.
Basically what I'm saying is that most video cards can actually generate millions of slightly different video modes - typically any horizontal resolution that is a multiple of 8 (e.g. 640 * 480, 648 * 480, 656 * 480, 664 * 380, etc), and any vertical resolution.
However, just because a video card can generate a video mode doesn't mean that the monitor will recognize the video mode and display it correctly. For this there's a list of "established timings" (which are industry standard timings, like "VGA 640 * 480 @ 60 Hz"), plus there's GTF (a Generalized Timing Formula) and CVT (Coordinated Video Timings). The monitor uses EDID to tell the video card (video driver) which video modes it does support.
The VESA/VBE modes are just a set of pre-computed video modes that are slapped into a lookup table in the video card's ROM. They're a very small subset of the full range of possible video modes that the video card could support (and they have nothing to do with what the monitor says it supports).
Also, modern LCD monitors have a preferred video mode (which is typically the native resolution of the monitor, or the actual number of pixels in the LCD screen). Most LCD monitors have "strange" resolutions for their preferred video mode (e.g. 1680 * 1050, or maybe 1024 * 600), partly because most of the standard video modes (established timings) are for a 4:3 aspect ratio, and most LCD monitors are wide screen. Because the VBE/ROM code is set at the factory (and therefore ignores the monitor's EDID) it's entirely possible that the preferred video mode for the monitor isn't listed as one of the possible modes listed by VBE, so you get a mismatched mess if you rely on VBE. For example, for the computer I'm using now the monitor's native resolution is 1680 * 1050, and the closest VBE mode is 1600 * 1024; which means that the monitor scales the image (stretches to 1600 * 1024 image to fit a 1680 * 1050 screen) and I get vertical and horizontal distortion lines where this scaling sucks (where one "video card pixel" is stretched to cover 2 "monitor pixels").
What I'm getting at is that if you're writing a video driver for a specific video card, then you are not restricted to the (very restrictive) set of video modes that are listed by VBE, and (for reasonably modern hardware) you can avoid compatibility problems and provide a much better list of video modes with much more flexibility (e.g. you can find the set of all possible video modes that are supported by the video card and the monitor, and for LCD monitors you can also use the monitor's preferred video mode as the default video mode to avoid scaling issues).
You can even support some more advanced things, like "letterboxing" - e.g. displaying a 4:3 image on a wide-screen monitor with black strips on the left and right so that the aspect ratio isn't messed up and the image looks exactly the same as it would on a 4:3 monitor, or the reverse (wide-screen image on a 4:3 monitor with black strips at top and bottom). Then there's refresh rate control, rotating the image (most Intel drivers support rotation in 90 degree steps, which is useful for some situations), double scanning (to get lower resolution video modes that aren't supported by the monitor by sending each line twice - e.g. "640 * 240" where the monitor thinks it's "640 * 480"), different gamma ramps, etc.
Cheers,
Brendan
For video cards there's a "pixel clock", which can be set to a range of frequencies - e.g. from 25 MHz to 200 MHz in steps of 2.5 MHz.jal wrote:Did you actually try to enumerate all available VESA modes to see if it is supported? If not, you may wanna do so.octavio wrote:Hello,i whant to make a graphic driver to be able to set up 1024*600 videomode on my netbook.
This videomode is not vesa
Then there's a counter that counts how many "pixel clocks" have passed, which is reset when it reaches the "horizontal total". The horizontal total is the total number of pixels sent to the monitor for each screen line, and includes left blanking, an optional left margin, the visible pixels, an optional right margin, and the right blanking. There's also a horizontal sync pulse in there too (but that's considered part of the right blanking). Basically, when this counter reaches the horizontal total then the video card knows it needs to move to the next screen line.
Then there's a counter that counts how many screen lines have passed, which is reset when it reaches the "vertical total". The vertical total is just like the horizontal total, and counts the number of lines sent to the monitor per frame (and includes top blanking, an optional top margin, the visible lines of pixels, an optional bottom margin and the bottom blanking; with a vertical sync pulse in the bottom blanking). When this counter reaches the vertical total the video card knows it needs to start the next frame.
Basically what I'm saying is that most video cards can actually generate millions of slightly different video modes - typically any horizontal resolution that is a multiple of 8 (e.g. 640 * 480, 648 * 480, 656 * 480, 664 * 380, etc), and any vertical resolution.
However, just because a video card can generate a video mode doesn't mean that the monitor will recognize the video mode and display it correctly. For this there's a list of "established timings" (which are industry standard timings, like "VGA 640 * 480 @ 60 Hz"), plus there's GTF (a Generalized Timing Formula) and CVT (Coordinated Video Timings). The monitor uses EDID to tell the video card (video driver) which video modes it does support.
The VESA/VBE modes are just a set of pre-computed video modes that are slapped into a lookup table in the video card's ROM. They're a very small subset of the full range of possible video modes that the video card could support (and they have nothing to do with what the monitor says it supports).
Also, modern LCD monitors have a preferred video mode (which is typically the native resolution of the monitor, or the actual number of pixels in the LCD screen). Most LCD monitors have "strange" resolutions for their preferred video mode (e.g. 1680 * 1050, or maybe 1024 * 600), partly because most of the standard video modes (established timings) are for a 4:3 aspect ratio, and most LCD monitors are wide screen. Because the VBE/ROM code is set at the factory (and therefore ignores the monitor's EDID) it's entirely possible that the preferred video mode for the monitor isn't listed as one of the possible modes listed by VBE, so you get a mismatched mess if you rely on VBE. For example, for the computer I'm using now the monitor's native resolution is 1680 * 1050, and the closest VBE mode is 1600 * 1024; which means that the monitor scales the image (stretches to 1600 * 1024 image to fit a 1680 * 1050 screen) and I get vertical and horizontal distortion lines where this scaling sucks (where one "video card pixel" is stretched to cover 2 "monitor pixels").
What I'm getting at is that if you're writing a video driver for a specific video card, then you are not restricted to the (very restrictive) set of video modes that are listed by VBE, and (for reasonably modern hardware) you can avoid compatibility problems and provide a much better list of video modes with much more flexibility (e.g. you can find the set of all possible video modes that are supported by the video card and the monitor, and for LCD monitors you can also use the monitor's preferred video mode as the default video mode to avoid scaling issues).
You can even support some more advanced things, like "letterboxing" - e.g. displaying a 4:3 image on a wide-screen monitor with black strips on the left and right so that the aspect ratio isn't messed up and the image looks exactly the same as it would on a 4:3 monitor, or the reverse (wide-screen image on a 4:3 monitor with black strips at top and bottom). Then there's refresh rate control, rotating the image (most Intel drivers support rotation in 90 degree steps, which is useful for some situations), double scanning (to get lower resolution video modes that aren't supported by the monitor by sending each line twice - e.g. "640 * 240" where the monitor thinks it's "640 * 480"), different gamma ramps, etc.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: documentation for graphics drivers?
Hi,
Maybe you can try my VESA function
init->loader->VESA.asm
If you have stage loader written is asm, you can test with few modification you video mode.
Include the file and just change this
Eventualy the adress where block are copied :
And call VESA function from your stage 2 before going in Protected Mode
In PM mode from your c or c++ kernel you can use VBE struct and VBE mode struct to write your driver.
Ex : to get physical video memory adress
It's VESA not native but can work if the mode exist.
Remember that all video mode for a defined GPU are not listed in VESA documentation.
Hope that help you, and maybe other.
Maybe you can try my VESA function
init->loader->VESA.asm
If you have stage loader written is asm, you can test with few modification you video mode.
Include the file and just change this
Code: Select all
%define WIDTH 1024 ; desired mode width
%define HEIGHT 768 ; desired mode height
%define BITS 32 ; desired bit per pixel
Code: Select all
;**********************************************
; Copy VBE mode info block at 0x80000
; Kernel use it
;**********************************************
CopyBlockInfo:
pushad
;[ds:si] --> [es:di]
mov cx, ModeInfoBlockEnds - VbeInfoBlock
mov ax, 0x8000
push es
mov es, ax
mov di, 0x00
mov si, VbeInfoBlock
rep movsb
pop es
popad
ret
Code: Select all
;-------------------------------;
; VESA operation ;
;-------------------------------;
call GetVESAInfo
call SetVideoMode
call CopyBlockInfo
Ex : to get physical video memory adress
It's VESA not native but can work if the mode exist.
Remember that all video mode for a defined GPU are not listed in VESA documentation.
Hope that help you, and maybe other.
[ Grub 2 | Visual Studio 2013 | PE File ]
The OsDev E.T.
Don't send OsDev MIB !
The OsDev E.T.
Don't send OsDev MIB !
Re: documentation for graphics drivers?
Thanks for the link,first time i did not realize is wat not the intel siteCombuster wrote:http://www.x.org/docs/intel/
No,i have not read this yet, will try again.
Re: documentation for graphics drivers?
Yes,and is not listed.jal wrote:Did you actually try to enumerate all available VESA modes to see if it is supported? If not, you may wanna do so.octavio wrote:Hello,i whant to make a graphic driver to be able to set up 1024*600 videomode on my netbook.
This videomode is not vesa
JAL
And vga programing also do not works,i tested it with a program that can change the videomode in other computers but not on the acer aspire one.
Re: documentation for graphics drivers?
Intel is usually very good in providing technical details for their graphic cards. Do you know exactly what IGP is used? And did you search the Intel site for it?octavio wrote:Yes,and is not listed.
And vga programing also do not works,i tested it with a program that can change the videomode in other computers but not on the acer aspire one.
JAL
Re: documentation for graphics drivers?
below is the list of pci devices on this computer, i did a search on intel site for 945 datasheetes but these docs are for bios developpers
not for writing drivers.
These docs:
http://www.x.org/docs/intel/
are for writting drivers, but for the 965 chipset.
[EDIT:JamesM] You misread my edit. What I said was "pipe that output through 'grep -i "intel"'", not "remove my edit text then repost the exact same content in [ code ] tags.[/EDIT].
not for writing drivers.
These docs:
http://www.x.org/docs/intel/
are for writting drivers, but for the 965 chipset.
[EDIT:JamesM] You misread my edit. What I said was "pipe that output through 'grep -i "intel"'", not "remove my edit text then repost the exact same content in [ code ] tags.[/EDIT].
Re: documentation for graphics drivers?
@octavio, you should read this it may help you: http://intellinuxgraphics.org/documentation.html
Re: documentation for graphics drivers?
Mmm, that's weird. Although the Intel Linux drivers fully support the 945, there doesn't seem to be any technical documentation...
JAL
JAL
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: documentation for graphics drivers?
Because consecutive chipsets are like supersets of one another.
Look at the driver's source, the majority is i830_xxxxx files, except for a few i915_xxxxx and i965_xxxxx files (which have i830 predecessors) These do not include mode setting, only video and hardware acceleration.
Which gets us to the conclusion - those older intel cards are programmed the same way as the latest of the series. I.e. the 945 behaves the same as the 965 wrt to mode setting.
Look at the driver's source, the majority is i830_xxxxx files, except for a few i915_xxxxx and i965_xxxxx files (which have i830 predecessors) These do not include mode setting, only video and hardware acceleration.
Which gets us to the conclusion - those older intel cards are programmed the same way as the latest of the series. I.e. the 945 behaves the same as the 965 wrt to mode setting.