2002-12-13 19:07:22

by Jason Howard

[permalink] [raw]
Subject: DMA from SCSI controller to PCI frame buffer memory.

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

--
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]



2002-12-14 02:55:37

by Alan

[permalink] [raw]
Subject: Re: DMA from SCSI controller to PCI frame buffer memory.

On Fri, 2002-12-13 at 19:15, Jason Howard wrote:
> 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.

2002-12-14 05:17:01

by Andrew Morton

[permalink] [raw]
Subject: Re: DMA from SCSI controller to PCI frame buffer memory.

Alan Cox wrote:
>
> On Fri, 2002-12-13 at 19:15, Jason Howard wrote:
> > 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.

2002-12-14 20:22:05

by Jason Howard

[permalink] [raw]
Subject: Re: DMA from SCSI controller to PCI frame buffer memory.

> 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
--
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]


2002-12-15 01:57:44

by Douglas Gilbert

[permalink] [raw]
Subject: Re: DMA from SCSI controller to PCI frame buffer memory.

Jason wrote:
> 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,
Here is a less general solution that I worked on some
time ago involving the scsi generic driver.
http://www.torque.net/sg/mem2disk.html

It worked ok for one application in the early 2.4 series.

Doug Gilbert