Received: by 10.223.185.116 with SMTP id b49csp2557072wrg; Thu, 15 Feb 2018 13:35:40 -0800 (PST) X-Google-Smtp-Source: AH8x225aWpqXsV0xowULtGwUitEMrS6ACYexmja92SO9YxX9fhUL+4WESGjuARjSXIlthzFy9Cbv X-Received: by 2002:a17:902:5a0d:: with SMTP id q13-v6mr3769768pli.152.1518730540627; Thu, 15 Feb 2018 13:35:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518730540; cv=none; d=google.com; s=arc-20160816; b=WkA2uxQzidPNCtBGQRHRHp5rET3tbX1qkJ3PfBGqthI8QP5jT/g1Emmuvw9i4S1gpC UdorCFogGRdMFSEm50REz0Kmsr805OvKbTfrJc0Q091qt6k3vrBIrNoPb0CYylRuKD0i 69WfpxrJryoFesy2yiJsKXIfO+yBTVybeIT1hlMntXjvhGQBO9qPijRde5szU2Pz/Z9M 3RIkPG1SQSETGdPtuDeS2Q3JtRo7lZ5O3soqJXZ4NkfE2SxkUO4Btwvk8W4krdIxDOWV TwSO6kgZhCaPhBL+9ARAIaLQuwpbL41kZ/v8qbP5eyeUfrfur/93PmiylT9tGTHOvtzn 3I9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=aW3jTO3wFfoS2w9I62UNyYZBypyUKnV60xxJd3YK9ds=; b=qiK+7xq1f+h8ijbj0fGta4TssFzXI2AKrkwIcUimgqO1mc0ALKMwwfbEqb/6e1kVj5 38V8Ag5SpJuc5L7CmT2+uJP79H9HX/sjkLQDj5hcDOBa8xdYLgklCW4UpnJmKdPJfNzv t+96NbiPlp+H3r0Lu9E5/TpAk7V3pFWcscXmvLG6CQaM7AVtH59jpSquzq8EDQbEwx9l D/Yq9czxeQE2llHSPg+T0SkSmux5VcLnV17pns6QjMnZdPYR/ILwxT5nOe48g27be9Uq SqHFyYDG/2UNOA2tLDRzvzvfJAASHs1qFD/Ts4LM4CX8/swHOcWkqZYLElYDyxBAqwn8 ANxA== 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e33-v6si1594577pld.628.2018.02.15.13.35.25; Thu, 15 Feb 2018 13:35:40 -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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163891AbeBOP2u (ORCPT + 99 others); Thu, 15 Feb 2018 10:28:50 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:56374 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163874AbeBOP2r (ORCPT ); Thu, 15 Feb 2018 10:28:47 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: tomeu) with ESMTPSA id EC79B270EA7 Subject: Re: [PATCH v3 1/2] drm/virtio: Add window server support To: Gerd Hoffmann 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 References: <20180126135803.29781-1-tomeu.vizoso@collabora.com> <20180126135803.29781-2-tomeu.vizoso@collabora.com> <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> From: Tomeu Vizoso Message-ID: <5ca446c7-582c-6871-c13f-9fc44c535ebc@collabora.com> Date: Thu, 15 Feb 2018 16:28:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180212114540.iygbha554busy4ip@sirius.home.kraxel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/12/2018 12:45 PM, Gerd Hoffmann wrote:>>>> 4. QEMU pops data+buffers from the virtqueue, looks up shmem FD for each >>>> resource, sends data + FDs to the compositor with SCM_RIGHTS >>> >>> BTW: Is there a 1:1 relationship between buffers and shmem blocks? Or >>> does the wayland protocol allow for offsets in buffer meta data, so you >>> can place multiple buffers in a single shmem block? >> >> The latter: >> https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_shm_pool > > Ah, good, that makes it alot easier. > > So, yes, using ivshmem would be one option. Tricky part here is the > buffer management though. It's just a raw piece of memory. The guest > proxy could mmap the pci bar and manage it. But then it is again either > unmodified guest + copying the data, or modified client (which requests > buffers from guest proxy) for zero-copy. What if at VIRTIO_GPU_CMD_RESOURCE_CREATE_2D time we created a ivshmem device to back that resource. The ivshmem device would in turn be backed by a hostmem device that wraps a shmem FD. The guest client can then export that resource/BO and pass the FD to the guest proxy. The guest proxy would import it and put the resource_id in the equivalent message in our protocol extension. QEMU would get that resource id from vsock, look up which hostmem device is associated with that resource, and pass its FD to the compositor. > We also need a solution for the keymap shmem block. I guess the keymap > doesn't change all that often, so maybe it is easiest to just copy it > over (host proxy -> guest proxy) instead of trying to map the host shmem > into the guest? Not sure if that would be much simpler than creating a ivshmem+hostmem combo that wraps the incoming shmem FD and then having virtio-gpu create a BO that imports it. Regards, Tomeu