Received: by 10.223.185.116 with SMTP id b49csp1023409wrg; Fri, 16 Feb 2018 11:01:00 -0800 (PST) X-Google-Smtp-Source: AH8x224CIE0FHpBoSg8v6MBYXJtljnqVI1YWwKZI0kLc2jn2OE/Eg1vdBu/79bAafXWO6pCEJfpj X-Received: by 10.101.100.208 with SMTP id t16mr5676612pgv.398.1518807659871; Fri, 16 Feb 2018 11:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807659; cv=none; d=google.com; s=arc-20160816; b=hfh3ByOcX6pkmGBoYxcPGLE5SmvheOrI0cgDMXtqQS07vWwZ+uy9xkSkFWvAn9plpb TTkwgkB/tzCnx9tvqkzF7+YYcRBbkGrJlCc1jXCAr6UxmgEHhbWgCtDBkfqf3kSvIneR 4PAoJT1aiI4UfpxBjLdWgriPik7THuue6tK0zjAI5UiJykp/kjohky2d9yjOmdvjnQI4 1Y1csWQ4Nprbn76yu7g9V5Lu/GwRGhzMzX0oIfsIZNbkfm4PX7BjU8LMW1tYog25zpDP nD63V9axjN72ILPcVBeY34Dfypm+SvhfCkQQ0qVtdlyWKs8c5lGNmoUWKruBfu4ll0hB T4rQ== 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=2Zcj7Nbl7qlTCdswM83WhBDmqPCExtkb+ziE55oSqPQ=; b=wY6zdjERmhXe/VOxI9Ovz6MhMRrwexo69rrFy6l23hP5W/IHfXCi4Uje3dX4imCefK YRxAsQ4uv9ES0WpMfHHyQhM2h2foTFWJW9P3ztsxqAoAIdTsns9tFw0U6tULIW45Sc8w RCrhRd/oBjhed2uUjDujVIBeHqY5p2DsknSDvEIxKUKSok9W/k0hC6ncBCrfN5DI8UfI kA9SL5Kws3wiGYuyxMJJb1fhNlNzZH4Lk+LwC8miBWKw64TSv3/5o6OC5MoI4eDTxTrn X0ikDowAVrTxykkbEUwm9X0SAINalPmkMWW49kmdpYZ48cvhgOJjVVKA301FNSHKg+aA 4KiQ== 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 17si3613295pfw.21.2018.02.16.11.00.44; Fri, 16 Feb 2018 11:00:59 -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; 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 S934288AbeBPKss (ORCPT + 99 others); Fri, 16 Feb 2018 05:48:48 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56358 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934225AbeBPKso (ORCPT ); Fri, 16 Feb 2018 05:48:44 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D1123406AE1C; Fri, 16 Feb 2018 10:48:43 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89F3CB350A; Fri, 16 Feb 2018 10:48:41 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D95FCEAF; Fri, 16 Feb 2018 11:48:40 +0100 (CET) Date: Fri, 16 Feb 2018 11:48:40 +0100 From: Gerd Hoffmann To: Tomeu Vizoso Cc: linux-kernel@vger.kernel.org, Zach Reizner , kernel@collabora.com, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, "Michael S. Tsirkin" , David Airlie , Jason Wang , Stefan Hajnoczi Subject: Re: [PATCH v3 1/2] drm/virtio: Add window server support Message-ID: <20180216104840.wtqblyrrhwek6ox7@sirius.home.kraxel.org> References: <20180201163623.5cs2ysykg5wgulf4@sirius.home.kraxel.org> <49785e0d-936a-c3b4-62dd-aafc7083a942@collabora.com> <20180205122017.4vb5nlpodkq2uhxa@sirius.home.kraxel.org> <20180205160322.sntv5uoqp5o7flnh@sirius.home.kraxel.org> <20180206142302.vdjyqmnoypydci4t@sirius.home.kraxel.org> <04687943-847b-25a7-42ef-a21b4c7ef0cf@collabora.com> <20180212114540.iygbha554busy4ip@sirius.home.kraxel.org> <37179029-8ccb-8eb2-0901-04b64cef3608@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37179029-8ccb-8eb2-0901-04b64cef3608@collabora.com> User-Agent: NeoMutt/20171215 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 16 Feb 2018 10:48:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 16 Feb 2018 10:48:43 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Yes. > > Would it make sense for virtio-gpu to map buffers to the guest via PCI BARs? > So we can use a single drm driver for both 2d and 3d. Should be doable. I'm wondering two things though: (1) Will shmem actually help avoiding a copy? virtio-gpu with virgl will (even if the guest doesn't use opengl) store the resources in gpu memory. So the VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D copy goes from guest memory directly to gpu memory, and if we export that as dma-buf and pass it to the wayland server it should be able to render it without doing another copy. How does the wl_shm_pool workflow look like inside the wayland server? Can it ask the gpu to render directly from the pool? Or is a copy to gpu memory needed here? If the latter we would effectively trade one copy for another ... (2) Could we handle the mapping without needing shmem? Possibly we could extend the vgem driver. So we pass in a iov (which qemu gets from guest via VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING), get back a drm object. Which effectively creates drm objects on the host which match the drm object in the guest (both backed by the same set of physical pages). cheers, Gerd