Skip to content

Commit e2dbb3d

Browse files
committed
580.94.06
1 parent 1babfa3 commit e2dbb3d

File tree

74 files changed

+55029
-53585
lines changed

Some content is hidden

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

74 files changed

+55029
-53585
lines changed

README.md

Lines changed: 3 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 580.94.03.
4+
version 580.94.06.
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-
580.94.03 driver release. This can be achieved by installing
20+
580.94.06 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/580.94.03/README/kernel_open.html
188+
https://us.download.nvidia.com/XFree86/Linux-x86_64/580.94.06/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.

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=\"580.94.03\"
82+
ccflags-y += -DNV_VERSION_STRING=\"580.94.06\"
8383

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

kernel-open/common/inc/nv-modeset-interface.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ typedef struct {
5858
*/
5959
void (*suspend)(NvU32 gpu_id);
6060
void (*resume)(NvU32 gpu_id);
61+
62+
/* Remove callback, called when a device is going away completely. */
63+
void (*remove)(NvU32 gpu_id);
64+
65+
/* Probe callback, called when a device is being hotplugged. */
66+
void (*probe)(const nv_gpu_info_t *gpu_info);
6167
} nvidia_modeset_callbacks_t;
6268

6369
/*

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ NV_STATUS nv_set_system_power_state (nv_power_state_t, nv_pm_action_depth_t)
7878

7979
void nvidia_modeset_suspend (NvU32 gpuId);
8080
void nvidia_modeset_resume (NvU32 gpuId);
81+
void nvidia_modeset_remove (NvU32 gpuId);
82+
void nvidia_modeset_probe (const nv_linux_state_t *nvl);
8183
NvBool nv_is_uuid_in_gpu_exclusion_list (const char *);
8284

8385
NV_STATUS nv_parse_per_device_option_string(nvidia_stack_t *sp);

kernel-open/common/inc/nv_uvm_types.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,13 @@ typedef struct UvmGpuInfo_tag
688688

689689
// GPU setup in CDMM mode
690690
NvBool cdmmEnabled;
691+
692+
// If nvlinkDirectConnect is NV_TRUE,
693+
// nvlDirectConnectMemoryWindowStart is the GPA base address for the GPU's vidmem over
694+
// direct-connect NVLink. It is used when creating PTEs of GPU memory mappings
695+
// to direct NVLink peers.
696+
NvBool nvlDirectConnect;
697+
NvU64 nvlDirectConnectMemoryWindowStart;
691698
} UvmGpuInfo;
692699

693700
typedef struct UvmGpuFbInfo_tag

kernel-open/common/inc/nvkms-kapi.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -598,13 +598,17 @@ typedef enum NvKmsKapiRegisterWaiterResultRec {
598598
NVKMS_KAPI_REG_WAITER_ALREADY_SIGNALLED,
599599
} NvKmsKapiRegisterWaiterResult;
600600

601-
typedef void NvKmsKapiSuspendResumeCallbackFunc(NvBool suspend);
602-
603601
struct NvKmsKapiGpuInfo {
604602
nv_gpu_info_t gpuInfo;
605603
MIGDeviceId migDevice;
606604
};
607605

606+
struct NvKmsKapiCallbacks {
607+
void (*suspendResume)(NvBool suspend);
608+
void (*remove)(NvU32 gpuId);
609+
void (*probe)(const struct NvKmsKapiGpuInfo *gpu_info);
610+
};
611+
608612
struct NvKmsKapiFunctionsTable {
609613

610614
/*!
@@ -1473,12 +1477,12 @@ struct NvKmsKapiFunctionsTable {
14731477
);
14741478

14751479
/*!
1476-
* Set the callback function for suspending and resuming the display system.
1480+
* Set the pointer to the callback function table.
14771481
*/
14781482
void
1479-
(*setSuspendResumeCallback)
1483+
(*setCallbacks)
14801484
(
1481-
NvKmsKapiSuspendResumeCallbackFunc *function
1485+
const struct NvKmsKapiCallbacks *callbacks
14821486
);
14831487

