Skip to content

Commit e4a5faa

Browse files
committed
610.57.04
1 parent 452cec6 commit e4a5faa

114 files changed

Lines changed: 202626 additions & 201532 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NVIDIA Linux Open GPU Kernel Module Source
22

33
This is the source release of the NVIDIA Linux open GPU kernel modules,
4-
version 610.43.03.
4+
version 610.57.04.
55

66

77
## How to Build
@@ -17,7 +17,7 @@ as root:
1717

1818
Note that the kernel modules built here must be used with GSP
1919
firmware and user-space NVIDIA GPU driver components from a corresponding
20-
610.43.03 driver release. This can be achieved by installing
20+
610.57.04 driver release. This can be achieved by installing
2121
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
2222
option. E.g.,
2323

@@ -185,7 +185,7 @@ table below).
185185
For details on feature support and limitations, see the NVIDIA GPU driver
186186
end user README here:
187187

188-
https://us.download.nvidia.com/XFree86/Linux-x86_64/610.43.03/README/kernel_open.html
188+
https://us.download.nvidia.com/XFree86/Linux-x86_64/610.57.04/README/kernel_open.html
189189

190190
For vGPU support, please refer to the README.vgpu packaged in the vGPU Host
191191
Package for more details.
@@ -1018,6 +1018,10 @@ Subsystem Device ID.
10181018
| NVIDIA RTX PRO 500 Blackwell Generation Laptop GPU | 2DB9 |
10191019
| NVIDIA GeForce RTX 5050 Laptop GPU | 2DD8 |
10201020
| NVIDIA RTX PRO 500 Blackwell Embedded GPU | 2DF9 |
1021+
| NVIDIA RTX Spark N1X (6144-core Blackwell RTX GPU) | 2E03 1043 1484 |
1022+
| NVIDIA RTX Spark N1X (6144-core Blackwell RTX GPU) | 2E03 1043 3309 |
1023+
| NVIDIA RTX Spark N1X (5120-core Blackwell RTX GPU) | 2E06 1043 1484 |
1024+
| NVIDIA RTX Spark N1X (5120-core Blackwell RTX GPU) | 2E06 1043 3309 |
10211025
| NVIDIA GB10 | 2E12 10DE 21EC |
10221026
| NVIDIA GeForce RTX 5070 | 2F04 |
10231027
| NVIDIA GeForce RTX 5060 | 2F06 |

kernel-open/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ccflags-y += -I$(src)/common/inc
7979
ccflags-y += -I$(src)
8080
ccflags-y += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
8181
ccflags-y += -D__KERNEL__ -DMODULE -DNVRM
82-
ccflags-y += -DNV_VERSION_STRING=\"610.43.03\"
82+
ccflags-y += -DNV_VERSION_STRING=\"610.57.04\"
8383

8484
# Include and link Tegra out-of-tree modules.
8585
ifneq ($(wildcard /usr/src/nvidia/nvidia-public),)

kernel-open/common/inc/nv-linux.h

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@
169169
#include <linux/efi.h> /* efi_enabled */
170170
#include <linux/fb.h> /* fb_info struct */
171171
#include <linux/screen_info.h> /* screen_info */
172+
#if defined(NV_LINUX_SYSFB_H_PRESENT)
173+
#include <linux/sysfb.h> /* sysfb_primary_display */
174+
#endif
172175

173176
#if !defined(CONFIG_PCI)
174177
#warning "Attempting to build driver for a platform with no PCI support!"
@@ -252,6 +255,10 @@ NV_STATUS nvos_forward_error_to_cray(struct pci_dev *, NvU32,
252255
user_function, NULL, args)
253256
#endif
254257

258+
#if defined(NV_LINUX_IOMMU_DMA_H_PRESENT)
259+
#include <linux/iommu-dma.h>
260+
#endif
261+
255262
#define NV_PAGE_COUNT(page) \
256263
((unsigned int)page_count(page))
257264

