Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5485516yba; Wed, 10 Apr 2019 22:04:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyj/ZNOXp7Z1vZRkrle7btRxW1KpqgLfyXw9Y1fGknHwkBHpn6EePlIW+oX4dolkBiSz9Vr X-Received: by 2002:a17:902:121:: with SMTP id 30mr13361553plb.174.1554959057999; Wed, 10 Apr 2019 22:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554959057; cv=none; d=google.com; s=arc-20160816; b=xrGpedg1SWVC0YRVHepkqG7dcdQP/ljx0+21xJNR1hAG2sklJkQR0X9Y70/tvbwjcA XUGxLCsnPC9GJ7jN5quxThcGIMaLDB5XQWwochtBlXLSkkMQDPEK4C8pQ7XNVSHBCk1s zpOtjFzdX6/OjcAUeKrRzSlHwMuim6T1pzJBNf46jkNlF+Wwmc9UDZ52ZOP0lT5W/BIn ZF17ZGCabmBbfCi7QjeJPONK/svASRS3PGjzjCaNRdBH7q90iMpxTD+/1tdO5UZFC00g KJ0yYIjOiA8vT/oIaXok3it0ToJLTABHXjlOSxzs+/jdyPAg2ZEEbXNU3O2fBQTPzFzQ qeXw== 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; bh=HgScTTwFORlYjDVOi9SMQVBrjlHsJJkoufTShq6yD94=; b=uD0KQQ2pyEkITJRj76Js4UE0l3/pG7Y4SwblxbNLJ4Eec0IXJwHT4vrY6Z7w1Y7wI9 hh7pfFUw/b6oqEF+9ySsZ0iVzptPwu6hSEPC+Y08LhqvKiU4Z7a9WpqiDTO7gRKhKxgV Ml5MxOHL89VzqT0wgC0g3Ia2g8MASpgxaeYnM2WmLRTtI5FHdUxhDvUBPafZUnOJ3Mbg hsi2lsmE6BivGSnJJ3CFn5LSAeVDHVziCJUYtPfBkh2vs+RYjZhCmxBHXcbiB8lzI8si ACp4B7zHcgvVHc/XSPTmrvjA1+ricXxtJW0Jnt3/YslONergMlsmTR1FQe3/iWQIVsTy EMBg== 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 t26si7428880pgu.327.2019.04.10.22.04.02; Wed, 10 Apr 2019 22:04: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 S1726672AbfDKFD0 (ORCPT + 99 others); Thu, 11 Apr 2019 01:03:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52972 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfDKFD0 (ORCPT ); Thu, 11 Apr 2019 01:03:26 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FE6E307B481; Thu, 11 Apr 2019 05:03:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-65.ams2.redhat.com [10.36.116.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 900FF5D9C4; Thu, 11 Apr 2019 05:03:23 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BB40E16E08; Thu, 11 Apr 2019 07:03:22 +0200 (CEST) Date: Thu, 11 Apr 2019 07:03:22 +0200 From: Gerd Hoffmann To: Gurchetan Singh Cc: ML dri-devel , virtio@lists.oasis-open.org, David Airlie , "Michael S. Tsirkin" , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Tomeu Vizoso , Jason Wang , David Airlie , "open list:VIRTIO CORE, NET AND BLOCK DRIVERS" , open list Subject: Re: [PATCH 3/3] virtio-gpu api: VIRTIO_GPU_F_RESSOURCE_V2 Message-ID: <20190411050322.mfxo5mrwwzajlz3h@sirius.home.kraxel.org> References: <20190410114227.25846-1-kraxel@redhat.com> <20190410114227.25846-4-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 11 Apr 2019 05:03:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +/* VIRTIO_GPU_CMD_RESOURCE_CREATE_V2 */ > > +struct virtio_gpu_cmd_resource_create_v2 { > > + struct virtio_gpu_ctrl_hdr hdr; > > + __le32 resource_id; > > + __le32 format; > > + __le32 width; > > + __le32 height; > > + /* 3d only */ > > + __le32 target; > > + __le32 bind; > > + __le32 depth; > > + __le32 array_size; > > + __le32 last_level; > > + __le32 nr_samples; > > + __le32 flags; > > +}; > > > I assume this is always backed by some host side allocation, without any > guest side pages associated with it? No. It is not backed at all yet. Workflow would be like this: (1) VIRTIO_GPU_CMD_RESOURCE_CREATE_V2 (2) VIRTIO_GPU_CMD_MEMORY_CREATE (see patch 2) (3) VIRTIO_GPU_CMD_RESOURCE_MEMORY_ATTACH (see patch 2) You could also create a larger pool with VIRTIO_GPU_CMD_MEMORY_CREATE, then go attach multiple resources to it. > If so, do we want the option for the guest allocate? Allocation options are handled by VIRTIO_GPU_CMD_MEMORY_CREATE (initially guest allocated only, i.e. what virtio-gpu supports today, the plan is to add other allocation types later on). > > +/* VIRTIO_GPU_RESP_OK_RESOURCE_INFO */ > > +struct virtio_gpu_resp_resource_info { > > + struct virtio_gpu_ctrl_hdr hdr; > > + __le32 stride[4]; > > + __le32 size[4]; > > +}; > > offsets[4] needed too That is in VIRTIO_GPU_CMD_RESOURCE_MEMORY_ATTACH ... cheers, Gerd