Re: 611x analog out dma

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 15 November 2002 12:51 am, David Schleef wrote:
> On Thu, Nov 14, 2002 at 07:13:16PM +0100, Frank Mori Hess wrote:
> > We got dma analog output (and input) working with the NI 611x cards, but
> > I've hit two issues with output dma.  How to munge output data that is
> > being dma'd directly from the buffer, and how to reliably detect
> > underruns?
> >
> > It seems to me the best way to munge the output data would be for the
> > driver to provide the comedi module with a munging function it can apply
> > when moving data from user space to async->prealloc_buf.  This wouldn't
> > work for memory-mapped output though.
>
> It would be ok for mmap, too, since the application still needs to
> update the buffer pointers.  The munging can be done there, and is
> probably most appropriate, since that's when the data will be in
> the CPU cache.

Okay, I added a 'munge' function pointer to the subdevice struct and
everything seems to be working fine.  If 'munge' is non-null then it is
applied to data moving through the read() and write() file operations.  The
CMDF_RAW flag is gone for the moment, but it could easily be added back in.
It seems to be obsoleted by the current changes though, if we provide munging
functions to the mmaping user then they can simiply decide not to use them if
they are very worried about efficiency and want to deal with the data in the
board's native format directly.

I haven't thought too hard about how to make the buffer checking work with
the current scheme.  It seems clearer to me on how to get it working on a
slightly different scheme though (a scheme almost exactly like the new
munging scheme).  If all the overrun/underrun checking is done in comedi.o,
then buffer checking for mmap could work just like munging.  The buffer
checking would happen when the user called comedi_mark_buffer_read() or the
analagous function for writing to the buffer.  This also would allow people
to ignore buffer overruns simply by never calling the checking functions.

Also, if anyone has a non-611x board with waveform analog out supported by 
the ni_pcimio driver, please test the current cvs to see if the new DMA 
analog output code works with your board.

- --
Frank


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE91TIR5vihyNWuA4URArMeAJ9cXDMdXJKS7TJQhVqblUOrOKNf2QCfTVTH
yHCOJrqIlw4NlaMGy3w6/Vo=
=niOZ
-----END PGP SIGNATURE-----

Received on 2002-11-15Z17:42:41