@@ -938,6 +945,11 @@ typedef struct nv_alloc_s {
938945
*/
939946
static inline NvBool nv_is_dma_direct(struct device *dev)
940947
{
948+
#if defined(NV_USE_DMA_IOMMU_PRESENT)
949+
if (use_dma_iommu(dev))
950+
return NV_FALSE;
951+
#endif
952+
941953
return get_dma_ops(dev) == NULL;
942954
}
943955

@@ -1041,6 +1053,7 @@ typedef struct nv_dma_map_s {
10411053
NvU64 page_count;
10421054
NvBool contiguous;
10431055
NvU32 cache_type;
1056+
NvBool bReadOnlyDeviceMap;
10441057
struct sg_table *import_sgt;
10451058

10461059
union
@@ -1711,6 +1724,25 @@ typedef enum
17111724
#else
17121725
#include <linux/gpio/driver.h>
17131726

1727+
static inline int __to_hwgpio(const struct gpio_device *gdev,
1728+
const struct of_phandle_args *gpiospec)
1729+
{
1730+
#if defined(CONFIG_OF_GPIO)
1731+
/*
1732+
* Use the chip's of_xlate callback to translate the DT GPIO
1733+
* specifier into a linear offset. Tegra GPIO controllers encode
1734+
* port and pin in args[0] and of_xlate sums per-port pin counts
1735+
* to produce the real offset.
1736+
*/
1737+
struct gpio_chip *chip = gpio_device_get_chip(gdev);
1738+
1739+
if (chip->of_xlate)
1740+
return chip->of_xlate(chip, gpiospec, NULL);
1741+
#endif
1742+
1743+
return gpiospec->args[0];
1744+
}
1745+
17141746
/*
17151747
* of_get_named_gpio() was removed along with linux/of_gpio.h by commit
17161748
* 51aaf65bbd21 ("gpio: of: Remove <linux/of_gpio.h>"). Provide a compat
@@ -1722,7 +1754,7 @@ static inline int of_get_named_gpio(const struct device_node *np,
17221754
struct of_phandle_args gpiospec;
17231755
struct gpio_device *gdev;
17241756
struct gpio_desc *desc;
1725-
int ret;
1757+
int ret, hwgpio;
17261758

17271759
if (!np)
17281760
return -ENOENT;
@@ -1737,30 +1769,13 @@ static inline int of_get_named_gpio(const struct device_node *np,
17371769
if (!gdev)
17381770
return -EPROBE_DEFER;
17391771

1740-
/*
1741-
* Use the chip's of_xlate callback to translate the DT GPIO
1742-
* specifier into a linear offset. Tegra GPIO controllers encode
1743-
* port and pin in args[0] and of_xlate sums per-port pin counts
1744-
* to produce the real offset.
1745-
*/
1746-
{
1747-
struct gpio_chip *chip = gpio_device_get_chip(gdev);
1748-
int hwgpio;
1749-
1750-
#if defined(CONFIG_OF_GPIO)
1751-
if (chip->of_xlate)
1752-
hwgpio = chip->of_xlate(chip, &gpiospec, NULL);
1753-
else
1754-
#endif
1755-
hwgpio = gpiospec.args[0];
1756-
1757-
if (hwgpio < 0) {
1758-
gpio_device_put(gdev);
1759-
return hwgpio;
1760-
}
1761-
1762-
desc = gpio_device_get_desc(gdev, hwgpio);
1772+
hwgpio = __to_hwgpio(gdev, &gpiospec);
1773+
if (hwgpio < 0) {
1774+
gpio_device_put(gdev);
1775+
return hwgpio;
17631776
}
1777+
1778+
desc = gpio_device_get_desc(gdev, hwgpio);
17641779
gpio_device_put(gdev);
17651780

17661781
if (IS_ERR(desc))

kernel-open/common/inc/nv.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,8 @@ struct nv_file_private_t
660660
nv_file_private_t * PORT_ATOMIC ctl_nvfp;
661661
void *ctl_nvfp_priv;
662662
PORT_ATOMIC NvU32 register_or_refcount;
663+
// In-flight nv_post_event() calls using this file private.
664+
PORT_ATOMIC NvS32 event_posting_refcount;
663665

664666
//
665667
// True if a client or an event was ever allocated on this fd.
@@ -668,6 +670,11 @@ struct nv_file_private_t
668670
NvBool bCleanupRmapi;
669671
};
670672

673+
static inline NvS32 nv_event_posting_refcount_read(nv_file_private_t *nvfp)
674+
{
675+
return *((volatile NvS32 *)&nvfp->event_posting_refcount);
676+
}
677+
671678
// Forward define the gpu ops structures
672679
typedef struct gpuSession *nvgpuSessionHandle_t;
673680
typedef struct gpuDevice *nvgpuDeviceHandle_t;
@@ -969,9 +976,9 @@ void NV_API_CALL nv_unregister_sgt (nv_state_t *, struct sg_table
969976
NV_STATUS NV_API_CALL nv_register_phys_pages (nv_state_t *, NvU64 *, NvU64, NvU32, void **);
970977
void NV_API_CALL nv_unregister_phys_pages (nv_state_t *, void *);
971978

972-
NV_STATUS NV_API_CALL nv_dma_map_sgt (nv_dma_device_t *, NvU64, NvU64 *, NvU32, void **);
979+
NV_STATUS NV_API_CALL nv_dma_map_sgt (nv_dma_device_t *, NvU64, NvU64 *, NvU32, NvBool, void **);
973980

974-
NV_STATUS NV_API_CALL nv_dma_map_alloc (nv_dma_device_t *, NvU64, NvU64 *, NvBool, void **);
981+
NV_STATUS NV_API_CALL nv_dma_map_alloc (nv_dma_device_t *, NvU64, NvU64 *, NvBool, NvBool, void **);
975982
NV_STATUS NV_API_CALL nv_dma_unmap_alloc (nv_dma_device_t *, NvU64, NvU64 *, void **);
976983

977984
NV_STATUS NV_API_CALL nv_dma_map_peer (nv_dma_device_t *, nv_dma_device_t *, NvU8, NvU64, NvU64 *);

kernel-open/conftest.sh

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,14 +1175,15 @@ compile_test() {
11751175
#
11761176
CODE="
11771177
#include <linux/pci.h>
1178+
#if defined(NV_LINUX_NVGRACE_EGM_H_PRESENT)
11781179
#include <linux/nvgrace-egm.h>
1180+
#endif
11791181
void conftest_egm_module_helper_api_present() {
1180-
struct pci_dev *pdev = NULL;
1181-
register_egm_node(pdev);
1182-
unregister_egm_node(pdev);
1182+
register_egm_node();
1183+
unregister_egm_node();
11831184
}
11841185
"
1185-
compile_check_conftest "$CODE" "NV_EGM_MODULE_HELPER_API_PRESENT" "" "types"
1186+
compile_check_conftest "$CODE" "NV_EGM_MODULE_HELPER_API_PRESENT" "" "functions"
11861187
;;
11871188

11881189
egm_bad_pages_handling_support)
@@ -5216,6 +5217,40 @@ compile_test() {
52165217
compile_check_conftest "$CODE" "NV_DRM_COLOROP_HAS_FUNCS" "" "types"
52175218
;;
52185219

5220+
use_dma_iommu)
5221+
#
5222+
# Determine if use_dma_iommu() function is present.
5223+
#
5224+
# Added by commit 19156263cb1f ("dma-mapping: use IOMMU DMA
5225+
# calls for common alloc/free page calls") in 6.12
5226+
#
5227+
CODE="
5228+
#if defined(NV_LINUX_IOMMU_DMA_H_PRESENT)
5229+
#include <linux/iommu-dma.h>
5230+
#endif
5231+
5232+
void conftest_use_dma_iommu(void) {
5233+
use_dma_iommu();
5234+
}"
5235+
compile_check_conftest "$CODE" "NV_USE_DMA_IOMMU_PRESENT" "" "functions"
5236+
;;
5237+
5238+
drm_atomic_commit_struct_present)
5239+
#
5240+
# Determine if 'struct drm_atomic_state' has been renamed to
5241+
# 'struct drm_atomic_commit'.
5242+
#
5243+
# Renamed by commit 5164f7e7ff8e ("drm: Rename struct
5244+
# drm_atomic_state to drm_atomic_commit"), expected in Linux v7.2.
5245+
#
5246+
CODE="
5247+
#include <drm/drm_atomic.h>
5248+
5249+
struct drm_atomic_commit state;"
5250+
5251+
compile_check_conftest "$CODE" "NV_DRM_ATOMIC_COMMIT_STRUCT_PRESENT" "" "types"
5252+
;;
5253+
52195254
# When adding a new conftest entry, please use the correct format for
52205255
# specifying the relevant upstream Linux kernel commit. Please
52215256
# avoid specifying -rc kernels, and only use SHAs that actually exist

kernel-open/header-presence-tests.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ NV_HEADER_PRESENCE_TESTS = \
3939
linux/stdarg.h \
4040
linux/iosys-map.h \
4141
linux/vfio_pci_core.h \
42+
linux/nvgrace-egm.h \
4243
linux/cc_platform.h \
4344
linux/slub_def.h \
4445
linux/of_gpio.h \
4546
asm/cpufeature.h \
4647
asm/mshyperv.h \
4748
crypto/sig.h \
48-
drm/drm_colorop.h
49+
drm/drm_colorop.h \
50+
linux/iommu-dma.h \
51+
linux/sysfb.h
4952

kernel-open/nvidia-drm/nvidia-drm-color-pipeline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ plane_build_single_pipeline(struct drm_plane *plane,
289289
static int plane_update_state_from_colorops(struct drm_plane *plane,
290290
struct drm_plane_state *plane_state)
291291
{
292-
struct drm_atomic_state *state = plane_state->state;
292+
nv_drm_atomic_state_base_t *state = plane_state->state;
293293
struct nv_drm_plane_state *nv_plane_state = to_nv_drm_plane_state(plane_state);
294294
struct nv_drm_colorop *nv_colorop;
295295
struct nv_drm_color_pipeline *pipeline;

kernel-open/nvidia-drm/nvidia-drm-connector.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static const NvU32 __nv_drm_connector_supported_colorspaces =
500500
#if defined(NV_DRM_CONNECTOR_ATTACH_HDR_OUTPUT_METADATA_PROPERTY_PRESENT)
501501
static int
502502
__nv_drm_connector_atomic_check(struct drm_connector *connector,
503-
struct drm_atomic_state *state)
503+
nv_drm_atomic_state_base_t *state)
504504
{
505505
struct drm_connector_state *new_connector_state =
506506
drm_atomic_get_new_connector_state(state, connector);

kernel-open/nvidia-drm/nvidia-drm-crtc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,16 +1604,16 @@ static int __nv_drm_cursor_atomic_check(struct drm_plane *plane,
16041604
return 0;
16051605
}
16061606

1607-
#if defined(NV_DRM_PLANE_ATOMIC_CHECK_HAS_ATOMIC_STATE_ARG)
1607+
#if defined(NV_DRM_PLANE_ATOMIC_CHECK_HAS_FULL_STATE_ARG)
16081608
static int nv_drm_plane_atomic_check(struct drm_plane *plane,
1609-
struct drm_atomic_state *state)
1609+
nv_drm_atomic_state_base_t *state)
16101610
#else
16111611
static int nv_drm_plane_atomic_check(struct drm_plane *plane,
16121612
struct drm_plane_state *plane_state)
16131613
#endif
16141614
{
16151615
struct nv_drm_plane *nv_plane = to_nv_plane(plane);
1616-
#if defined(NV_DRM_PLANE_ATOMIC_CHECK_HAS_ATOMIC_STATE_ARG)
1616+
#if defined(NV_DRM_PLANE_ATOMIC_CHECK_HAS_FULL_STATE_ARG)
16171617
struct drm_plane_state *plane_state =
16181618
drm_atomic_get_new_plane_state(state, plane);
16191619
#endif
@@ -2608,15 +2608,15 @@ static int color_mgmt_config_set_luts(struct nv_drm_crtc_state *nv_crtc_state,
26082608
* the 'nv_drm_crtc_state::req_config', that is fine because 'nv_drm_crtc_state'
26092609
* will be discarded if ->atomic_check() fails.
26102610
*/
2611-
#if defined(NV_DRM_CRTC_ATOMIC_CHECK_HAS_ATOMIC_STATE_ARG)
2611+
#if defined(NV_DRM_CRTC_ATOMIC_CHECK_HAS_FULL_STATE_ARG)
26122612
static int nv_drm_crtc_atomic_check(struct drm_crtc *crtc,
2613-
struct drm_atomic_state *state)
2613+
nv_drm_atomic_state_base_t *state)
26142614
#else
26152615
static int nv_drm_crtc_atomic_check(struct drm_crtc *crtc,
26162616
struct drm_crtc_state *crtc_state)
26172617
#endif
26182618
{
2619-
#if defined(NV_DRM_CRTC_ATOMIC_CHECK_HAS_ATOMIC_STATE_ARG)
2619+
#if defined(NV_DRM_CRTC_ATOMIC_CHECK_HAS_FULL_STATE_ARG)
26202620
struct drm_crtc_state *crtc_state =
26212621
drm_atomic_get_new_crtc_state(state, crtc);
26222622
#endif

kernel-open/nvidia-drm/nvidia-drm-drv.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ static void nv_drm_master_set(struct drm_device *dev,
987987
static
988988
int nv_drm_reset_input_colorspace(struct drm_device *dev)
989989
{
990-
struct drm_atomic_state *state;
990+
nv_drm_atomic_state_base_t *state;
991991
struct drm_plane_state *plane_state;
992992
struct drm_plane *plane;
993993
struct nv_drm_plane_state *nv_drm_plane_state;
@@ -996,7 +996,7 @@ int nv_drm_reset_input_colorspace(struct drm_device *dev)
996996
bool do_reset = false;
997997
NvU32 flags = 0;
998998

999-
state = drm_atomic_state_alloc(dev);
999+
state = nv_drm_atomic_state_base_alloc(dev);
10001000
if (!state)
10011001
return -ENOMEM;
10021002

@@ -1027,7 +1027,7 @@ int nv_drm_reset_input_colorspace(struct drm_device *dev)
10271027
}
10281028

10291029
out:
1030-
drm_atomic_state_put(state);
1030+
nv_drm_atomic_state_base_put(state);
10311031
drm_modeset_drop_locks(&ctx);
10321032
drm_modeset_acquire_fini(&ctx);
10331033

@@ -1435,7 +1435,7 @@ static int nv_drm_grant_permission_ioctl(struct drm_device *dev, void *data,
14351435
}
14361436

14371437
static int
1438-
nv_drm_atomic_disable_connector(struct drm_atomic_state *state,
1438+
nv_drm_atomic_disable_connector(nv_drm_atomic_state_base_t *state,
14391439
struct nv_drm_connector *nv_connector)
14401440
{
14411441
struct drm_crtc_state *crtc_state;
@@ -1468,7 +1468,7 @@ static int nv_drm_revoke_modeset_permission(struct drm_device *dev,
14681468
struct drm_file *filep, NvU32 dpyId)
14691469
{
14701470
struct drm_modeset_acquire_ctx *pctx;
1471-
struct drm_atomic_state *state;
1471+
nv_drm_atomic_state_base_t *state;
14721472
struct drm_connector *connector;
14731473
struct drm_crtc *crtc;
14741474
int ret = 0;
@@ -1483,7 +1483,7 @@ static int nv_drm_revoke_modeset_permission(struct drm_device *dev,
14831483
pctx = dev->mode_config.acquire_ctx;
14841484
#endif
14851485

1486-
state = drm_atomic_state_alloc(dev);
1486+
state = nv_drm_atomic_state_base_alloc(dev);
14871487
if (!state) {
14881488
ret = -ENOMEM;
14891489
goto done;
@@ -1519,7 +1519,7 @@ static int nv_drm_revoke_modeset_permission(struct drm_device *dev,
15191519

15201520
ret = drm_atomic_commit(state);
15211521
done:
1522-
drm_atomic_state_put(state);
1522+
nv_drm_atomic_state_base_put(state);
15231523

15241524
#if NV_DRM_MODESET_LOCK_ALL_END_ARGUMENT_COUNT == 3
15251525
DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);

0 commit comments

Comments
 (0)