From nobody Thu Nov 28 15:44:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=chromium.org ARC-Seal: i=1; a=rsa-sha256; t=1691547119; cv=none; d=zohomail.com; s=zohoarc; b=lpcmy2FrMYEh9latadOFtm1154lbbbTHy/PfQuti90MBU08iaWG3JtA3nQqx49b3glXyNBrsQ7AuTWNPBTUJy4VKLpV+OEmhi8tbrFEZYYVvXsFFRWJ9veS+R5vesqzv++H7ErS55fzoQ+zSaqPvDRA1lmRquloGoql/3qIqiFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691547119; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JQ9VfOCKhI/4PoRZII8g8ypIqt32q/bHpgwUwryN+E8=; b=gE4rPNzIyY6AhUS0MWxEZbeCm9j+q7+IvR0AyYv3SDe76F2JA2ys7s8Yhu3upIoSF2mc7fB4izRv935iVZSo52nDvma05ytOfbKFfzfrtqJV17G62Njbll3ZrFT4q1lURBk7m+JmCPUBFHcJEZK30MrT9ZiE/6EWW5OO+xlBc2I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1691547119147317.08725966153384; Tue, 8 Aug 2023 19:11:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qTYfS-00076H-Tq; Tue, 08 Aug 2023 22:11:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTYfQ-000743-HM for qemu-devel@nongnu.org; Tue, 08 Aug 2023 22:11:20 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTYfO-00015v-Ue for qemu-devel@nongnu.org; Tue, 08 Aug 2023 22:11:20 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-565331f0736so140144a12.0 for ; Tue, 08 Aug 2023 19:11:18 -0700 (PDT) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:a7:2:a5a2:f074:e7af:41fe]) by smtp.gmail.com with ESMTPSA id a16-20020aa78650000000b00687494a59bfsm8681887pfo.61.2023.08.08.19.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 19:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691547077; x=1692151877; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JQ9VfOCKhI/4PoRZII8g8ypIqt32q/bHpgwUwryN+E8=; b=b+ETbqapgYtAHFa6wQ91R/skszPk2YmG/9pctVg786qYwp1Xu7XhxuxkMshXcwnqyK +jjFSlz2nrXvfbaSTFZoyU0KLncSfufVqJrQKJfSfJDZ7DIfXGXlOihngCf5CfB77MWy jeWdx7FeFqhkRCWm3kbMPGUPyc66XEMzwm6Sg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691547077; x=1692151877; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JQ9VfOCKhI/4PoRZII8g8ypIqt32q/bHpgwUwryN+E8=; b=N3vezFKjrbh6Aj43WxOqmtcO/0CXlN1b1N/9aEaLZ3folGLJLy6rgMyIePWWsP5zBa 43vFItt9JV+vdnhB8GXLgLLTaVgkLTtLtXoaolItZyQNYW4EI3PKQnzwjUMGkgs3Nrgb dmmtHce39ZipSJL3Purx3Ra7wdey1ffImhUESGfyxEPrKx1mp7nFnjIFycU2Gxavd5Jw Wg7kt85lGj7eE2YIyQYk6fLADOlNsTcRaNtJy1TrOrmGg5uhxZlG2R0YroUnuZsHHKQ+ AsAf5pyQaapRZPvTAQ45yK7mReS+goK4pcrxrvxQKvcXTfnahqbK0mQtRumwmuJltJi6 SPOw== X-Gm-Message-State: AOJu0YxoDIfOALhgnQH5IXYN3LSvcujUPF1XRxrfHlaWP6Tty6snQb76 8cgbqbT5R9LerUoYMmSZj1kWk9bWiGHcWf5k5WooDg== X-Google-Smtp-Source: AGHT+IF9I9/ITTCSb4yRbWRIauk21U5P/1xDTnCyNmRSCxA4p+Re0+mya98pWXy2iK8O1B1GlDFeZQ== X-Received: by 2002:a05:6a21:271c:b0:126:a80d:4960 with SMTP id rm28-20020a056a21271c00b00126a80d4960mr1205898pzb.30.1691547077045; Tue, 08 Aug 2023 19:11:17 -0700 (PDT) From: Gurchetan Singh To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, kraxel@redhat.com, akihiko.odaki@gmail.com, ray.huang@amd.com, alex.bennee@linaro.org, shentey@gmail.com, hi@alyssa.is, ernunes@redhat.com Subject: [PATCH v4 5/9] gfxstream + rutabaga prep: added need defintions, fields, and options Date: Tue, 8 Aug 2023 19:11:04 -0700 Message-Id: <20230809021108.674-6-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20230809021108.674-1-gurchetansingh@chromium.org> References: <20230809021108.674-1-gurchetansingh@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=gurchetansingh@chromium.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @chromium.org) X-ZM-MESSAGEID: 1691547121318100004 Content-Type: text/plain; charset="utf-8" This modifies the common virtio-gpu.h file have the fields and defintions needed by gfxstream/rutabaga, by VirtioGpuRutabaga. The command to run these would be: -device virtio-vga-rutabaga,capset_names=3Dgfxstream-vulkan:cross-domain, \ wayland_socket_path=3D/run/user/1000/wayland-0,hostmem=3D8G \ Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross --- v1: void *rutabaga --> struct rutabaga *rutabaga (Akihiko) have a separate rutabaga device instead of using GL device (Bernard) v2: VirtioGpuRutabaga --> VirtIOGPURutabaga (Akihiko) move MemoryRegionInfo into VirtIOGPURutabaga (Akihiko) remove 'ctx' field (Akihiko) remove 'rutabaga_active' include/hw/virtio/virtio-gpu.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 55973e112f..e2a07e68d9 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -38,6 +38,9 @@ OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUGL, VIRTIO_GPU_GL) #define TYPE_VHOST_USER_GPU "vhost-user-gpu" OBJECT_DECLARE_SIMPLE_TYPE(VhostUserGPU, VHOST_USER_GPU) =20 +#define TYPE_VIRTIO_GPU_RUTABAGA "virtio-gpu-rutabaga-device" +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPURutabaga, VIRTIO_GPU_RUTABAGA) + struct virtio_gpu_simple_resource { uint32_t resource_id; uint32_t width; @@ -94,6 +97,7 @@ enum virtio_gpu_base_conf_flags { VIRTIO_GPU_FLAG_DMABUF_ENABLED, VIRTIO_GPU_FLAG_BLOB_ENABLED, VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED, + VIRTIO_GPU_FLAG_RUTABAGA_ENABLED, }; =20 #define virtio_gpu_virgl_enabled(_cfg) \ @@ -108,6 +112,8 @@ enum virtio_gpu_base_conf_flags { (_cfg.flags & (1 << VIRTIO_GPU_FLAG_BLOB_ENABLED)) #define virtio_gpu_context_init_enabled(_cfg) \ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED)) +#define virtio_gpu_rutabaga_enabled(_cfg) \ + (_cfg.flags & (1 << VIRTIO_GPU_FLAG_RUTABAGA_ENABLED)) #define virtio_gpu_hostmem_enabled(_cfg) \ (_cfg.hostmem > 0) =20 @@ -232,6 +238,28 @@ struct VhostUserGPU { bool backend_blocked; }; =20 +#define MAX_SLOTS 4096 + +struct MemoryRegionInfo { + int used; + MemoryRegion mr; + uint32_t resource_id; +}; + +struct rutabaga; + +struct VirtIOGPURutabaga { + struct VirtIOGPU parent_obj; + + struct MemoryRegionInfo memory_regions[MAX_SLOTS]; + char *capset_names; + char *wayland_socket_path; + char *wsi; + bool headless; + uint32_t num_capsets; + struct rutabaga *rutabaga; +}; + #define VIRTIO_GPU_FILL_CMD(out) do { \ size_t s; \ s =3D iov_to_buf(cmd->elem.out_sg, cmd->elem.out_num, 0, \ --=20 2.41.0.640.ga95def55d0-goog