Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp520457imm; Wed, 4 Jul 2018 01:01:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfdF2aJWVyT/0DkGf0djD8jVul6A32YXBEpIjUi8Th+cl4+jmsCOS0pJw+amrFcJBHHD5PE X-Received: by 2002:a17:902:530a:: with SMTP id b10-v6mr1097858pli.316.1530691277472; Wed, 04 Jul 2018 01:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530691277; cv=none; d=google.com; s=arc-20160816; b=e2qdI8sQp7/BpfCxTLfR2wp45KZ9tUNKnSjyamYu6jJ59+mLMKThqepHYgEmazfYn8 /j3Hf2tV3gEKqFyT9KTx5YyZUHFiLVmYI+2B+GgnYOdceXNCNh4XtjojeCmW864pPx0w zzA0ndgkfl/5V7PPCd1DQ38e/xifOh7itVP03JA8OMwjGJ2sXHw5sROyIXIONrhQoM0X WP9t6atjW9M2G+mnq/u0eropi/bpT9U5niy8g3vvNliqKraa8gsrPSe72sPsppVfrDGj GZfUWBv5If1zeZOCTXnksDY+F9ymc+BfzDLj/p8PxGDWcCWsFsQzddh09Tt4NWixYMTA crFA== 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:arc-authentication-results; bh=Qvw3i/nh5mf0jO5lIM3oUBFK/xGzuWp2NMTTyIgjONs=; b=mckQ8TFJc9dvJsVxWk0VlJxGveV4AiEXThwxcihLSJjEhpCvIbAIwX5GfgG4zPG1eP /Y7AeL9qRPZom+2MrA3jIxeyP4krBMDOcuRlbG3Y7cki7+Qbo22fmgjQxhi8SgFQbGtF LulwgNGQvva6yoBUmXByXIavoRGjGJCBFb2hMv9713ZEppQVK3a0X9jv6nVpHqTlAkD5 1gM2CXJ5ZdyfowOQYEE6OxzjpSQn/D0poh8Sd2pz603aAq+EQnFGhx2hXYb8ax6xTbsh EW80y7mh6spvRjm4yR1JtAB8gLFTaLO1zGB91Wfu52q8faR/5jgWBl8vzrGVbxx4n7x+ fRAw== ARC-Authentication-Results: i=1; mx.google.com; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26-v6si2862070pgo.169.2018.07.04.01.01.02; Wed, 04 Jul 2018 01:01:17 -0700 (PDT) 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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934063AbeGDIAK (ORCPT + 99 others); Wed, 4 Jul 2018 04:00:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46008 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934034AbeGDIAH (ORCPT ); Wed, 4 Jul 2018 04:00:07 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC525C07EFD4; Wed, 4 Jul 2018 08:00:06 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-220.phx2.redhat.com [10.3.116.220]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31BE860C4E; Wed, 4 Jul 2018 08:00:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1753F17445; Wed, 4 Jul 2018 10:00:05 +0200 (CEST) Date: Wed, 4 Jul 2018 10:00:05 +0200 From: Gerd Hoffmann To: Tomeu Vizoso Cc: dri-devel@lists.freedesktop.org, David Airlie , Laurent Pinchart , Jonathan Corbet , Sumit Semwal , Shuah Khan , "open list:DOCUMENTATION" , open list , "open list:DMA BUFFER SHARING FRAMEWORK" , "moderated list:DMA BUFFER SHARING FRAMEWORK" , "open list:KERNEL SELFTEST FRAMEWORK" , Zach Reizner , Daniel Stone Subject: Re: [PATCH v6] Add udmabuf misc device Message-ID: <20180704080005.juutrwri4kxm7yim@sirius.home.kraxel.org> References: <20180703075359.30349-1-kraxel@redhat.com> <20180703083757.GG7880@phenom.ffwll.local> <20180704055338.n3b7oexltaejqmcd@sirius.home.kraxel.org> <9818b301-9c9d-c703-d4fe-7c2d4d43ed66@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9818b301-9c9d-c703-d4fe-7c2d4d43ed66@collabora.com> User-Agent: NeoMutt/20180622 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 04 Jul 2018 08:00:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 04, 2018 at 09:26:39AM +0200, Tomeu Vizoso wrote: > On 07/04/2018 07:53 AM, Gerd Hoffmann wrote: > > On Tue, Jul 03, 2018 at 10:37:57AM +0200, Daniel Vetter wrote: > > > On Tue, Jul 03, 2018 at 09:53:58AM +0200, Gerd Hoffmann wrote: > > > > A driver to let userspace turn memfd regions into dma-bufs. > > > > > > > > Use case: Allows qemu create dmabufs for the vga framebuffer or > > > > virtio-gpu ressources. Then they can be passed around to display > > > > those guest things on the host. To spice client for classic full > > > > framebuffer display, and hopefully some day to wayland server for > > > > seamless guest window display. > > > > > > > > qemu test branch: > > > > https://git.kraxel.org/cgit/qemu/log/?h=sirius/udmabuf > > > > > > > > Cc: David Airlie > > > > Cc: Tomeu Vizoso > > > > Cc: Laurent Pinchart > > > > Cc: Daniel Vetter > > > > Signed-off-by: Gerd Hoffmann > > > > > > I think some ack for a 2nd use-case, like virtio-wl or whatever would be > > > really cool. To give us some assurance that this is generically useful. > > > > Tomeu? Laurent? > > Sorry, but I think I will need some help to understand how this could help > in the virtio-wl case [adding Zach Reizner to CC]. > > Any graphics buffers that are allocated with memfd will be shared with the > compositor via wl_shm, without need for dmabufs. Within one machine, yes. Once virtualization is added to the mix things become more complicated ... When using virtio-gpu the guest will allocate graphics buffers from normal (guest) ram, then register these buffers (which are allowed to be scattered) with the host as resource. qemu can use memfd to allocate guest ram. Now, with the help of udmabuf, qemu can create a *host* dma-buf for the *guest* graphics buffer. That dma-buf can be used by qemu internally (mmap it to get a linear mapping of the resource, to avoid copying). It can be passed on to spice-client, to display the guest framebuffer. And I think it could also be quite useful to pass guest wayland windows to the host compositor, without mapping host-allocated buffers into the guest, so we don't have do deal with the "find some address space for the mapping" issue in the first place. There are more things needed to complete this of course, but it's a building block ... cheers, Gerd