Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5446839ybf; Thu, 5 Mar 2020 00:51:58 -0800 (PST) X-Google-Smtp-Source: ADFU+vuBHAC0q7aqnZPptwTj39d5/XS5FNWA/gqRAoHan+aurRqSpSSFBveblzBu7r5OQrgoL1hN X-Received: by 2002:a05:6830:18ce:: with SMTP id v14mr2731941ote.4.1583398318043; Thu, 05 Mar 2020 00:51:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583398318; cv=none; d=google.com; s=arc-20160816; b=aodPDi6OaynxQ2S5wCaahNLXCpO9xx6Zx2VHcYbB2dJrlWxiMeJamlQJawth0VkpfL ki9FLjFJ/vYPPMm3ES0ObEyBdlVm8r3dm3Q0lph/Nz8BChVHibslrBLj+EaVldgX2y/3 7sMX/XRpcihOZPQrSZTnij1vTbYSGC49hyMQmI84GMbxfHYPAwYQMWekiSELSmojDs6Y Yhhlzpgk6YBuDncmt0gWGp5SDVlSwS8K6MlO0BV5ksK9DhY3q18IINFkuap1QaCibvgr 7m53pQk4alvpfdc7+niu26RktNR4UhRNDykiVmtKLOahSl6/pjiXaVA9fA+YcNw+2Oae xOIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=El/sfTpddW1bZLTnEnZCZcYJORrAN8Tq9vEVAml0EDE=; b=DZg35WtW5b4bm6S0oNbhUsmaq0586IurPidIC5kLVmQ7Is6mT43fk1KIxmqhc9d0Ac kE7OjOgK9xkU1B6btagA9M1YaAsUCkkmeR9TcD0soGgMGHYZC8W13N1vojOhbGh/DZK1 DvvRdrqEvrYRUqEK9wR4hXczaZOrc86B4Umx2jDIghllN63uCKYKfJwULce07o79fVdd EyV2buqFHuGxhPnRN7q31btZ6Ck6nEhM6vlj68Sr4bCHjML1gNQtyVhyhM+a9GJ4sjCO l/mESx4KzQFVM4SXuPWaShu2E+emd8tM4Hn3RmbmPEd78P7kwoo3qgRLrm60aeitW0eW 0yog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Vx/5vkxd"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23si3185784otg.70.2020.03.05.00.51.46; Thu, 05 Mar 2020 00:51:58 -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=pass header.i=@chromium.org header.s=google header.b="Vx/5vkxd"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbgCEIvE (ORCPT + 99 others); Thu, 5 Mar 2020 03:51:04 -0500 Received: from mail-qv1-f68.google.com ([209.85.219.68]:36159 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbgCEIvE (ORCPT ); Thu, 5 Mar 2020 03:51:04 -0500 Received: by mail-qv1-f68.google.com with SMTP id r15so2083384qve.3 for ; Thu, 05 Mar 2020 00:51:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=El/sfTpddW1bZLTnEnZCZcYJORrAN8Tq9vEVAml0EDE=; b=Vx/5vkxdn/hKg0Q8e8NxBkcGhDJsI7LG99cvLlcR/CVLIZ3nLfz++O1Kmbsg/jzf9L zKzg6AUYXpm1eBFv9Q/0M27de2rBPlAOqTARP+BlnJoakmL7bC0yE+sPNk6GGceazIs7 OFDwJ48nJmQd4RvveTIeupNBOekk28UEEb3QA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=El/sfTpddW1bZLTnEnZCZcYJORrAN8Tq9vEVAml0EDE=; b=Z3pduk0BkkZUCamcq6yR8j7cQ7Yv1K6cMYqvvyYjo4yADpzSCLPEnys8h6sYM4wPuw hwytwI/LzV+Szc30yy3rpgaINIvSG0FeKGhDOAalNIZXlhA2RSU1e1X8HpQti9QnxiLv Jn3v8L2JIWAJPmOFpT528n9RiSolxtdw9dfY2w5pfxVTOH4YXVb+noWwFpFXfRph6DLD clXMrjEWFol6ep0rFBbQiUUhdXKwC5jYciGfT3VSmpn+rkFojAAGW/tjiB3Fax12Xkz/ 3mhzlx8srA3kuRav8gSLAgDDErRDhEpr5wA50OAe9DdIcM2Yz07j8O7rwUmzadCQBkoR DnjQ== X-Gm-Message-State: ANhLgQ1yoJKiJtrFiTZ8CZtFsi0iRMO/0Oc1NYSxvLXxZSaicqvPwo+8 kJjby+jOYBNT0LwiuCKuVwmugmoujtkUjgiAuTmA+A== X-Received: by 2002:a05:6214:10c1:: with SMTP id r1mr5594398qvs.70.1583398262104; Thu, 05 Mar 2020 00:51:02 -0800 (PST) MIME-Version: 1.0 References: <20200302121524.7543-1-stevensd@chromium.org> <20200302121524.7543-5-stevensd@chromium.org> <20200304080119.i55opxkhk4kdt4hp@sirius.home.kraxel.org> In-Reply-To: <20200304080119.i55opxkhk4kdt4hp@sirius.home.kraxel.org> From: David Stevens Date: Thu, 5 Mar 2020 17:50:51 +0900 Message-ID: Subject: Re: [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources To: Gerd Hoffmann Cc: David Airlie , Daniel Vetter , "Michael S . Tsirkin" , Jason Wang , Sumit Semwal , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , open list , ML dri-devel , "open list:VIRTIO GPU DRIVER" , Linux Media Mailing List , linaro-mm-sig@lists.linaro.org, virtio-dev@lists.oasis-open.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 4, 2020 at 5:01 PM Gerd Hoffmann wrote: > > Hi, > > > + if (vgdev->has_resource_assign_uuid) { > > + spin_lock(&vgdev->resource_export_lock); > > + if (bo->uuid_state == UUID_NOT_INITIALIZED) { > > + bo->uuid_state = UUID_INITIALIZING; > > + needs_init = true; > > + } > > + spin_unlock(&vgdev->resource_export_lock); > > + > > + if (needs_init) { > > + ret = virtio_gpu_cmd_resource_assign_uuid(vgdev, bo); > > You can submit a fenced command, then wait on the fence here. Removes > the need for UUID_INITIALIZING. Synchronously waiting is simper, but only doing the wait when trying to use the UUID can help to hide the latency of the virito commands. That can save quite a bit of time when setting up multiple buffers for a graphics pipeline, which I think is worthwhile. -David