Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp266097imu; Thu, 20 Dec 2018 21:55:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN4DwvRAsxB3zRyNydCeVhmdh0URzLz5ucfLaiBs/a8XSKhlb7sDyUJBgeclM7UuXnc9wqh4 X-Received: by 2002:a17:902:22f:: with SMTP id 44mr1175117plc.137.1545371739829; Thu, 20 Dec 2018 21:55:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545371739; cv=none; d=google.com; s=arc-20160816; b=T+TAWLNZX2b+5ZxXrInsjjUoYNkxjasWWc73YNp67pwJFA4FiiEuKgNjDa5GM81dnm /jHzmtahx4wXHLSCFIjm455xR7yqDOPlKyYlVtsj8EHq8ovIUzsA+KbXxp6Urtqn4up8 FM+5c1ieZI+uFl/XE44h0w7HrGNjR4idDC3B1y7o7/dEFCDDlJ7uuZ9uTvyymCcZXi8d LIjiPaV72Nw+f2NHJtJkifFM0qs5IXZpFV2DxSNin60mB6lqHqBIK1pOAvyrNRwPeovk coHEHHE3xtkJ+Xe6mdZyG7kwbw8T1FHOn4bFenC2VKbmMGiwS5yTvfxtPwO+7nsO9sgu 3UKQ== 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=n7kHmUd9NWsVcSQjDie0de8H/6KifCjV/t7SEMIprHM=; b=AmsOSrZlSA2sEgohCXSwofpohloNmL1PQ2JKsu97ivOAMnUL+kTAQEIc5Fi/HyeBiH a1GKxWJrRx0rQV1mbX1sBx5ZE4JdSfQ2mdv3MgNbQo2/lLehj7LHdwphfbrKLKgdCGUL 9qzU4TXU3YZ8mK4XuL6ubydx5Xy3CYh+eWNCI7Uo5mTTi8v5XRhpFmfvI8A6fhOTgsxd w4ReYZ9Y7D/CGlw0S+X6dkINGLHGe+x86xQb0H2EOu41CtUlPx65Yaoem5vRrltufPLm 5w4mFDHa8FUfTf9ucMGSIpfDTjf+ZhhA7piN6+/5ZlIx44iRDyttGLBCGCcj9sEnBAwM +j3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=GAuPK3M3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k190si19533975pgd.64.2018.12.20.21.55.24; Thu, 20 Dec 2018 21:55:39 -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=@infradead.org header.s=bombadil.20170209 header.b=GAuPK3M3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389457AbeLTSiz (ORCPT + 99 others); Thu, 20 Dec 2018 13:38:55 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:50346 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731280AbeLTSiz (ORCPT ); Thu, 20 Dec 2018 13:38:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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=n7kHmUd9NWsVcSQjDie0de8H/6KifCjV/t7SEMIprHM=; b=GAuPK3M3GhPbWSmQD9yxlNrAV atVUsYHU1uG8HtVBEt5FIk9fUImoviog1al6vwFl2Ag+CnqsGQFgOQ5X9CwShCeCxffYpKkXQ7HQn nUL+zhQ5k7UWXPYlizVd9PtXmgNepfJudD5komJn4qI97s/9qbusrvVilzhpki3Ba7wiCyRpKsgs5 jpuPZe9cY4zgq1CR3Z7HX/hUA8xd1vIBFB1uiiqslYlccKLBxLnGjfLPBuRvlC21Bnbs96rYyFvd2 BdwHCrvKHgMHeqNWshdlh9mweE9pn1C0oziMW/MUz8T/vdjyrDXy9ru8ozooyEjyy0LxYXD/Y6RZi T0onVamLA==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1ga3Df-0007D9-KH; Thu, 20 Dec 2018 18:38:51 +0000 Date: Thu, 20 Dec 2018 10:38:51 -0800 From: Christoph Hellwig To: Daniel Vetter Cc: Christoph Hellwig , Oleksandr Andrushchenko , Juergen Gross , Oleksandr Andrushchenko , Linux Kernel Mailing List , dri-devel , Daniel Vetter , xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com Subject: Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent Message-ID: <20181220183851.GA27025@infradead.org> References: <20181127103252.20994-1-andr2000@gmail.com> <17640791-5306-f7e4-8588-dd39c14e975b@tronnes.org> <20181220153646.GA22997@infradead.org> <20181220173950.GA19641@infradead.org> <20181220183311.GA30801@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 07:35:15PM +0100, Daniel Vetter wrote: > > Err, with streaming DMA buffer sharing is trivial. The coherent DMA > > allocator is what causes all kinds of horrible hacks that can't actually > > work on various platforms. > > Hm, I thought the streaming dma api is the one that causes bounce > buffers and all that fun. If you're unlucky at least. Yes it may. But even if that happens everything will actually work, just slower. While the dma coherent API is simply broken. But if you don't want bounce buffering you need to use the dma noncoherent allocator as proposed here: https://lists.linuxfoundation.org/pipermail/iommu/2018-December/031982.html which combines allocating memory that doesn't need to be bounce buffered with a sharing scheme that can actually work.