From owner-freebsd-multimedia@FreeBSD.ORG Sun Feb 29 18:22:34 2004 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55AB216A4CE; Sun, 29 Feb 2004 18:22:34 -0800 (PST) Received: from feith1.FEITH.COM (feith1.FEITH.COM [192.251.93.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id F34F743D2F; Sun, 29 Feb 2004 18:22:33 -0800 (PST) (envelope-from john@feith.com) Received: from jwlab.FEITH.COM (jwlab.FEITH.COM [192.251.93.16]) by feith1.FEITH.COM (8.12.10+Sun/8.12.9) with ESMTP id i212MWGS006460; Sun, 29 Feb 2004 21:22:32 -0500 (EST) Received: (from john@localhost) by jwlab.FEITH.COM (8.11.7p1+Sun/8.11.7) id i212MW801703; Sun, 29 Feb 2004 21:22:32 -0500 (EST) Date: Sun, 29 Feb 2004 21:22:32 -0500 (EST) From: John Wehle Message-Id: <200403010222.i212MW801703@jwlab.FEITH.COM> To: scottl@freebsd.org Content-Type: text X-Scanned-By: MIMEDefang 2.39 X-Archived: cashew.FEITH.COM cc: multimedia@freebsd.org Subject: Re: FreeBSD 4.9 / 5.2 Hauppauge PVR-250 / 350 Driver Patch (Jan 31, 2004) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2004 02:22:34 -0000 > 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 | | -------------------------------------------------------------------------