Skip to content

Commit

Permalink
515.49.14
Browse files Browse the repository at this point in the history
  • Loading branch information
liam-middlebrook committed Aug 20, 2022
1 parent 54b4bab commit f848abf
Show file tree
Hide file tree
Showing 11 changed files with 367 additions and 28 deletions.
8 changes: 4 additions & 4 deletions README.md
@@ -1,7 +1,7 @@
# NVIDIA Linux Open GPU Kernel Module Source

This is the source release of the NVIDIA Linux open GPU kernel modules,
version 515.49.10.
version 515.49.14.


## How to Build
Expand All @@ -17,7 +17,7 @@ as root:

Note that the kernel modules built here must be used with gsp.bin
firmware and user-space NVIDIA GPU driver components from a corresponding
515.49.10 driver release. This can be achieved by installing
515.49.14 driver release. This can be achieved by installing
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
option. E.g.,

Expand Down Expand Up @@ -167,15 +167,15 @@ for the target kernel.
## Compatible GPUs

The open-gpu-kernel-modules can be used on any Turing or later GPU
(see the table below). However, in the 515.49.10 release,
(see the table below). However, in the 515.49.14 release,
GeForce and Workstation support is still considered alpha-quality.

To enable use of the open kernel modules on GeForce and Workstation GPUs,
set the "NVreg_OpenRmEnableUnsupportedGpus" nvidia.ko kernel module
parameter to 1. For more details, see the NVIDIA GPU driver end user
README here:

https://us.download.nvidia.com/XFree86/Linux-x86_64/515.49.10/README/kernel_open.html
https://us.download.nvidia.com/XFree86/Linux-x86_64/515.49.14/README/kernel_open.html

In the below table, if three IDs are listed, the first is the PCI Device
ID, the second is the PCI Subsystem Vendor ID, and the third is the PCI
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/Kbuild
Expand Up @@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
EXTRA_CFLAGS += -I$(src)
EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"515.49.10\"
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"515.49.14\"

EXTRA_CFLAGS += -Wno-unused-function

Expand Down
16 changes: 8 additions & 8 deletions src/common/inc/nvBldVer.h
Expand Up @@ -43,18 +43,18 @@
#endif

#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r515/VK516_10-209"
#define NV_BUILD_CHANGELIST_NUM (31587802)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r515/VK516_10-213"
#define NV_BUILD_CHANGELIST_NUM (31711086)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "rel/gpu_drv/r515/VK516_10-209"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (31587802)
#define NV_BUILD_NAME "rel/gpu_drv/r515/VK516_10-213"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (31711086)

#else /* Windows builds */
#define NV_BUILD_BRANCH_VERSION "VK516_10-10"
#define NV_BUILD_CHANGELIST_NUM (31587802)
#define NV_BUILD_BRANCH_VERSION "VK516_10-14"
#define NV_BUILD_CHANGELIST_NUM (31711086)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "516.89"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (31587802)
#define NV_BUILD_NAME "517.11"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (31711086)
#define NV_BUILD_BRANCH_BASE_VERSION R515
#endif
// End buildmeister python edited section
Expand Down
2 changes: 1 addition & 1 deletion src/common/inc/nvUnixVersion.h
Expand Up @@ -4,7 +4,7 @@
#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS) || defined(NV_VMWARE) || defined(NV_QNX) || defined(NV_INTEGRITY) || \
(defined(RMCFG_FEATURE_PLATFORM_GSP) && RMCFG_FEATURE_PLATFORM_GSP == 1)

#define NV_VERSION_STRING "515.49.10"
#define NV_VERSION_STRING "515.49.14"

#else

