Skip to content

Commit 2af9f1f

Browse files
committed
580.105.08
1 parent 2b43605 commit 2af9f1f

File tree

112 files changed

+56414
-54595
lines changed

Some content is hidden

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

112 files changed

+56414
-54595
lines changed

README.md

Lines changed: 823 additions & 827 deletions
Large diffs are not rendered by default.

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.95.05\"
82+
ccflags-y += -DNV_VERSION_STRING=\"580.105.08\"
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/common/inc/nvstatuscodes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ NV_STATUS_CODE(NV_ERR_FABRIC_STATE_OUT_OF_SYNC, 0x00000087, "NVLink fabri
165165
NV_STATUS_CODE(NV_ERR_BUFFER_FULL, 0x00000088, "Buffer is full")
166166
NV_STATUS_CODE(NV_ERR_BUFFER_EMPTY, 0x00000089, "Buffer is empty")
167167
NV_STATUS_CODE(NV_ERR_MC_FLA_OFFSET_TABLE_FULL, 0x0000008A, "Multicast FLA offset table has no available slots")
168+
NV_STATUS_CODE(NV_ERR_DMA_XFER_FAILED, 0x0000008B, "DMA transfer failed")
168169

169170
// Warnings:
170171
NV_STATUS_CODE(NV_WARN_HOT_SWITCH, 0x00010001, "WARNING Hot switch")

kernel-open/common/inc/os-interface.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ struct os_work_queue;
6262
/* Each OS defines its own version of this opaque type */
6363
typedef struct os_wait_queue os_wait_queue;
6464

65+
/* Flags needed by os_get_current_proccess_flags */
66+
#define OS_CURRENT_PROCESS_FLAG_NONE 0x0
67+
#define OS_CURRENT_PROCESS_FLAG_KERNEL_THREAD 0x1
68+
#define OS_CURRENT_PROCESS_FLAG_EXITING 0x2
69+
6570
/*
6671
* ---------------------------------------------------------------------------
6772
*
@@ -194,6 +199,7 @@ NV_STATUS NV_API_CALL os_open_readonly_file (const char *, void **
194199
NV_STATUS NV_API_CALL os_open_and_read_file (const char *, NvU8 *, NvU64);
195200
NvBool NV_API_CALL os_is_nvswitch_present (void);
196201
NV_STATUS NV_API_CALL os_get_random_bytes (NvU8 *, NvU16);
202+
NvU32 NV_API_CALL os_get_current_process_flags (void);
197203
NV_STATUS NV_API_CALL os_alloc_wait_queue (os_wait_queue **);
198204
void NV_API_CALL os_free_wait_queue (os_wait_queue *);
199205
void NV_API_CALL os_wait_uninterruptible (os_wait_queue *);

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);

0 commit comments

Comments
 (0)