Skip to content

Add compatibility with linux-next dmem, HMM and DRM APIs - #1414

Open
solomspd wants to merge 6 commits into
NVIDIA:mainfrom
solomspd:fix/linux-next-dmem-hmm-drm
Open

solomspd wants to merge 6 commits into
NVIDIA:mainfrom
solomspd:fix/linux-next-dmem-hmm-drm

Conversation

@solomspd

@solomspd solomspd commented Oct 2, 2026 •

Copy link
Copy Markdown

Building NVIDIA 615.71.09 against linux-next next-20261001 fails after changes to dmem registration, HMM VMA helpers, DRM atomic state creation, and the fbdev helper header location. Add conftests that select the matching interfaces while retaining the existing paths for older kernels.

  • Detect the dmem_cgroup_register_region() initializer argument and initialize the region size through struct dmem_cgroup_init when present.
  • Expand the removed VM_SPECIAL mask to its constituent flags and detect the renamed vma_is_hugetlb() helper.
  • Detect plane and CRTC atomic_create_state independently. Allocate and initialize the NVIDIA state subclasses, return allocation errors, and let DRM core install the returned states. Preserve the existing reset callbacks for older kernels.
  • Detect the relocated drm/clients/drm_fbdev_helper.h and select it in both the driver and all three fbdev setup probes. This also prevents a missing old header from falsely reporting removed setup functions as present.

The six compatibility commits follow independent Linux API changes. The plane and CRTC commit messages also reference the associated initializer renames and later reset removals.

Compatibility change Linux commit
dmem region initializer e11640b9cea4
VM_SPECIAL removal 8cab8abf01e1
hugetlb VMA helper rename 8d9cb659cbf2
Plane atomic state creation 1a185ddecaf9
CRTC atomic state creation 58d426b5ed0d
fbdev helper relocation 6ccc5b5fc1d3

Validation against upstream commit 61dcc93722ecb418bb5f2e00923f05b4b8051dd1 (615.71.09), using GCC 16.2.1:

Kernel headers Module build New API probes
6.18.54-2-lts All five modules pass Absent; legacy paths selected
7.2.8-arch1-2 All five modules pass Absent; legacy paths selected
7.3.0-rc5-next-20261001-1-next-git-13246-g9f24d789f03b All five modules pass Present; new paths selected

Each build used a separate clean source copy. Splitting the history leaves the tested final source tree and aggregate diff unchanged. Module versions/vermagic match their targets. Independent conftest runs agree with the generated build headers: generic and TTM fbdev setup are absent, and client setup is present, on all three targets. git diff --check and shell syntax checks pass. Build logs contain compiler and objtool warnings.

Validation covers compilation and capability detection. No new runtime graphics tests were performed, and kernels older than 6.18.54 were not built during this validation.

@CLAassistant

CLAassistant commented Oct 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Linux replaced the size argument to dmem_cgroup_register_region()
with a dmem_cgroup_init pointer. Detect the signature and initialize
the region size while retaining the original call on older kernels.

Related Linux commits:
  e11640b9cea4 (cgroup/dmem: Introduce struct dmem_cgroup_init for region initialization)
Linux removed VM_SPECIAL and VMA_SPECIAL_FLAGS. Spell out the same
four flags in the HMM migration exclusion check, preserving its
existing behavior on kernels that still define the aggregate mask.

Related Linux commits:
  8cab8abf01e1 (mm: eliminate VM_SPECIAL, VMA_SPECIAL_FLAGS)
Linux renamed is_vm_hugetlb_page() to vma_is_hugetlb(). Use a
declaration conftest to select the new helper without losing the
existing helper on older kernels.

Related Linux commits:
  8d9cb659cbf2 (mm: rename is_vm_hugetlb_page() to vma_is_hugetlb())
Linux introduced plane atomic_create_state and subsequently removed
the reset callback and helper. Detect the new callback, allocate the
NVIDIA plane state, and initialize it with the renamed state helper.
Leave state installation to DRM core and retain the legacy reset path.

Related Linux commits:
  1a185ddecaf9 (drm/plane: Add new atomic_create_state callback)
  3e5656ea5e73 (drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset())
  5589ef09f93b (drm/plane: Remove reset)
  e62864df82f6 (drm/atomic-state-helper: Remove drm_atomic_helper_plane_reset())
Linux introduced CRTC atomic_create_state and subsequently removed
the reset callback and helper. Detect the new callback, allocate the
NVIDIA CRTC state, and initialize it with the renamed state helper.
Leave state installation to DRM core and retain the legacy reset path.

Related Linux commits:
  58d426b5ed0d (drm/crtc: Add new atomic_create_state callback)
  915fdd2c7e87 (drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset())
  f1bcb90506a9 (drm/crtc: Remove reset)
  5354d1e5fba4 (drm/atomic-helper: Remove drm_atomic_helper_crtc_reset)
Linux moved and renamed drm_fb_helper.h to
drm/clients/drm_fbdev_helper.h. Detect the new header and select it
in the driver and all three fbdev setup probes, retaining the old
header on older kernels. This prevents missing-header errors from
being mistaken for presence of removed setup functions.

Related Linux commits:
  6ccc5b5fc1d3 (drm/fbdev: Move fbdev helpers into client library)
@solomspd
solomspd force-pushed the fix/linux-next-dmem-hmm-drm branch from 4393e40 to 3d8e17b Compare October 2, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants