Date: Sun, 29 Feb 2004 21:22:32 -0500 (EST) From: John Wehle <john@feith.com> To: scottl@freebsd.org Cc: multimedia@freebsd.org Subject: Re: FreeBSD 4.9 / 5.2 Hauppauge PVR-250 / 350 Driver Patch (Jan 31, 2004) Message-ID: <200403010222.i212MW801703@jwlab.FEITH.COM>
next in thread | raw e-mail | index | archive | help
> When you are allocating a buffer with bus_dmamem_alloc(), > you don't need to check the return value of bus_dmamap_load() > since it is guaranteed to succeed and not be deferred in that case. So it's preferable to keep the code simple by just having a comment in the driver indicating the call can't fail instead of being paranoid and checking the return? > Also, the dma tag for these buffers should be created with NULL, > NULL for the lock arguments. Why? You wouldn't by chance have a pointer to documentation for bus_dma_tag_create which discusses the relevant issues? > Also, you might be able to save the overhead of uiomove() by using > bus_dmamap_load_uio() to operate directly on the uio buffers rather > than pre-allocting static buffers. The current design of using a ring buffer addresses the following concerns: 1) The data needs to be massaged by the driver prior to handing it off to the application. 2) The buffer supplied by the application might not be large enough to contain the entire frame (and the card requires an entire frame to be transferred in one DMA operation at a time). 3) The card is capturing data in realtime and can't wait for resources to become available. Perhaps in the future further information on the card's capabilities will become available allowing for a more optimal design. > Anyways, very nice driver. Thanks for the feedback. -- John ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | -------------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403010222.i212MW801703>