fix(kernel-open): define DRM_PLANE_NO_SCALING on Linux <6.1 and fix C90 declaration warning in pci_adapter (#560)

Co-authored-by: Eric Hartford <eric@quixi.ai>
This commit is contained in:
Eric Hartford
2026-12-04 16:23:47 -08:00
committed by GitHub
parent 06e61c33fd
commit e86d83cc64
3 changed files with 13 additions and 1 deletions

View File

@ -32,6 +32,7 @@ Where stock NVIDIA `580.178.04` avoids `#if LINUX_VERSION_CODE` guards altogethe
| `MAX_ORDER` → `MAX_PAGE_ORDER` | `#if defined(MAX_PAGE_ORDER)` (**6.8**) | `rmapi_node.c`, `rom_fw_adapter.c` |
| `dma_resv_reserve_shared` / `dma_resv_add_{shared,excl}_fence` → `dma_resv_reserve_fences` / `dma_resv_add_fence` | declarations in `dma-resv.h` (**5.19**; Ubuntu 5.15 backported `dma_resv_reserve_fences` independently) | `nvidia-drm/nvidia_rs_drm.c` (via `NV_RS_HAVE_DMA_RESV_RESERVE_FENCES` / `NV_RS_HAVE_DMA_RESV_ADD_FENCE` from `kernel-open/compat_probes.mk`) |
| `dma_fence_ops.use_64bit_seqno` → `dma_fence_init64` | declaration in `dma-fence.h` (**6.17**) | `nvidia-drm/nvidia_rs_drm.c` (via `NV_RS_HAVE_DMA_FENCE_INIT64` from `kernel-open/compat_probes.mk`) |
| `DRM_PLANE_HELPER_NO_SCALING` → `DRM_PLANE_NO_SCALING` | `#ifndef DRM_PLANE_NO_SCALING` (**6.1**) | `nvidia-drm/nvidia_rs_drm.c` |
- Host-fixture builds (`NV_RS_*_HOST_FIXTURE`) do not pull `<linux/version.h>`. `tests/irq-mock/irq_mock.h` and `tests/rom-fw-mock/rom_fw_mock.h` define `LINUX_VERSION_CODE 0` and `KERNEL_VERSION(a,b,c)` so the guards preprocess cleanly on the host-fixture side.

View File

@ -2362,6 +2362,15 @@ typedef struct drm_atomic_commit nv_rs_drm_atomic_state_t;
typedef struct drm_atomic_state nv_rs_drm_atomic_state_t;
#endif
/* Linux 6.1 renamed DRM_PLANE_HELPER_NO_SCALING (1 << 16) to DRM_PLANE_NO_SCALING. */
#ifndef DRM_PLANE_NO_SCALING
#ifdef DRM_PLANE_HELPER_NO_SCALING
#define DRM_PLANE_NO_SCALING DRM_PLANE_HELPER_NO_SCALING
#else
#define DRM_PLANE_NO_SCALING (1 << 16)
#endif
#endif
static int nv_rs_plane_atomic_check(struct drm_plane *plane,
nv_rs_drm_atomic_state_t *state)
{

View File

@ -600,11 +600,13 @@ int nv_rs_pci_bar1_write32(struct nv_rs_pci *p, u64 offset, u32 value)
}
int nv_rs_pci_bar1_wc_map(struct nv_rs_pci *p, u64 offset, u64 bytes)
{
if (!p || !bytes || ((offset | bytes) & 0xfff)) return -EINVAL;
#if defined(NV_RS_PCI_TEST_EDU) || defined(NV_RS_PCI_HOST_FIXTURE)
if (!p || !bytes || ((offset | bytes) & 0xfff)) return -EINVAL;
return -ENODEV;
#else
int error = 0;
if (!p || !bytes || ((offset | bytes) & 0xfff)) return -EINVAL;
mutex_lock(&p->access);
if (nv_rs_pci_is_removed(p)) error = -ENODEV;
else if (p->bar1_wc) error = -EBUSY;