Re: DMA bitblt pageing?

2005-07-09 Thread Alan Cox
On Gwe, 2005-07-08 at 09:18, Thomas Hellström wrote:
 Is this because they are not physically contigous or because they may not
 be accessible to the PCI device? I was thinking of using vmalloced memory
 instead of kmalloced for the device sg-list, and since it is a linked list
 it should be able to deal with non-contigous pages.

It may not be physically accessible. The dma allocation functions should
be used to reliably allocate DMA spaces. 

 Preferrably I'd like to have an implementation where one can start a DMA
 bitblt operation then return to whatever is being done at the moment, and
 a sync function called to make sure the DMA has finished. This will
 require, however, a small sg-list / page pointer array ring buffer and
 that all free() and unlock operations can be done from the DMA complete
 interrupt handler.

This is near enough how video4linux works except that it uses a ring
buffer rather than keep freeing (as its TV capture) so only does the pci
write to stop, read to avoid posting and free at close time.

Alan



---
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: DMA bitblt pageing?

2005-07-08 Thread Thomas Hellström
Hi!

 3.) Is memory allocated with vmalloc always locked into physical memory
 until freed?

 Yes but it may not be DMAable.



Thanks.

Is this because they are not physically contigous or because they may not
be accessible to the PCI device? I was thinking of using vmalloced memory
instead of kmalloced for the device sg-list, and since it is a linked list
it should be able to deal with non-contigous pages.

Preferrably I'd like to have an implementation where one can start a DMA
bitblt operation then return to whatever is being done at the moment, and
a sync function called to make sure the DMA has finished. This will
require, however, a small sg-list / page pointer array ring buffer and
that all free() and unlock operations can be done from the DMA complete
interrupt handler.

Maybe a bit over-complicated but very useful for XvMC subpictures and
speculative OpenGL texture downloads to system memory.

/Thomas





---
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


DMA bitblt pageing?

2005-07-07 Thread Thomas Hellström

Hi!

I'm trying to incorporate a patch I got for DMA bitblt into the via drm. 
Probably useful for a lot of things including Xv image transfer, Texture 
downloads and Exa acceleration.


Got it working, but to really know what I'm doing, being a kernel 
programming novice, could I have some help with these ones?


1.) get_user_pages() should presumably lock a page into physical memory. 
Will this always cause a segfault for an invalid address?
2.) Unlocking pages previously locked with get_user_pages(): is 
page_cache_release() sufficient or are more calls needed? Could the 
unlocking functions be called from an interrupt handler? Is a refcount 
maintained for this page locking or is it one-level only?
3.) Is memory allocated with vmalloc always locked into physical memory 
until freed?
4.) Are there any DRM macros for the above, to make porting to other 
OS'es easier?


Thanks for any advice,
Thomas Hellström






---
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: DMA bitblt pageing?

2005-07-07 Thread Jon Smirl
http://lwn.net/Kernel/LDD3/

Chapter 15 explains how DMA works under Linux.

-- 
Jon Smirl
[EMAIL PROTECTED]


---
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: DMA bitblt pageing?

2005-07-07 Thread Thomas Hellström

Jon Smirl wrote:


http://lwn.net/Kernel/LDD3/

Chapter 15 explains how DMA works under Linux.

 


Thanks!

/Thomas




---
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: DMA bitblt pageing?

2005-07-07 Thread Alan Cox
On Iau, 2005-07-07 at 23:50, Thomas Hellström wrote:
 1.) get_user_pages() should presumably lock a page into physical memory. 
 Will this always cause a segfault for an invalid address?

You'll get an error for invalid space. You may also get null entries in
the array for locking the paged if they relate to a hole in memory.

 2.) Unlocking pages previously locked with get_user_pages(): is 
 page_cache_release() sufficient or are more calls needed? Could the 
 unlocking functions be called from an interrupt handler? Is a refcount 
 maintained for this page locking or is it one-level only?

It is refcounted.

 3.) Is memory allocated with vmalloc always locked into physical memory 
 until freed?

Yes but it may not be DMAable.




---
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel