pci bus mastering for video card

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
999999999
Posts: 6
Joined: Wed Jan 07, 2009 1:02 pm

Re: pci bus mastering for video card

Post by 999999999 »

djmauretto wrote:Do not waste time on nonsense about the bus mastering, and begin to optimize your
algorithms to your calculations
Thanks for your advice, but at the moment I don't have anything to compute. I am just building up an efficient system which I will use when I really have something to calculate :wink: At the moment I am concentrating on the system itself...

Brendan wrote: It seems similar to the GART, but different. AFAIK, the GART is normally only used like a (more flexible) form of scatter-gather bus mastering - e.g. used as a way to transfer data to/from the video card's own memory, rather than as complete replacement of the video card's memory.

For example, it looks like you could do page flipping just by changing the page tables, where the backbuffer is normal system RAM (and becomes the displayed frontbuffer after it's paged into the GPU's address space). It also looks like an OS might need to provide physical memory manager hooks - for example, so that the video driver can release a page of "video RAM" and tell the OS that the page is now free RAM (that can be used as normal by the OS), or so that the video driver can take a page of normal RAM and tell the OS that the page is now unusable (e.g. part of video display memory now); and this applies to all video RAM (for e.g. the "amount of RAM to use for onboard video" BIOS setting can be completely overridden dynamically, one page at a time). However, I wouldn't assume this level of flexibility would be easy to support - there's probably some major complications with cache coherency and MTRRs to consider.
What about a flat memory model? If I do not setup any paging in my os, whould it still be required by the card to work? I could reserve some ram for the video buffers, so I would know that the area is always available for video stuff (no need for the card to worry about freing pages etc.). Also, about the GART? From what you wrote, it seems to be very connected with bus mastering. Is there an "agp-gart"/"pci-ex gart" I should study or is it a specific characteristic of a card I should look for into its specs? I have just found out that I do not have the intel-integrated gpu computer any more, so I have to stick with my other computers, at the moment...Now I will do some tests on a geforce 6600 on agp8x and chipset:
pci32 gives me:
Bus 0 (PCI), Device Number 0, Device Function 0
Vendor 8086h Intel Corporation
Device 2570h 82865G/PE/P, 82848P DRAM Controller / Host-Hub Interface
................
Bus 0 (PCI), Device Number 1, Device Function 0
Vendor 8086h Intel Corporation
Device 2571h 82865G/PE/P, 82848P PCI-to-AGP Bridge
................
I have downloaded the manuals for these 2 chips but I only seem to find pci bus matering bit on pci command register. I can't find more about it...Should I look deeplier into agp specs?

Thank you very much!

All the best!
Giovanni
999999999
Posts: 6
Joined: Wed Jan 07, 2009 1:02 pm

Re: pci bus mastering for video card

Post by 999999999 »

Sorry, I just forgot to say that I found this thread:
http://forum.osdev.org/viewtopic.php?f=1&t=12795
In the last post, AirFlight talks about having a great speed improvement by activating write-combining for fb area (I have already done it) and setting AGP speed. Guess it could be found in agp specs. What about PCI-ex? I also think bios gives os an already anabled agp max speed..am I wrong on it? But the most interesting part is "write posting". He describes it in a very similar manner to bus mastering! I can't find it in intel manuals... What is this functionality about?

Thank you very much!


All the best!
Giovanni
User avatar
Combuster
Member
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: pci bus mastering for video card

Post by Combuster »

I don't know about write posting, but there's a full description of AGP on our wiki
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: pci bus mastering for video card

Post by jal »

999999999 wrote:I was planning to create a single-tasking core of an operating system (32-bit protected mode): my aim is having the complete control of the hardware to be able to use 100% of hardware resources (no other processes running).
You may want single processing (i.e. one process), but not single tasking (i.e. one task), as on multicore CPUs and multi CPU systems, multi tasking is the only way to use 100% of the CPUs' power.


JAL
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: pci bus mastering for video card

Post by Dex »

jal wrote:
999999999 wrote:I was planning to create a single-tasking core of an operating system (32-bit protected mode): my aim is having the complete control of the hardware to be able to use 100% of hardware resources (no other processes running).
You may want single processing (i.e. one process), but not single tasking (i.e. one task), as on multicore CPUs and multi CPU systems, multi tasking is the only way to use 100% of the CPUs' power.


JAL
I would say you need some form of multi-threading.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: pci bus mastering for video card

Post by jal »

Dex wrote:I would say you need some form of multi-threading.
Yes, you are right. It's easy nowadays to equate threads with tasks, but they're not one and the same. I stand corrected.


JAL
Post Reply