From 3af0ee04a584c2e38eff6fa3d37ed56eb85de957 Mon Sep 17 00:00:00 2001 From: Mohamed Ahmed Date: Sat, 11 Oct 2025 21:48:23 +0300 Subject: [PATCH] nouveau/winsys: Store the nouveau kernel version This is so we can enable features needing kernel support based on whether the detected kernel driver supports them or not by checking for the version in nvkmd. Reviewed-by: Mel Henning Part-of: --- src/nouveau/winsys/nouveau_device.c | 2 ++ src/nouveau/winsys/nouveau_device.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/nouveau/winsys/nouveau_device.c b/src/nouveau/winsys/nouveau_device.c index 3342ee8e11e..8cc4df61cca 100644 --- a/src/nouveau/winsys/nouveau_device.c +++ b/src/nouveau/winsys/nouveau_device.c @@ -441,6 +441,8 @@ nouveau_ws_device_new(drmDevicePtr drm_device) if (version < 0x01000301) goto out_err; + device->nouveau_version = version; + const uint64_t KERN = NOUVEAU_WS_DEVICE_KERNEL_RESERVATION_START; const uint64_t TOP = 1ull << 40; struct drm_nouveau_vm_init vminit = { KERN, TOP-KERN }; diff --git a/src/nouveau/winsys/nouveau_device.h b/src/nouveau/winsys/nouveau_device.h index e986b2cfab6..0853bb3e399 100644 --- a/src/nouveau/winsys/nouveau_device.h +++ b/src/nouveau/winsys/nouveau_device.h @@ -27,6 +27,8 @@ struct nouveau_ws_device { struct hash_table *bos; bool has_vm_bind; + + uint32_t nouveau_version; }; struct nouveau_ws_device *nouveau_ws_device_new(struct _drmDevice *drm_device);