Page 1 of 2
hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 3:00 am
by yestalk
i have read that OpenGL is a collection of draw functions
------- if card vender implemented OpenGL,the driver they offered have all the OpenGL functions,some of those fnctions can accelerate by hardware.
on linux the X window System is an userspace program which means it is not a device driver
and,in the linux kernel view,treat all the device as "file" or "file can mounted"
------- mount
------- read
------- write
------- ioctrl
------- remove
the X System can build on OpenGL
------- does this means OpenGL functions are userspace API
------- and the task of videoCard driver of Linux system is convert all the OpenGL APIs to linux drivers read,write,ioctrl ,and introducing device special meaning of code to read,write,ioctrl implemention?
------- and X system cooperate with several deive such like usb(when plug,there have graphic notifications),mouse,keyboard,gameConsole
------- ------- so what does the kernel do with those device?
------- ------- i am confuse with the X and the kernel functions,dose the are two systems control some devices respectively?
thanks very much for details.
Re: hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 3:32 am
by DeletedAccount
Hi,
Absolute rubbish , do your reading first .
Regards
Shrek
Re: hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 4:30 am
by yestalk
yes, but can't understand very much.
Re: hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 4:31 am
by yestalk
does some can answer more front way?
Re: hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 5:07 am
by JamesM
Hi,
One of the numerous flaws in your logic is that a userspace program cannot also have a driver component. X.org does have a driver component, and it is this that communicates with the card. How X communicates with the driver is implementation dependent.
As Shrek said - do your reading first.
Cheers,
James
Re: hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 5:43 am
by yestalk
at least give me some thing to read, do you mean read the source code?
you know a lot of book start with "hello world" or "not hello world"... i definitely read a lot,but alway block at some place. and can't find what i want to know more clear.
------- and the task of videoCard driver of Linux system is convert all the OpenGL APIs to linux drivers read,write,ioctrl ,and introducing device special meaning of code to the implemention of read,write,ioctrl ?
----so i don't know if i have right expression in english above,and i can ask other way:
--------------does the driver of graphic card implement the OpenGL API or read,write,ioctrl or both of them?
----------------------------whether the implemention of OpenGL API invoke the (read ,write of card driver) or the card dirver's read() write() invoke the OpenGL API? does they invoke each other both to let things more interesting?
i have wake c knowledge, but as programer,i do think that "userspace program can also have a driver component",but i think that those component would like to talk with the hard device that must also be the kernel's component,write according to kernel's specification.
that means ,with out X, we can also draw some thing on the screen, and receive the mouse event(may be not event)...
X just a request/response framework, to know how to implment a simple gui system well easy porting the gui system's features to the X features.
Re: hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 5:58 am
by JamesM
yestalk wrote:but i think that those component would like to talk with the hard device that must also be the kernel's component,write according to kernel's specification.
that means ,with out X, we can also draw some thing on the screen, and receive the mouse event(may be not event)...
There again, you're making a false assumption. The linux kernel has a framebuffer driver. It has no acceleration, no nothing. The X server provides the drivers for hardware-accelerated graphics. Thus, you can draw to the screen without X, but it won't be anywhere near as fast.
Re: hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 6:16 am
by skyking
JamesM wrote:yestalk wrote:but i think that those component would like to talk with the hard device that must also be the kernel's component,write according to kernel's specification.
that means ,with out X, we can also draw some thing on the screen, and receive the mouse event(may be not event)...
There again, you're making a false assumption. The linux kernel has a framebuffer driver. It has no acceleration, no nothing. The X server provides the drivers for hardware-accelerated graphics. Thus, you can draw to the screen without X, but it won't be anywhere near as fast.
No, what X can do in user space anyone can do (as long as they can run as the same user) unless I've missed something fundamental.
Unless things has changed a user process cannot do direct I/O writes, but has to go vi the kernel to perform these (probably via a kernel module that provides the required interface).
Re: hello,ask about openGL,X,device drivers, questions
Posted: Mon May 04, 2009 6:57 am
by JamesM
skyking wrote:JamesM wrote:yestalk wrote:but i think that those component would like to talk with the hard device that must also be the kernel's component,write according to kernel's specification.
that means ,with out X, we can also draw some thing on the screen, and receive the mouse event(may be not event)...
There again, you're making a false assumption. The linux kernel has a framebuffer driver. It has no acceleration, no nothing. The X server provides the drivers for hardware-accelerated graphics. Thus, you can draw to the screen without X, but it won't be anywhere near as fast.
No, what X can do in user space anyone can do (as long as they can run as the same user) unless I've missed something fundamental.
Unless things has changed a user process cannot do direct I/O writes, but has to go vi the kernel to perform these (probably via a kernel module that provides the required interface).
Exactly, if you'll read my original reply you'll see that I said X.org provides kernel-mode drivers itself. (Most of) the drivers come with X.org and reside in its repository.
Re: hello,ask about openGL,X,device drivers, questions
Posted: Tue May 05, 2009 2:06 am
by skyking
Well it doesn't look like there is any kernel modules from what I've seen. It more looks like the Xserver uses mmap to get access to the video hw memory, which is quite reasonable since they would not want to need to write and maintain the actual driver in kernel space for all card+kernel combos.
Re: hello,ask about openGL,X,device drivers, questions
Posted: Wed May 06, 2009 6:43 am
by yestalk
well,so card vender's driver would be provided by modules ? just implement those load() remove() read() write() ioctrl() satisfaction?
does that mean X can't not utilize the vender provided "well form linux driver" ? or vedio dirver have another driver interface in kernel ?
without knowledge, i can only try to assumption:
X compliance app............................other user sapce app
....|....window talk.............................|
....|....event talk...............................|
....|................................................|
....|................................................|
X System.........................................|
....|-----another X implemention------>.......|
....| graphic in memory........................|
direct i/o....................................OpenGL APIs :drawline() drawothers() drawothers2()....
....|....................................................................|...............|................|
....|....................................................................|...............|................|
....|....................................................................--------------------------------
....|...................................................................................|
....|...................................................................................|
....|..............................................................linux driver: write() iocrtl() ,read()
....|...................................................................................|
....|...................................................................................i/o
.....----------------------card memory---------------------------------------------
........................................|
........................................|
....................................screen
need experts give judge,or tell some clue to read,thanks.
Re: hello,ask about openGL,X,device drivers, questions
Posted: Wed May 06, 2009 6:53 am
by Combuster
yestalk wrote:need experts give judge
Do your homework (and improve your english)
,or tell some clue to read,thanks.
Accelerated Graphic Cards
Re: hello,ask about openGL,X,device drivers, questions
Posted: Wed May 06, 2009 7:05 am
by skyking
yestalk wrote:well,so card vender's driver would be provide by module ?
Can be, but doesn't have to be.
does that mean X can't not utilize the vender provided "well form linux driver" ?
If X couldn't utilize the vendor supplied driver it wouldn't be much point in supplying the module, would it? Of course there have been vendors that got the linux support wrong, but that was probably not the intention.
or vedio dirver have another driver interface in kernel ?
Could also be the case.
X compliance app............................other user sapce app
....|....window talk.............................|
....|....event talk...............................|
....|................................................|
....|................................................|
X System.........................................|
....|-----another X implemention------>.......|
....| graphic in memory........................|
direct i/o....................................OpenGL APIs :drawline() drawothers() drawothers2()....
....|....................................................................| | |
....|....................................................................| | |
....|....................................................................------------------------
....|...................................................................................|
....|...................................................................................|
....|..............................................................linux driver: write() iocrtl() ,read()
....|...................................................................................|
....|...................................................................................i/o
.....----------------------card memory---------------------------
........................................|
........................................|
....................................screen
No, OpenGL API is a set of function called by the client program. Have you even tried to use OpenGL? What happens in the lower layers are by the design of the API quite much up to the implementation, the execution of the OpenGL commands can happen anywhere between (and including) the executable (application), down to the graphics card hardware (and all doesn't have to happen at the same place). Hopefully the graphics appear on the screen in the end...
Re: hello,ask about openGL,X,device drivers, questions
Posted: Wed May 06, 2009 1:44 pm
by JamesM
skyking wrote:Well it doesn't look like there is any kernel modules from what I've seen. It more looks like the Xserver uses mmap to get access to the video hw memory, which is quite reasonable since they would not want to need to write and maintain the actual driver in kernel space for all card+kernel combos.
Mindlessly hypothesizing, much?
Re: hello,ask about openGL,X,device drivers, questions
Posted: Wed May 06, 2009 2:22 pm
by skyking
JamesM wrote:skyking wrote:Well it doesn't look like there is any kernel modules from what I've seen. It more looks like the Xserver uses mmap to get access to the video hw memory, which is quite reasonable since they would not want to need to write and maintain the actual driver in kernel space for all card+kernel combos.
Mindlessly hypothesizing, much?
Which of these is a kernel module? I unpacked one and it don't look like a kernel module, it does not contain the init_module function for one thing. The drivers in my installed xserver they look like a shared object, while linux kernel modules does not.