Skip to contentSkip to conversation

DMA from SCSI controller to PCI frame buffer memory.

DISCUSSION Jason Howard 3 participants 4 messages Dec 13, 2002 – Dec 14, 2002

lore
Share & tools
lore
#0 lore raw

Hello All,

I am wondering if the functionality exists in the Linux kernel to DMA from a SCSI controller directly into frame buffer memory of a PCI video card? Is there a standard method for this (similar to sendfile) or will it require some hacking?

Jason

Signature · 10 lines
 Jason Howard

Professional:
  SpectSoft, LLC
  http://www.spectsoft.com  [email protected]      
  Phone: +1.209.847.7812    Fax: +1.209.847.7859
Personal:
  http://www.psinux.org     [email protected]
  Cell: +1.209.968.1289
  Text Message: [email protected]
#1 lore raw
Quoted 6 lines · Jason Howard

Hello All,

I am wondering if the functionality exists in the Linux kernel to DMA from a SCSI controller directly into frame buffer memory of a PCI video card? Is there a standard method for this (similar to sendfile) or will it require some hacking?

In theory you can mmap the frame buffer memory, then do O_DIRECT I/O into it. In practice it will buffer (I hope it still does). One of the problems is that there are huge lists of PCI->AGP DMA errata in chipsets.

#2 lore raw
Quoted 11 lines · Alan Cox
Quoted 6 lines · Jason Howard

Hello All,

I am wondering if the functionality exists in the Linux kernel to DMA from a SCSI controller directly into frame buffer memory of a PCI video card? Is there a standard method for this (similar to sendfile) or will it require some hacking?

In theory you can mmap the frame buffer memory, then do O_DIRECT I/O into it. In practice it will buffer (I hope it still does).

An O_DIRECT disk read into a mmapped device region will fail (if it doesn't, it'll oops ;)). O_DIRECT requires valid pages inside mem_map[].

See the `vma->vm_flags & VM_IO' test in get_user_pages(), and the VALID_PAGE() test in get_page_map().

Hacking is required to do this.

#3 lore raw
In reply to Alan Cox
Quoted 4 lines

In theory you can mmap the frame buffer memory, then do O_DIRECT I/O into it. In practice it will buffer (I hope it still does). One of the problems is that there are huge lists of PCI->AGP DMA errata in chipsets.

I am not accessing the AGP bus as my frame buffer is located on the PCI bus.
00:08.0 Multimedia video controller: Unknown device f1d0:efac

	Subsystem: Unknown device f1d0:efac
	Flags: bus master, stepping, medium devsel, latency 64, IRQ 10
	Memory at f4000000 (32-bit, non-prefetchable) [size=4K]
	Memory at f6000000 (32-bit, prefetchable) [size=16M]

(I am working with the second memory address)

Any recommendations on where to start hacking? Would it be a good idea to add O_DIRECT to a mmaped PCI space? The kernel should not be doing any buffering whatsoever, as we will be coming close to filling the pci bus up with transfers from direct disk->fb already. (We are already doing buffering on the FB card as well)

Jason

Signature · 10 lines
 Jason Howard

Professional:
  SpectSoft, LLC
  http://www.spectsoft.com  [email protected]      
  Phone: +1.209.847.7812    Fax: +1.209.847.7859
Personal:
  http://www.psinux.org     [email protected]
  Cell: +1.209.968.1289
  Text Message: [email protected]