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);