Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23C0ACDB47E for ; Wed, 18 Oct 2023 23:35:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D55A10E077; Wed, 18 Oct 2023 23:35:17 +0000 (UTC) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by gabe.freedesktop.org (Postfix) with ESMTPS id 307E610E077 for ; Wed, 18 Oct 2023 23:35:12 +0000 (UTC) Received: from [192.168.2.39] (109-252-153-31.dynamic.spd-mgts.ru [109.252.153.31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 8A4816606F85; Thu, 19 Oct 2023 00:35:09 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697672110; bh=tzFoOcfO2LLY/7rp0S3zN3AaI/clLpAKH1kAfPrC9K8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hkjJDe0XXwbDR7epaJvYTuRQNY+iUKetwStS3N48Zd9XLyjAmP4tnIzReALet53C7 cnn+esbO+5myarT9pBT1LElGWKK6kG/pQQgfZWj7JzH88zeThFVPqNRvI/4rb6LU8U bYtpHREY5tmH3mYl9XU8CUE+HsmQzvODeaxojE7nyl6qQBUvVX8Ech9UHiosf1QYgU q9VDo6If4FTzIDamXo68GQvZbsUJg7/AkhP5jZDQc+EoWEvKUZwW14EdldgIZQlo3R UjY/M/aZqPLkgFkOzpCqUiWEQo7M7ZKQWH77AuekDioTLHSVJJiyjxhOubJwhguukZ GJAKKZaVzlA4w== Message-ID: Date: Thu, 19 Oct 2023 02:35:07 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3] drm/virtio: add new virtio gpu capset definitions Content-Language: en-US To: Gurchetan Singh , Huang Rui References: <20231010135722.1142265-1-ray.huang@amd.com> <2f8bcce1-6551-6c2d-481c-67502c82bc68@collabora.com> <2c162058-288c-9e9e-48d5-3b2ddb0cc1fa@collabora.com> From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Huang, Honglei1" , Akihiko Odaki , "Stabellini, Stefano" , Daniel Vetter , "Ragiadakou, Xenia" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "virtualization@lists.linux-foundation.org" , "Chen, Jiqian" , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Gerd Hoffmann , "Deucher, Alexander" , David Airlie , "Zhang, Julia" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 10/19/23 02:25, Gurchetan Singh wrote: > On Tue, Oct 10, 2023 at 9:41 PM Huang Rui wrote: > >> On Tue, Oct 10, 2023 at 11:52:14PM +0800, Dmitry Osipenko wrote: >>> On 10/10/23 18:40, Dmitry Osipenko wrote: >>>> On 10/10/23 16:57, Huang Rui wrote: >>>>> These definitions are used fro qemu, and qemu imports this marco in >> the >>>>> headers to enable gfxstream, venus, cross domain, and drm (native >>>>> context) for virtio gpu. So it should add them even kernel doesn't use >>>>> this. >>>>> >>>>> Signed-off-by: Huang Rui >>>>> Reviewed-by: Akihiko Odaki >>>>> --- >>>>> >>>>> Changes V1 -> V2: >>>>> - Add all capsets including gfxstream and venus in kernel header >> (Dmitry Osipenko) >>>>> >>>>> Changes V2 -> V3: >>>>> - Add missed capsets including cross domain and drm (native context) >>>>> (Dmitry Osipenko) >>>>> >>>>> v1: >> https://lore.kernel.org/lkml/20230915105918.3763061-1-ray.huang@amd.com/ >>>>> v2: >> https://lore.kernel.org/lkml/20231010032553.1138036-1-ray.huang@amd.com/ >>>>> >>>>> include/uapi/linux/virtio_gpu.h | 4 ++++ >>>>> 1 file changed, 4 insertions(+) >>>>> >>>>> diff --git a/include/uapi/linux/virtio_gpu.h >> b/include/uapi/linux/virtio_gpu.h >>>>> index f556fde07b76..240911c8da31 100644 >>>>> --- a/include/uapi/linux/virtio_gpu.h >>>>> +++ b/include/uapi/linux/virtio_gpu.h >>>>> @@ -309,6 +309,10 @@ struct virtio_gpu_cmd_submit { >>>>> >>>>> #define VIRTIO_GPU_CAPSET_VIRGL 1 >>>>> #define VIRTIO_GPU_CAPSET_VIRGL2 2 >>>>> +#define VIRTIO_GPU_CAPSET_GFXSTREAM 3 >>>> >>>> The GFXSTREAM capset isn't correct, it should be GFXSTREAM_VULKAN in >>>> accordance to [1] and [2]. There are more capsets for GFXSTREAM. >>>> >>>> [1] >>>> >> https://github.com/google/crosvm/blob/main/rutabaga_gfx/src/rutabaga_utils.rs#L172 >>>> >>>> [2] >>>> >> https://patchwork.kernel.org/project/qemu-devel/patch/20231006010835.444-7-gurchetansingh@chromium.org/ >>> >>> Though, maybe those are "rutabaga" capsets that not related to >>> virtio-gpu because crosvm has another defs for virtio-gpu capsets [3]. >>> The DRM capset is oddly missing in [3] and code uses "rutabaga" capset >>> for DRM and virtio-gpu. >>> >>> [3] >>> >> https://github.com/google/crosvm/blob/main/devices/src/virtio/gpu/protocol.rs#L416 >> >> Yes, [3] is the file that I referred to add these capsets definitions. And >> it's defined as gfxstream not gfxstream_vulkan. >> >>> >>> Gurchetan, could you please clarify which capsets definitions are >>> related to virtio-gpu and gfxstream. The >>> GFXSTREAM_VULKAN/GLES/MAGMA/COMPOSER or just the single GFXSTREAM? > > > It should be GFXSTREAM_VULKAN. The rest are more experimental and easy to > modify in terms of the enum value, should the need arise. > > I imagine the virtio-spec update to reflect the GFXSTREAM to > GFXSTREAM_VULKAN change will happen eventually. Thanks for the clarification. Good point about the spec updating, we should document DRM context too, -- Best regards, Dmitry