Skip to content

Commit 14b519d

Browse files
authored
Fix 545.29 driver version check.
Also moved the comment re. that check into the branch.
1 parent 0ef97c1 commit 14b519d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/direct/nv-driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ static bool nv0_register_fd(const int nv0_fd, int nvctl_fd) {
237237
}
238238

239239
static bool get_device_info(const int fd, NVDriverContext *context) {
240-
//NVIDIA driver v545.29.02 changed the devInfo struct, and partly broke it in the process
241-
//...who adds a field to the middle of an existing struct....
242240
if (context->driverMajorVersion >= 575) {
243241
struct drm_nvidia_get_dev_info_params_575 devInfo575;
244242
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) {
252250
context->sector_layout = devInfo575.sector_layout;
253251
context->page_kind_generation = devInfo575.page_kind_generation;
254252
context->generic_page_kind = devInfo575.generic_page_kind;
255-
} else if (context->driverMajorVersion >= 545 && context->driverMinorVersion >= 29) {
253+
} else if (context->driverMajorVersion > 545 || (context->driverMajorVersion == 545 && context->driverMinorVersion >= 29)) {
254+
//NVIDIA driver v545.29.02 changed the devInfo struct, and partly broke it in the process
255+
//...who adds a field to the middle of an existing struct....
256256
struct drm_nvidia_get_dev_info_params_545 devInfo545;
257257
const int ret = ioctl(fd, DRM_IOCTL_NVIDIA_GET_DEV_INFO_545, &devInfo545);
258258

0 commit comments

Comments
 (0)