virtio: Remove virglrenderer_hw.h entirely

Capset definitions replaced by those in virtgpu_drm.h

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34300>
This commit is contained in:
Aaron Ruby 2025-04-01 14:46:27 -04:00 committed by Marge Bot
parent b1ca6a0b43
commit 8513bcbd2f
11 changed files with 21 additions and 71 deletions

View file

@ -21,7 +21,6 @@
#include "unstable_asahi_drm.h"
#include "vdrm.h"
#include "virglrenderer_hw.h"
#include "asahi_proto.h"

View file

@ -12,7 +12,6 @@
#include "unstable_asahi_drm.h"
#include "vdrm.h"
#include "virglrenderer_hw.h"
#include "asahi_proto.h"

View file

@ -20,10 +20,8 @@
/* We also use some types/defines from the host drm/msm uabi: */
#include "drm-uapi/msm_drm.h"
#include "virglrenderer_hw.h"
#include "msm_proto.h"
#include "vdrm.h"
#include "msm_proto.h"
struct virtio_device {
struct fd_device base;

View file

@ -30,10 +30,8 @@
#include "tu_knl_drm.h"
#include "tu_queue.h"
#include "virglrenderer_hw.h"
#include "msm_proto.h"
#include "vdrm.h"
#include "msm_proto.h"
struct tu_userspace_fence_cmd {
uint32_t pkt[4]; /* first 4 dwords of packet */

View file

@ -50,7 +50,6 @@
#include "util/xmlconfig.h"
#include "virtio/virtio-gpu/drm_hw.h"
#include "virtio/virtio-gpu/virglrenderer_hw.h"
#include "drm-uapi/virtgpu_drm.h"
#define DRM_RENDER_NODE_DEV_NAME_FORMAT "%s/renderD%d"
@ -129,7 +128,7 @@ static int
get_nctx_caps(int fd, struct virgl_renderer_capset_drm *caps)
{
struct drm_virtgpu_get_caps args = {
.cap_set_id = VIRGL_RENDERER_CAPSET_DRM,
.cap_set_id = VIRTGPU_DRM_CAPSET_DRM,
.cap_set_ver = 0,
.addr = (uintptr_t)caps,
.size = sizeof(*caps),

View file

@ -49,10 +49,6 @@
#include "virgl_drm_winsys.h"
#include "virgl_drm_public.h"
// Delete local definitions when virglrenderer_hw.h becomes public
#define VIRGL_DRM_CAPSET_VIRGL 1
#define VIRGL_DRM_CAPSET_VIRGL2 2
#define VIRGL_DRM_VERSION(major, minor) ((major) << 16 | (minor))
#define VIRGL_DRM_VERSION_FENCE_FD VIRGL_DRM_VERSION(0, 1)
@ -1169,10 +1165,10 @@ static int virgl_init_context(int drmFD)
uint64_t supports_capset_virgl, supports_capset_virgl2;
supports_capset_virgl = supports_capset_virgl2 = 0;
supports_capset_virgl = ((1 << VIRGL_DRM_CAPSET_VIRGL) &
supports_capset_virgl = ((1 << VIRTGPU_DRM_CAPSET_VIRGL) &
params[param_supported_capset_ids].value);
supports_capset_virgl2 = ((1 << VIRGL_DRM_CAPSET_VIRGL2) &
supports_capset_virgl2 = ((1 << VIRTGPU_DRM_CAPSET_VIRGL2) &
params[param_supported_capset_ids].value);
if (!supports_capset_virgl && !supports_capset_virgl2) {
@ -1182,8 +1178,8 @@ static int virgl_init_context(int drmFD)
ctx_set_param.param = VIRTGPU_CONTEXT_PARAM_CAPSET_ID;
ctx_set_param.value = (supports_capset_virgl2) ?
VIRGL_DRM_CAPSET_VIRGL2 :
VIRGL_DRM_CAPSET_VIRGL;
VIRTGPU_DRM_CAPSET_VIRGL :
VIRTGPU_DRM_CAPSET_VIRGL2;
init.ctx_set_params = (unsigned long)(void *)&ctx_set_param;
init.num_params = 1;

View file

@ -16,7 +16,7 @@
#include "util/simple_mtx.h"
#include "virglrenderer_hw.h"
#include "virtio/virtio-gpu/drm_hw.h"
#ifdef __cplusplus
extern "C" {

View file

@ -290,7 +290,7 @@ static int
get_capset(int fd, struct virgl_renderer_capset_drm *caps)
{
struct drm_virtgpu_get_caps args = {
.cap_set_id = VIRGL_RENDERER_CAPSET_DRM,
.cap_set_id = VIRTGPU_DRM_CAPSET_DRM,
.cap_set_ver = 0,
.addr = (uintptr_t)caps,
.size = sizeof(*caps),
@ -305,7 +305,7 @@ static int
set_context(int fd)
{
struct drm_virtgpu_context_set_param params[] = {
{ VIRTGPU_CONTEXT_PARAM_CAPSET_ID, VIRGL_RENDERER_CAPSET_DRM },
{ VIRTGPU_CONTEXT_PARAM_CAPSET_ID, VIRTGPU_DRM_CAPSET_DRM },
{ VIRTGPU_CONTEXT_PARAM_NUM_RINGS, 64 },
};
struct drm_virtgpu_context_init args = {

View file

@ -1,40 +0,0 @@
/*
* Copyright 2020 Chromium
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef VIRGLRENDERER_HW_H
#define VIRGLRENDERER_HW_H
#include "venus_hw.h"
#include "virgl_hw.h"
#include "drm_hw.h"
enum virgl_renderer_capset {
VIRGL_RENDERER_CAPSET_VIRGL = 1,
VIRGL_RENDERER_CAPSET_VIRGL2 = 2,
/* 3 is reserved for gfxstream */
VIRGL_RENDERER_CAPSET_VENUS = 4,
/* 5 is reserved for cross-domain */
VIRGL_RENDERER_CAPSET_DRM = 6,
};
#endif /* VIRGLRENDERER_HW_H */

View file

@ -22,9 +22,9 @@
#include "drm-uapi/virtgpu_drm.h"
#include "util/os_file.h"
#include "util/sparse_array.h"
#include "virtio-gpu/virglrenderer_hw.h"
#include "vn_renderer_internal.h"
#include "virtio/virtio-gpu/venus_hw.h"
#ifndef VIRTGPU_PARAM_GUEST_VRAM
/* All guest allocations happen via virtgpu dedicated heap. */
@ -96,7 +96,7 @@ struct virtgpu {
uint32_t max_timeline_count;
struct {
enum virgl_renderer_capset id;
uint32_t id;
uint32_t version;
struct virgl_renderer_capset_venus data;
} capset;
@ -581,7 +581,7 @@ virtgpu_ioctl_getparam(struct virtgpu *gpu, uint64_t param)
static int
virtgpu_ioctl_get_caps(struct virtgpu *gpu,
enum virgl_renderer_capset id,
uint32_t id,
uint32_t version,
void *capset,
size_t capset_size)
@ -598,7 +598,7 @@ virtgpu_ioctl_get_caps(struct virtgpu *gpu,
static int
virtgpu_ioctl_context_init(struct virtgpu *gpu,
enum virgl_renderer_capset capset_id)
uint32_t capset_id)
{
struct drm_virtgpu_context_set_param ctx_set_params[3] = {
{
@ -1476,7 +1476,7 @@ virtgpu_init_context(struct virtgpu *gpu)
static VkResult
virtgpu_init_capset(struct virtgpu *gpu)
{
gpu->capset.id = VIRGL_RENDERER_CAPSET_VENUS;
gpu->capset.id = VIRTGPU_DRM_CAPSET_VENUS;
gpu->capset.version = 0;
const int ret =

View file

@ -19,10 +19,11 @@
#include "util/os_misc.h"
#include "util/sparse_array.h"
#include "util/u_process.h"
#include "virtio-gpu/virglrenderer_hw.h"
#include "drm-uapi/virtgpu_drm.h"
#include "vtest/vtest_protocol.h"
#include "vn_renderer_internal.h"
#include "virtio/virtio-gpu/venus_hw.h"
#define VTEST_PCI_VENDOR_ID 0x1af4
#define VTEST_PCI_DEVICE_ID 0x1050
@ -57,7 +58,7 @@ struct vtest {
uint32_t max_timeline_count;
struct {
enum virgl_renderer_capset id;
uint32_t id;
uint32_t version;
struct virgl_renderer_capset_venus data;
} capset;
@ -255,7 +256,7 @@ vtest_vcmd_get_param(struct vtest *vtest, enum vcmd_param param)
static bool
vtest_vcmd_get_capset(struct vtest *vtest,
enum virgl_renderer_capset id,
uint32_t id,
uint32_t version,
void *capset,
size_t capset_size)
@ -299,7 +300,7 @@ vtest_vcmd_get_capset(struct vtest *vtest,
static void
vtest_vcmd_context_init(struct vtest *vtest,
enum virgl_renderer_capset capset_id)
uint32_t capset_id)
{
uint32_t vtest_hdr[VTEST_HDR_SIZE];
uint32_t vcmd_context_init[VCMD_CONTEXT_INIT_SIZE];
@ -975,7 +976,7 @@ vtest_destroy(struct vn_renderer *renderer,
static VkResult
vtest_init_capset(struct vtest *vtest)
{
vtest->capset.id = VIRGL_RENDERER_CAPSET_VENUS;
vtest->capset.id = VIRTGPU_DRM_CAPSET_VENUS;
vtest->capset.version = 0;
if (!vtest_vcmd_get_capset(vtest, vtest->capset.id, vtest->capset.version,