Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9669234rwr; Thu, 11 May 2023 19:40:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6OW5jFvbU7Wo8YZZvQbpA+TODYpVZORbx359fEtTFoD+Im0e39Iq80dVmp2d13zx6Ti79e X-Received: by 2002:a17:902:b696:b0:1aa:f203:781c with SMTP id c22-20020a170902b69600b001aaf203781cmr20047508pls.44.1683859242541; Thu, 11 May 2023 19:40:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683859242; cv=none; d=google.com; s=arc-20160816; b=oaC5sgvasREaUb/rbElNTdPlL8lsJMqQ0FkJ+eUvG+03unyCKC3g3frL1Q0MAriz88 ynSr1J5QXui4CyI5R3OgPFk2mzASDYJ/qatWjCiDHxMcy7Y4K17vjm9xbteytEi0q7C6 qjGRmfsYfPO2ojwRQqHHe3YfLmjbiDBiAc0z9ZRvdxfbICbWc29NV9KnAod5FE7tZ0WM 8SASRrhyiySJiG8vbWdw8Er3KHjqJqjVsrfnRO5xVV5Efq+x0iwuGgO55IS1JMpSuL5x g8q282ToMT3/zn+I6aLsff936wckxisFWVZxYnguYgJyD1AalbnH8n67ewCl304w7HaF +IRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=RnXTcpzIJHGtjPkEu18RisFWtmYMle6ENGKonJTzhEk=; b=iYNRJ+6HbzG0WMZyC8RmUfuNFlrWYviQj2EUxMvhfvjWGaYq1Os3Zn8wmndJ1AYIZA 7/KbuhDq6mXtzYuYGDlTeevCG6SxFajeZe+9XSxpNMonSZJrqh2te98cR7amxaOYlFLX xYK5ooK0dS5SnLJ6HVyXkdjSdEivqUmRAm1rHvrb2soK+Jsc/Q09zGd3usjqOHUEeTgB FUXeZVrDvoPxGnVniu70k9EEBGKcyBFLKQyrJgwvAYLxb8IsqHUp8SUKm+Abu7ef7x4r z6Sd9frb9O2KiLwIEcJs4LGmybv1Gze0S55k8Mk1kSS8Pl4Mcr1tcfJ69PxgDjz0D7Sc lmvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="BCb3xAg/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a170902b28b00b001a69d1be166si8021179plr.450.2023.05.11.19.40.27; Thu, 11 May 2023 19:40:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="BCb3xAg/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239625AbjELCdc (ORCPT + 99 others); Thu, 11 May 2023 22:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239158AbjELCda (ORCPT ); Thu, 11 May 2023 22:33:30 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EE2055A2 for ; Thu, 11 May 2023 19:33:28 -0700 (PDT) Received: from [192.168.2.193] (109-252-144-198.dynamic.spd-mgts.ru [109.252.144.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 80068660574C; Fri, 12 May 2023 03:33:25 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1683858806; bh=QPRjKnSsSd+hW6g+3RQUwtjoMbBDMKZF34astvPh9W8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BCb3xAg/AC2JGzZowjaB8rdbHD1gvPnoZpy+TVxWrHxezto2SsU8a/T0/jPQekpcT tLfa/Jk99tBSsvmpommhiZrv7yZxr/AzDzAq3PyT8xTuloGE/UTu8WOmQOZ8uZjbqK kx7zZhCEQZ68RqPp1aUE+QPaw8XUEgc/lztu8MSxl1HJqt3HpIFxQ04Oq0ZFluyKIz EyN3vDEjqoh5smFKleMPtHoF8X4SPU/R2mQhN+p6aTsR4O3tMrzOBg6xYa+24EcKIo idi/Mf8I4K3wmUZgz5XOH0P0uau3T7IatG1CJJYZehswRULTIfCb15EpPvEIjMFXph ymQ0I0WFXUA+A== Message-ID: Date: Fri, 12 May 2023 05:33:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver To: Gurchetan Singh , Rob Clark Cc: Gerd Hoffmann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com, virtualization@lists.linux-foundation.org, David Airlie , Chia-I Wu , Daniel Vetter , =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= , Pierre-Eric Pelloux-Prayer , Emil Velikov References: <20230416115237.798604-1-dmitry.osipenko@collabora.com> <141b928d-6165-f282-b8e6-f140cb09333d@collabora.com> Content-Language: en-US From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/12/23 03:17, Gurchetan Singh wrote: ... > Can we get one of the Mesa MRs reviewed first? There's currently no > virtio-intel MR AFAICT, and the amdgpu one is marked as "Draft:". > > Even for the amdgpu, Pierre suggests the feature "will be marked as > experimental both in Mesa and virglrenderer" and we can revise as needed. > The DRM requirements seem to warn against adding an UAPI too hastily... > > You can get the deqp-vk 1.2 tests to pass with the current UAPI, if you > just change your mesa <--> virglrenderer protocol a little. Perhaps that > way is even better, since you plumb the in sync-obj into host-side command > submission. > > Without inter-context sharing of the fence, this MR really only adds guest > kernel syntactic sugar. > > Note I'm not against syntactic sugar, but I just want to point out that you > can likely merge the native context work without any UAPI changes, in case > it's not clear. > > If this was for the core drm syncobj implementation, and not just >> driver ioctl parsing and wiring up the core helpers, I would agree >> with you. >> > > There are several possible and viable paths to get the features in question > (VK1.2 syncobjs, and inter-context fence sharing). There are paths > entirely without the syncobj, paths that only use the syncobj for the > inter-context fence sharing case and create host syncobjs for VK1.2, paths > that also use guest syncobjs in every proxied command submission. > > It's really hard to tell which one is better. Here's my suggestion: > > 1) Get the native contexts reviewed/merged in Mesa/virglrenderer using the > current UAPI. Options for VK1.2 include: pushing down the syncobjs to the > host, and simulating the syncobj (as already done). It's fine to mark > these contexts as "experimental" like msm-experimental. That will allow > you to experiment with the protocols, come up with tests, and hopefully > determine an answer to the host versus guest syncobj question. > > 2) Once you've completed (1), try to add UAPI changes for features that are > missing or things that are suboptimal with the knowledge gained from doing > (2). > > WDYT? Having syncobj support available by DRM driver is a mandatory requirement for native contexts because userspace (Mesa) relies on sync objects support presence. In particular, Intel Mesa driver checks whether DRM driver supports sync objects to decide which features are available, ANV depends on the syncobj support. I'm not familiar with a history of Venus and its limitations. Perhaps the reason it's using host-side syncobjs is to have 1:1 Vulkan API mapping between guest and host. Not sure if Venus could use guest syncobjs instead or there are problems with that. When syncobj was initially added to kernel, it was done from the needs of supporting Vulkan wait API. For Venus the actual Vulkan driver is on host side, while for native contexts it's on guest side. Native contexts don't need syncobj on host side, it will be unnecessary overhead for every nctx to have it on host. Hence, if there is no good reason for host-side syncobjs, then why do that? Native contexts pass deqp synchronization tests, they use sync objects universally for both GL and VK. Games work, piglit/deqp passing. What else you're wanting to test? Turnip? The AMDGPU code has been looked and it looks good. It's a draft for now because of the missing sync objects UAPI and other virglrender/Qemu changes required to get KMS working. Maybe it will be acceptable to merge the Mesa part once kernel will get sync objects supported, will need to revisit it. I'm not opening MR for virtio-intel because it has open questions that need to be resolved first. -- Best regards, Dmitry