Expand Down
8 changes: 8 additions & 0 deletions src/nvidia-modeset/include/nvkms-modeset.h
Expand Up @@ -43,6 +43,14 @@ typedef NvBool (*NVShutDownHeadsTestFunc)(

void nvShutDownHeads(NVDevEvoPtr pDevEvo, NVShutDownHeadsTestFunc pTestFunc);

NVVBlankCallbackPtr nvRegisterVBlankCallback(NVDispEvoPtr pDispEvo,
NvU32 head,
NVVBlankCallbackProc pCallback,
void *pUserData);
void nvUnregisterVBlankCallback(NVDispEvoPtr pDispEvo,
NvU32 head,
NVVBlankCallbackPtr pCallback);

#ifdef __cplusplus
};
#endif
Expand Down
14 changes: 14 additions & 0 deletions src/nvidia-modeset/include/nvkms-types.h
Expand Up @@ -134,6 +134,7 @@ typedef struct _NVVblankSyncObjectRec *NVVblankSyncObjectPtr;
typedef struct _NVDispHeadStateEvoRec *NVDispHeadStateEvoPtr;
typedef struct _NVDispEvoRec *NVDispEvoPtr;
typedef struct _NVParsedEdidEvoRec *NVParsedEdidEvoPtr;
typedef struct _NVVBlankCallbackRec *NVVBlankCallbackPtr;
typedef struct _NVDpyEvoRec *NVDpyEvoPtr;
typedef struct _NVLutSurfaceEvo *NVLutSurfaceEvoPtr;
typedef struct _NVFrameLockEvo *NVFrameLockEvoPtr;
Expand Down Expand Up @@ -1567,6 +1568,9 @@ typedef struct _NVDispHeadStateEvoRec {
NvU8 numVblankSyncObjectsCreated;
NVVblankSyncObjectRec vblankSyncObjects[NVKMS_MAX_VBLANK_SYNC_OBJECTS_PER_HEAD];
NVDispHeadAudioStateEvoRec audio;

NvU32 rmVBlankCallbackHandle;
NVListRec vblankCallbackList;
} NVDispHeadStateEvoRec;

