<div dir="ltr">Control: tags -1 + patch<br><br>Hi,<br><br>Attached is a patch against nvidia-graphics-drivers 550.163.01-5.1 that makes<br>nvidia-kernel-dkms build and work on Linux 7.2.6+deb14-amd64. It addresses the<br>two issues Jonas described in his follow-up to this bug.<br><br>1. strncpy() removed in Linux 7.2<br><br>   - nvidia/os-interface.c and nvidia-uvm/uvm_pmm_gpu.c: switched to strscpy(),<br>     same as NVIDIA's upstream fix (open-gpu-kernel-modules PR #1227, shipped<br>     in 610.57.04).<br>   - nvidia/linux_nvswitch.c (registry key parsing): switched to memcpy(), also<br>     as upstream does. The following line already NUL-terminates.<br>   - nvkms_strncpy() and nvswitch_os_strncpy(): these are called from the<br>     closed-source binary objects, so, following the concern raised in this<br>     bug, I kept their names and exact strncpy() semantics (copy, then<br>     zero-pad the rest of the buffer), implemented locally instead of changing<br>     them to strscpy().<br><br>2. struct drm_atomic_state renamed to struct drm_atomic_commit<br>   (commit 5164f7e7ff8e)<br><br>   - New conftest drm_atomic_commit_present (types), registered in<br>     <a href="http://nvidia-drm-sources.mk">nvidia-drm-sources.mk</a>. It uses sizeof(struct drm_atomic_commit), so it<br>     cannot give a false positive on older kernels.<br>   - When it is defined, nvidia-drm-conftest.h maps the old names to the new<br>     API (drm_atomic_state_alloc/clear/get/put/init/default_clear/<br>     default_release -> drm_atomic_commit_*). I checked these names against<br>     the 7.2.6 headers.<br>   - Several existing conftests probe using the old struct name and silently<br>     report false negatives on 7.2. That made the driver pick the pre-4.10<br>     code paths (drm_atomic_state_free, and the old signatures of the crtc and<br>     plane atomic_check callbacks). When NV_DRM_ATOMIC_COMMIT_PRESENT is set,<br>     the patch forces ATOMIC_STATE_REF_COUNTING_PRESENT,<br>     CRTC/PLANE_ATOMIC_CHECK_HAS_ATOMIC_STATE_ARG and the two<br>     ATOMIC_HELPER_SWAP_STATE conftests.<br><br>   Everything new is guarded by NV_DRM_ATOMIC_COMMIT_PRESENT, so builds on<br>   older kernels are unchanged.<br><br>Testing:<br><br>- Built with DKMS against 7.2.6+deb14-amd64 and 7.1.13+deb14-amd64. Both<br>  succeed with no errors and no implicit-declaration or modpost warnings.<br>  On 7.1.13 the new conftest correctly reports #undef.<br>- Hardware: HP laptop with GeForce RTX 2050 (GA107, 10de:25ad) plus Radeon<br>  680M, KDE Plasma on Wayland, forky.<br>- Booted 7.2.6: nvidia, nvidia_modeset, nvidia_drm and nvidia_uvm load,<br>  nvidia-smi reports the GPU with driver 550.163.01, and the desktop works.<br><br>This is a local fix and I have only tested it on one machine, so please review<br>it before using it. I hope it helps get a 7.2-compatible upload out.<br><br>Thanks,<br>Kevin Cuevas</div>