From 14b519df56fe2655248c54d1553bced51ac154a9 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 19 Apr 2025 19:01:53 +0300 Subject: [PATCH] Fix 545.29 driver version check. Also moved the comment re. that check into the branch. --- src/direct/nv-driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/direct/nv-driver.c b/src/direct/nv-driver.c index 360327d..fcf5ea4 100644 --- a/src/direct/nv-driver.c +++ b/src/direct/nv-driver.c @@ -237,8 +237,6 @@ static bool nv0_register_fd(const int nv0_fd, int nvctl_fd) { } static bool get_device_info(const int fd, NVDriverContext *context) { - //NVIDIA driver v545.29.02 changed the devInfo struct, and partly broke it in the process - //...who adds a field to the middle of an existing struct.... if (context->driverMajorVersion >= 575) { struct drm_nvidia_get_dev_info_params_575 devInfo575; const int ret = ioctl(fd, DRM_IOCTL_NVIDIA_GET_DEV_INFO_575, &devInfo575); @@ -252,7 +250,9 @@ static bool get_device_info(const int fd, NVDriverContext *context) { context->sector_layout = devInfo575.sector_layout; context->page_kind_generation = devInfo575.page_kind_generation; context->generic_page_kind = devInfo575.generic_page_kind; - } else if (context->driverMajorVersion >= 545 && context->driverMinorVersion >= 29) { + } else if (context->driverMajorVersion > 545 || (context->driverMajorVersion == 545 && context->driverMinorVersion >= 29)) { + //NVIDIA driver v545.29.02 changed the devInfo struct, and partly broke it in the process + //...who adds a field to the middle of an existing struct.... struct drm_nvidia_get_dev_info_params_545 devInfo545; const int ret = ioctl(fd, DRM_IOCTL_NVIDIA_GET_DEV_INFO_545, &devInfo545);