Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2251092imu; Thu, 24 Jan 2019 09:34:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN4K92eYXzb2b1I8k4IR2T8f/MZ8U7rMIDd/4e7SUYCsRcPAo+98aacxoNEf/rb7wByxd95Z X-Received: by 2002:a62:da5a:: with SMTP id w26mr7381176pfl.106.1548351293323; Thu, 24 Jan 2019 09:34:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548351293; cv=none; d=google.com; s=arc-20160816; b=MO9oEtGMGwz8i5srz1ZBm5RE29RO6HQx8Yif0oAWjeWc1iLmNN/cmOGUTWZGTA4Dj2 RXzMkL6Ew/HdgRJ/qVE2Y1GYeedPcKvAJDykUH3O2jTLCytBhQegRASjDGRZH5GFXI4p HCbU10is5cqWO/k5St7vRa9WcWK3gqS7sn7lGgu3/vmtmYGPGH90/fAkrrt2k/RPLyaP 6q8fEqnyxEPjrjJ+u60pv4NdEIsg/G1eftmzAenjX0UBYae+8qfe0rxIuEQpeV2VotFI lNwuAbuDpKMcUfJDqnNd8tUqn9y2waCzWrVWwG7KRyXd+Xdf2ws5FzQkzYhsVHoLrijn nxqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Aavs4DpFxrFSeZJ9Gy7B+7nTXknzrCUZh/kQHGogyII=; b=XVSSBLBm/avVtzvE7uU5Y//99Kj1jPNdD+Nj8n7SD9jzZBUDtN2ElS8bPgecmor1GO wgVZZb6DE6xl2A/Rdne/jaDg0ZcJsguHxCxZl7CCj9ybmPXI1HQnu7Kpzk6Oy/7Jtf9y 5SVjqhXQzFaJtbJb30AUbdEgVvZIrnHoufsBxCSfO9jpI9hxGLvuzLJjOz+oS92e0KhU vFC8OgcZt9cq1eBaAVH4b8G8PU+MWU4eBM8o8OfsJWkCsMTbNivbprkR5qpglkd4xdFQ ipMJCM8bidoTDtc760YzmlcnFaEgYQmSGtn80wjlXPCgSlY1P/oXBRSE/IBuR9rRk9AT mw0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=uRWlpH4E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k25si22679364pfe.10.2019.01.24.09.34.37; Thu, 24 Jan 2019 09:34:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=uRWlpH4E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729000AbfAXRdw (ORCPT + 99 others); Thu, 24 Jan 2019 12:33:52 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:51334 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727573AbfAXRdw (ORCPT ); Thu, 24 Jan 2019 12:33:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Aavs4DpFxrFSeZJ9Gy7B+7nTXknzrCUZh/kQHGogyII=; b=uRWlpH4EPWVCsFL54TDfOaCq2 DZOstdV8+J0blo4siWD1M/3uVqtf/TUYSFHUOLsMSVASSRs6B7uA/R59erB/RoivxXnzx9wfMYTu0 /aL8ibd2ewB46FelhbgsarnfNgws/+tya/pjtBeuTLby2jzphhv3ZVKYYHEzoo/runrEE=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gmisU-0006Wl-JO; Thu, 24 Jan 2019 17:33:22 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id E3F211121B6F; Thu, 24 Jan 2019 17:33:21 +0000 (GMT) Date: Thu, 24 Jan 2019 17:33:21 +0000 From: Mark Brown To: Jaroslav Kysela Cc: Leo Yan , Takashi Iwai , alsa-devel@alsa-project.org, arnd@arndb.de, keescook@chromium.org, bgoswami@codeaurora.org, sr@denx.de, gustavo@embeddedor.com, philburk@google.com, willy@infradead.org, mchehab+samsung@kernel.org, sboyd@kernel.org, vkoul@kernel.org, Baolin Wang , daniel.thompson@linaro.org, mathieu.poirier@linaro.org, srinivas.kandagatla@linaro.org, anna-maria@linutronix.de, corbet@lwn.net, jmiller@neverware.com, ckeepax@opensource.wolfsonmicro.com, joe@perches.com, o-takashi@sakamocchi.jp, colyli@suse.de, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] ALSA: core: Add DMA share buffer support Message-ID: <20190124173321.GE5641@sirena.org.uk> References: <290f6d3a5fe288b87480cc5fa12c5139728daeca.1547787189.git.baolin.wang@linaro.org> <81e894ba-acad-2fd4-996d-8d35edd8825a@perex.cz> <20190118190805.GF6260@sirena.org.uk> <20190121124053.GA12679@sirena.org.uk> <20190122202535.GK7579@sirena.org.uk> <20190123124658.GE15906@leoy-ThinkPad-X240s> <3962daba-f6ed-d706-c618-b791a1ba6b59@perex.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="H8ygTp4AXg6deix2" Content-Disposition: inline In-Reply-To: <3962daba-f6ed-d706-c618-b791a1ba6b59@perex.cz> X-Cookie: Love America -- or give it back. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --H8ygTp4AXg6deix2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 24, 2019 at 02:43:02PM +0100, Jaroslav Kysela wrote: > If I look to the dma_buf_fd() implementation: > fd = get_unused_fd_flags(flags); > fd_install(fd, dmabuf->file); > .. what if we just add one new ioctl to the ALSA's PCM API which will > return a new anonymous inode descriptor with the restricted access to > the main PCM device to satisfy the SELinux requirements / security > policies? It might be more nice and simple solution than to implement > the full dma-buf interface for the ALSA's PCM devices. That certainly works for me so long as the security people are happy. > Question: The dma-buf also implements the fencing, but I am not able to > determine, if this mechanism is used in android [1]. It may allow > concurrent mmap and synchronize apps - but the sound server should > manage the access to the DMA buffer anyway. In my opinion, it makes much > sense for the video-pipes when the hardware does some accelerations > (encoding/decoding). We had the same discuission off list and couldn't think of a need for that feature in the audio context but left it in as it's already there with dma-buf so there's no real cost to implementing it and we weren't sure we weren't missing something. --H8ygTp4AXg6deix2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlxJ9uEACgkQJNaLcl1U h9BHRwf9GMsmMNurfImygbIVYIiOSvt5nUSqwx8eQXILTHWza2Pumojxs0EqTQgU Tt3s81HcYK7RkDUqdV9BvarzZfQfA8pPK9+s7TzIIv1eJzIrRu8h5CJKaZwNhdzz sHQki9F7tBbUKQXNlDvTvU078HyoaMe1I/yZgWrz1WJl2u3+FCugB137wke6fpSD NyMTbC7JrwAVcNZWVCZcQHAs3cbPDc30FbZ2OmpQUcWhFOR9Y5lUpp4jzg811+cR PwTuU8EyUNjZwzoj6gcVP1whifDugAIx7rLziEOKPLPE708MitHkVI+1+j32Xfcw 2aXLRNhXODvEP3Ll2N5mAx4GCwZqnQ== =XB4S -----END PGP SIGNATURE----- --H8ygTp4AXg6deix2--