From owner-freebsd-multimedia@FreeBSD.ORG Fri May 6 13:38:04 2011 Return-Path: Delivered-To: multimedia@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6379B106564A; Fri, 6 May 2011 13:38:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5DE8FC1E; Fri, 6 May 2011 13:38:03 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA24557; Fri, 06 May 2011 16:38:00 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DC3F9B8.3030505@FreeBSD.org> Date: Fri, 06 May 2011 16:38:00 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Kostik Belousov References: <4DC3B764.4030801@FreeBSD.org> <20110506133204.GE48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110506133204.GE48734@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: current@FreeBSD.org, multimedia@FreeBSD.org Subject: Re: dsp mmap change X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 13:38:04 -0000 on 06/05/2011 16:32 Kostik Belousov said the following: > On Fri, May 06, 2011 at 11:55:00AM +0300, Andriy Gapon wrote: >> >> I would like to ask for a review and/or testing of the following patch: >> http://people.freebsd.org/~avg/dev_dsp_mmap.diff >> >> It's supposed to fix an issue described here: >> http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-February/011691.html >> >> In short, the following pseudo-code should do the right thing: >> fd = open(/dev/dsp, O_RDWR); >> mmap(PROT_READ, fd); >> mmap(PROT_WRITE, fd); >> >> Thank you! > > I think that you have to call PCM_GIANT_LEAVE() when returning > EINVAL on the vm_pager_alloc() failure. Yes, thank you. > Your patch hardcodes an assumption that sndbufs are always > contiguous. I was unable to convince myself that this is true. I think that this should be true for the case when DMA is used? But, yes, very good point. -- Andriy Gapon