14841488
/*!

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

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ static int nv_drm_revoke_modeset_permission(struct drm_device *dev,
101101
NvU32 dpyId);
102102
static int nv_drm_revoke_sub_ownership(struct drm_device *dev);
103103

104+
static DEFINE_MUTEX(dev_list_mutex);
104105
static struct nv_drm_device *dev_list = NULL;
105106

106107
static const char* nv_get_input_colorspace_name(
@@ -2067,8 +2068,10 @@ void nv_drm_register_drm_device(const struct NvKmsKapiGpuInfo *gpu_info)
20672068

20682069
/* Add NVIDIA-DRM device into list */
20692070

2071+
mutex_lock(&dev_list_mutex);
20702072
nv_dev->next = dev_list;
20712073
dev_list = nv_dev;
2074+
mutex_unlock(&dev_list_mutex);
20722075

20732076
return; /* Success */
20742077

@@ -2106,22 +2109,81 @@ int nv_drm_probe_devices(void)
21062109
}
21072110
#endif
21082111

2112+
static struct nv_drm_device*
2113+
nv_drm_pop_device(void)
2114+
{
2115+
struct nv_drm_device *nv_dev;
2116+
2117+
mutex_lock(&dev_list_mutex);
2118+
2119+
nv_dev = dev_list;
2120+
if (nv_dev) {
2121+
dev_list = nv_dev->next;
2122+
nv_dev->next = NULL;
2123+
}
2124+
2125+
mutex_unlock(&dev_list_mutex);
2126+
return nv_dev;
2127+
}
2128+
2129+
static struct nv_drm_device*
2130+
nv_drm_find_and_remove_device(NvU32 gpuId)
2131+
{
2132+
struct nv_drm_device **pPrev = &dev_list;
2133+
struct nv_drm_device *nv_dev;
2134+
2135+
mutex_lock(&dev_list_mutex);
2136+
nv_dev = *pPrev;
2137+
2138+
while (nv_dev) {
2139+
if (nv_dev->gpu_info.gpu_id == gpuId) {
2140+
/* Remove it from the linked list */
2141+
*pPrev = nv_dev->next;
2142+
nv_dev->next = NULL;
2143+
break;
2144+
}
2145+
2146+
pPrev = &nv_dev->next;
2147+
nv_dev = *pPrev;
2148+
}
2149+
2150+
mutex_unlock(&dev_list_mutex);
2151+
return nv_dev;
2152+
}
2153+
2154+
static void nv_drm_dev_destroy(struct nv_drm_device *nv_dev)
2155+
{
2156+
struct drm_device *dev = nv_dev->dev;
2157+
2158+
nv_drm_dev_unload(dev);
2159+
drm_dev_put(dev);
2160+
nv_drm_free(nv_dev);
2161+
}
2162+
21092163
/*
2110-
* Unregister all NVIDIA DRM devices.
2164+
* Unregister a single NVIDIA DRM device.
21112165
*/
2112-
void nv_drm_remove_devices(void)
2166+
void nv_drm_remove(NvU32 gpuId)
21132167
{
2114-
while (dev_list != NULL) {
2115-
struct nv_drm_device *next = dev_list->next;
2116-
struct drm_device *dev = dev_list->dev;
2168+
struct nv_drm_device *nv_dev = nv_drm_find_and_remove_device(gpuId);
21172169

2118-
drm_dev_unregister(dev);
2119-
nv_drm_dev_unload(dev);
2120-
drm_dev_put(dev);
2170+
if (nv_dev) {
2171+
NV_DRM_DEV_LOG_INFO(nv_dev, "Removing device");
2172+
drm_dev_unplug(nv_dev->dev);
2173+
nv_drm_dev_destroy(nv_dev);
2174+
}
2175+
}
21212176

2122-
nv_drm_free(dev_list);
2177+
/*
2178+
* Unregister all NVIDIA DRM devices.
2179+
*/
2180+
void nv_drm_remove_devices(void)
2181+
{
2182+
struct nv_drm_device *nv_dev;
21232183

2124-
dev_list = next;
2184+
while ((nv_dev = nv_drm_pop_device())) {
2185+
drm_dev_unregister(nv_dev->dev);
2186+
nv_drm_dev_destroy(nv_dev);
21252187
}
21262188
}
21272189

@@ -2143,11 +2205,10 @@ void nv_drm_remove_devices(void)
21432205
*/
21442206
void nv_drm_suspend_resume(NvBool suspend)
21452207
{
2146-
static DEFINE_MUTEX(nv_drm_suspend_mutex);
21472208
static NvU32 nv_drm_suspend_count = 0;
21482209
struct nv_drm_device *nv_dev;
21492210

2150-
mutex_lock(&nv_drm_suspend_mutex);
2211+
mutex_lock(&dev_list_mutex);
21512212

21522213
/*
21532214
* Count the number of times the driver is asked to suspend. Suspend all DRM
@@ -2195,7 +2256,7 @@ void nv_drm_suspend_resume(NvBool suspend)
21952256
}
21962257

21972258
done:
2198-
mutex_unlock(&nv_drm_suspend_mutex);
2259+
mutex_unlock(&dev_list_mutex);
21992260
}
22002261

22012262
#endif /* NV_DRM_AVAILABLE */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct NvKmsKapiGpuInfo;
3131

3232
int nv_drm_probe_devices(void);
3333

34+
void nv_drm_remove(NvU32 gpuId);
3435
void nv_drm_remove_devices(void);
3536

3637
void nv_drm_suspend_resume(NvBool suspend);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ static struct NvKmsKapiFunctionsTable nvKmsFuncsTable = {
3333

3434
const struct NvKmsKapiFunctionsTable* const nvKms = &nvKmsFuncsTable;
3535

36+
const struct NvKmsKapiCallbacks nv_drm_kapi_callbacks = {
37+
.suspendResume = nv_drm_suspend_resume,
38+
.remove = nv_drm_remove,
39+
.probe = nv_drm_register_drm_device,
40+
};
41+
3642
#endif
3743

3844
int nv_drm_init(void)
@@ -45,7 +51,7 @@ int nv_drm_init(void)
4551
return -EINVAL;
4652
}
4753

48-
nvKms->setSuspendResumeCallback(nv_drm_suspend_resume);
54+
nvKms->setCallbacks(&nv_drm_kapi_callbacks);
4955
return nv_drm_probe_devices();
5056
#else
5157
return 0;
@@ -55,7 +61,7 @@ int nv_drm_init(void)
5561
void nv_drm_exit(void)
5662
{
5763
#if defined(NV_DRM_AVAILABLE)
58-
nvKms->setSuspendResumeCallback(NULL);
64+
nvKms->setCallbacks(NULL);
5965
nv_drm_remove_devices();
6066
#endif
6167
}

kernel-open/nvidia-modeset/nvidia-modeset-linux.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,20 @@ static void nvkms_resume(NvU32 gpuId)
820820
nvKmsKapiSuspendResume(NV_FALSE /* suspend */);
821821
}
822822

823+
static void nvkms_remove(NvU32 gpuId)
824+
{
825+
nvKmsKapiRemove(gpuId);
826+
827+
// Eventually, this function should also terminate all NVKMS clients and
828+
// free the NVDevEvoRec. Until that is implemented, all NVKMS clients must
829+
// be closed before a device is removed.
830+
}
831+
832+
static void nvkms_probe(const nv_gpu_info_t *gpu_info)
833+
{
834+
nvKmsKapiProbe(gpu_info);
835+
}
836+
823837

824838
/*************************************************************************
825839
* Interface with resman.
@@ -828,7 +842,9 @@ static void nvkms_resume(NvU32 gpuId)
828842
static nvidia_modeset_rm_ops_t __rm_ops = { 0 };
829843
static nvidia_modeset_callbacks_t nvkms_rm_callbacks = {
830844
.suspend = nvkms_suspend,
831-
.resume = nvkms_resume
845+
.resume = nvkms_resume,
846+
.remove = nvkms_remove,
847+
.probe = nvkms_probe,
832848
};
833849

834850
static int nvkms_alloc_rm(void)

0 commit comments

Comments
 (0)