typedef struct _NVDispEvoRec {
Expand Down Expand Up @@ -1682,6 +1686,16 @@ typedef struct _NVParsedEdidEvoRec {
char serialNumberString[NVT_EDID_LDD_PAYLOAD_SIZE+1];
} NVParsedEdidEvoRec;

typedef void (*NVVBlankCallbackProc)(NVDispEvoRec *pDispEvo,
const NvU32 head,
NVVBlankCallbackPtr pCallbackData);

typedef struct _NVVBlankCallbackRec {
NVListRec vblankCallbackListEntry;
NVVBlankCallbackProc pCallback;
void *pUserData;
} NVVBlankCallbackRec;

typedef struct _NVDpyEvoRec {
NVListRec dpyListEntry;
NVDpyId id;
Expand Down
29 changes: 29 additions & 0 deletions src/nvidia-modeset/interface/nvkms-api.h
Expand Up @@ -270,6 +270,7 @@ enum NvKmsIoctlCommand {
NVKMS_IOCTL_EXPORT_VRR_SEMAPHORE_SURFACE,
NVKMS_IOCTL_ENABLE_VBLANK_SYNC_OBJECT,
NVKMS_IOCTL_DISABLE_VBLANK_SYNC_OBJECT,
NVKMS_IOCTL_NOTIFY_VBLANK,
};


Expand Down Expand Up @@ -4060,4 +4061,32 @@ struct NvKmsDisableVblankSyncObjectParams {
struct NvKmsDisableVblankSyncObjectReply reply; /*! out */
};

/*!
* NVKMS_IOCTL_NOTIFY_VBLANK:
*
* Register a unicast event fd to be notified when the next vblank event occurs
* on the specified head. This is a one-shot notification, and in order to be
* notified of subsequent vblank events the caller must clear and re-register
* the unicast event fd.
*/

struct NvKmsNotifyVblankRequest {
NvKmsDeviceHandle deviceHandle;
NvKmsDispHandle dispHandle;
NvU32 head;

struct {
int fd;
} unicastEvent;
};

struct NvKmsNotifyVblankReply {
NvU32 padding;
};

struct NvKmsNotifyVblankParams {
struct NvKmsNotifyVblankRequest request; /*! in */
struct NvKmsNotifyVblankReply reply; /*! out */
};

#endif /* NVKMS_API_H */
93 changes: 93 additions & 0 deletions src/nvidia-modeset/src/nvkms-modeset.c
Expand Up @@ -932,7 +932,35 @@ static NvBool ValidateProposedModeSetHwStateOneDispDPlib(
return bResult;
}

static void VBlankCallbackDeferredWork(void *dataPtr, NvU32 data32)
{
NVVBlankCallbackPtr pVBlankCallbackTmp = NULL;
NVVBlankCallbackPtr pVBlankCallback = NULL;
NVDispEvoPtr pDispEvo = dataPtr;
NvU32 head = data32;

if (!nvHeadIsActive(pDispEvo, head)) {
return;
}

nvListForEachEntry_safe(pVBlankCallback,
pVBlankCallbackTmp,
&pDispEvo->headState[head].vblankCallbackList,
vblankCallbackListEntry) {
pVBlankCallback->pCallback(pDispEvo, head, pVBlankCallback);
}
}

static void VBlankCallback(void *pParam1, void *pParam2)
{
const NvU32 head = (NvU32)(NvUPtr)pParam2;

(void) nvkms_alloc_timer_with_ref_ptr(
VBlankCallbackDeferredWork,
pParam1, /* ref_ptr to pDispEvo */
head, /* dataU32 */
0); /* timeout: schedule the work immediately */
}

/*!
* Validate the proposed configuration on the specified disp.
Expand Down Expand Up @@ -2625,6 +2653,71 @@ NvBool nvSetDispModeEvo(NVDevEvoPtr pDevEvo,
return ret;
}

/*!
* Register a callback to activate when vblank is reached on a given head.
*
* \param[in,out] pDispEvo The display engine to register the callback on.
* \param[in] head The head to register the callback on.
* \param[in] pCallback The function to call when vblank is reached on the
* provided pDispEvo+head combination.
* \param[in] pUserData A pointer to caller-provided custom data.
*
* \return Returns a pointer to a NVVBlankCallbackRec structure if the
* registration was successful. Otherwise, return NULL.
*/
NVVBlankCallbackPtr nvRegisterVBlankCallback(NVDispEvoPtr pDispEvo,
NvU32 head,
NVVBlankCallbackProc pCallback,
void *pUserData)
{
NVVBlankCallbackPtr pVBlankCallback = NULL;

pVBlankCallback = nvCalloc(1, sizeof(*pVBlankCallback));
if (pVBlankCallback == NULL) {
return NULL;
}

pVBlankCallback->pCallback = pCallback;
pVBlankCallback->pUserData = pUserData;

nvListAppend(&pVBlankCallback->vblankCallbackListEntry,
&pDispEvo->headState[head].vblankCallbackList);

// If this is the first entry in the list, register the vblank callback
if (pDispEvo->headState[head].rmVBlankCallbackHandle == 0) {

pDispEvo->headState[head].rmVBlankCallbackHandle =
nvRmAddVBlankCallback(pDispEvo,
head,
VBlankCallback);
}
return pVBlankCallback;
}

/*!
* Un-register a vblank callback for a given head.
*
* \param[in,out] pDispEvo The display engine to register the callback on.
* \param[in] head The head to register the callback on.
* \param[in] pCallback A pointer to the NVVBlankCallbackRec to un-register.
*
*/
void nvUnregisterVBlankCallback(NVDispEvoPtr pDispEvo,
NvU32 head,
NVVBlankCallbackPtr pCallback)
{
nvListDel(&pCallback->vblankCallbackListEntry);
nvFree(pCallback);

// If there are no more callbacks, disable the RM-level callback
if (nvListIsEmpty(&pDispEvo->headState[head].vblankCallbackList)) {
nvRmRemoveVBlankCallback(pDispEvo,
pDispEvo->headState[head].rmVBlankCallbackHandle);

pDispEvo->headState[head].rmVBlankCallbackHandle = 0;
}
}

/*!
* Perform a modeset that disables some or all heads.
*
Expand Down
2 changes: 2 additions & 0 deletions src/nvidia-modeset/src/nvkms-rm.c
Expand Up @@ -238,6 +238,7 @@ static void FreeDisplay(NVDispEvoPtr pDispEvo)

for (head = 0; head < ARRAY_LEN(pDispEvo->pSwapGroup); head++) {
nvAssert(pDispEvo->pSwapGroup[head] == NULL);
nvAssert(nvListIsEmpty(&pDispEvo->headState[head].vblankCallbackList));
}

nvAssert(nvListIsEmpty(&pDispEvo->dpyList));
Expand Down Expand Up @@ -269,6 +270,7 @@ static inline NVDispEvoPtr AllocDisplay(NVDevEvoPtr pDevEvo)
for (head = 0; head < ARRAY_LEN(pDispEvo->headState); head++) {
pDispEvo->headState[head].activeDpys = nvEmptyDpyIdList();
pDispEvo->headState[head].attributes = NV_EVO_DEFAULT_ATTRIBUTES_SET;
nvListInit(&pDispEvo->headState[head].vblankCallbackList);
}

pDispEvo->ref_ptr = nvkms_alloc_ref_ptr(pDispEvo);
Expand Down

0 comments on commit f848abf

Please sign in to comment.