Skip to content

Fix 545.29 driver version check #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/direct/nv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down