Skip to content

Commit

Permalink
565.77
Browse files Browse the repository at this point in the history
  • Loading branch information
niv committed Dec 5, 2024
1 parent d5a0858 commit 9d0b041
Show file tree
Hide file tree
Showing 39 changed files with 457 additions and 216 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 565.57.01.
version 565.77.


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

Note that the kernel modules built here must be used with GSP
firmware and user-space NVIDIA GPU driver components from a corresponding
565.57.01 driver release. This can be achieved by installing
565.77 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 @@ -185,7 +185,7 @@ table below).
For details on feature support and limitations, see the NVIDIA GPU driver
end user README here:

https://us.download.nvidia.com/XFree86/Linux-x86_64/565.57.01/README/kernel_open.html
https://us.download.nvidia.com/XFree86/Linux-x86_64/565.77/README/kernel_open.html

For vGPU support, please refer to the README.vgpu packaged in the vGPU Host
Package for more details.
Expand Down Expand Up @@ -754,6 +754,8 @@ Subsystem Device ID.
| NVIDIA H800 | 2324 10DE 17A8 |
| NVIDIA H20 | 2329 10DE 198B |
| NVIDIA H20 | 2329 10DE 198C |
| NVIDIA H20-3e | 232C 10DE 2063 |
| NVIDIA H20-3e | 232C 10DE 2064 |
| NVIDIA H100 80GB HBM3 | 2330 10DE 16C0 |
| NVIDIA H100 80GB HBM3 | 2330 10DE 16C1 |
| NVIDIA H100 PCIe | 2331 10DE 1626 |
Expand Down Expand Up @@ -836,10 +838,12 @@ Subsystem Device ID.
| NVIDIA GeForce RTX 2050 | 25AD |
| NVIDIA RTX A1000 | 25B0 1028 1878 |
| NVIDIA RTX A1000 | 25B0 103C 1878 |
| NVIDIA RTX A1000 | 25B0 103C 8D96 |
| NVIDIA RTX A1000 | 25B0 10DE 1878 |
| NVIDIA RTX A1000 | 25B0 17AA 1878 |
| NVIDIA RTX A400 | 25B2 1028 1879 |
| NVIDIA RTX A400 | 25B2 103C 1879 |
| NVIDIA RTX A400 | 25B2 103C 8D95 |
| NVIDIA RTX A400 | 25B2 10DE 1879 |
| NVIDIA RTX A400 | 25B2 17AA 1879 |
| NVIDIA A16 | 25B6 10DE 14A9 |
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
EXTRA_CFLAGS += -I$(src)
EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"565.57.01\"
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"565.77\"

ifneq ($(SYSSRCHOST1X),)
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)
Expand Down
31 changes: 29 additions & 2 deletions kernel-open/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ else
endif
endif

# If CC hasn't been set explicitly, check the value of CONFIG_CC_VERSION_TEXT.
# Look for the compiler specified there, and use it by default, if found.
ifeq ($(origin CC),default)
cc_version_text=$(firstword $(shell . $(KERNEL_OUTPUT)/.config; \
echo "$$CONFIG_CC_VERSION_TEXT"))

ifneq ($(cc_version_text),)
ifeq ($(shell command -v $(cc_version_text)),)
$(warning WARNING: Unable to locate the compiler $(cc_version_text) \
from CONFIG_CC_VERSION_TEXT in the kernel configuration.)
else
CC=$(cc_version_text)
endif
endif
endif

CC ?= cc
LD ?= ld
OBJDUMP ?= objdump
Expand All @@ -65,6 +81,16 @@ else
)
endif

KERNEL_ARCH = $(ARCH)

ifneq ($(filter $(ARCH),i386 x86_64),)
KERNEL_ARCH = x86
else
ifeq ($(filter $(ARCH),arm64 powerpc),)
$(error Unsupported architecture $(ARCH))
endif
endif

NV_KERNEL_MODULES ?= $(wildcard nvidia nvidia-uvm nvidia-vgpu-vfio nvidia-modeset nvidia-drm nvidia-peermem)
NV_KERNEL_MODULES := $(filter-out $(NV_EXCLUDE_KERNEL_MODULES), \
$(NV_KERNEL_MODULES))
Expand Down Expand Up @@ -106,8 +132,9 @@ else
# module symbols on which the Linux kernel's module resolution is dependent
# and hence must be used whenever present.

LD_SCRIPT ?= $(KERNEL_SOURCES)/scripts/module-common.lds \
$(KERNEL_SOURCES)/arch/$(ARCH)/kernel/module.lds \
LD_SCRIPT ?= $(KERNEL_SOURCES)/scripts/module-common.lds \
$(KERNEL_SOURCES)/arch/$(KERNEL_ARCH)/kernel/module.lds \
$(KERNEL_OUTPUT)/arch/$(KERNEL_ARCH)/module.lds \
$(KERNEL_OUTPUT)/scripts/module.lds
NV_MODULE_COMMON_SCRIPTS := $(foreach s, $(wildcard $(LD_SCRIPT)), -T $(s))

Expand Down
16 changes: 16 additions & 0 deletions kernel-open/conftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,22 @@ compile_test() {
fi
;;

file_operations_fop_unsigned_offset_present)
#
# Determine if the FOP_UNSIGNED_OFFSET define is present.
#
# Added by commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
# fop_flags") in v6.12.
#
CODE="
#include <linux/fs.h>
int conftest_file_operations_fop_unsigned_offset_present(void) {
return FOP_UNSIGNED_OFFSET;
}"

compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_FOP_UNSIGNED_OFFSET_PRESENT" "" "types"
;;

pci_dev_has_ats_enabled)
#
# Determine if the 'pci_dev' data type has a 'ats_enabled' member.
Expand Down
4 changes: 4 additions & 0 deletions kernel-open/nvidia-drm/nvidia-drm-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,10 @@ static const struct file_operations nv_drm_fops = {
.read = drm_read,

.llseek = noop_llseek,

#if defined(NV_FILE_OPERATIONS_FOP_UNSIGNED_OFFSET_PRESENT)
.fop_flags = FOP_UNSIGNED_OFFSET,
#endif
};

static const struct drm_ioctl_desc nv_drm_ioctls[] = {
Expand Down
1 change: 1 addition & 0 deletions kernel-open/nvidia-drm/nvidia-drm-sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_color_lut
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_property_blob_put
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_gem_prime_mmap
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_output_poll_changed
NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations_fop_unsigned_offset_present
5 changes: 3 additions & 2 deletions kernel-open/nvidia-uvm/uvm_hmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void hmm_copy_devmem_page(struct page *dst_page, struct page *src_page)
gpu = uvm_gpu_chunk_get_gpu(gpu_chunk);
status = uvm_mmu_chunk_map(gpu_chunk);
if (status != NV_OK)
goto out_zero;
goto out;

status = uvm_parent_gpu_map_cpu_pages(gpu->parent, dst_page, PAGE_SIZE, &dma_addr);
if (status != NV_OK)
Expand Down Expand Up @@ -215,7 +215,7 @@ static void hmm_copy_devmem_page(struct page *dst_page, struct page *src_page)
out_unmap_gpu:
uvm_mmu_chunk_unmap(gpu_chunk, NULL);

out_zero:
out:
// We can't fail eviction because we need to free the device-private pages
// so the GPU can be unregistered. So the best we can do is warn on any
// failures and zero the uninitialised page. This could result in data loss
Expand Down Expand Up @@ -245,6 +245,7 @@ static NV_STATUS uvm_hmm_pmm_gpu_evict_pfn(unsigned long pfn)
}

lock_page(dst_page);

hmm_copy_devmem_page(dst_page, migrate_pfn_to_page(src_pfn));
dst_pfn = migrate_pfn(page_to_pfn(dst_page));
migrate_device_pages(&src_pfn, &dst_pfn, 1);
Expand Down
20 changes: 10 additions & 10 deletions src/common/inc/nvBldVer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@
// and then checked back in. You cannot make changes to these sections without
// corresponding changes to the buildmeister script
#ifndef NV_BUILD_BRANCH
#define NV_BUILD_BRANCH r565_97
#define NV_BUILD_BRANCH r565_00
#endif
#ifndef NV_PUBLIC_BRANCH
#define NV_PUBLIC_BRANCH r565_97
#define NV_PUBLIC_BRANCH r565_00
#endif

#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r565/r565_97-152"
#define NV_BUILD_CHANGELIST_NUM (34971420)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r565/r565_00-213"
#define NV_BUILD_CHANGELIST_NUM (35186646)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "rel/gpu_drv/r565/r565_97-152"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (34971420)
#define NV_BUILD_NAME "rel/gpu_drv/r565/r565_00-213"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (35186646)

#else /* Windows builds */
#define NV_BUILD_BRANCH_VERSION "r565_97-1"
#define NV_BUILD_CHANGELIST_NUM (34971420)
#define NV_BUILD_BRANCH_VERSION "r565_00-169"
#define NV_BUILD_CHANGELIST_NUM (35186646)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "565.98"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (34971420)
#define NV_BUILD_NAME "566.31"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (35186646)
#define NV_BUILD_BRANCH_BASE_VERSION R565
#endif
// End buildmeister python edited section
Expand Down
2 changes: 1 addition & 1 deletion src/common/inc/nvUnixVersion.h
Original file line number Diff line number Diff line change
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 "565.57.01"
#define NV_VERSION_STRING "565.77"

#else

Expand Down
36 changes: 36 additions & 0 deletions src/common/nvswitch/kernel/ls10/link_ls10.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,42 @@ nvswitch_corelib_set_dl_link_mode_ls10

switch (mode)
{
case NVLINK_LINKSTATE_SAFE:
{
// check if link is in reset
if (nvswitch_is_link_in_reset(device, link))
{
NVSWITCH_PRINT(device, ERROR,
"%s: link #%d is still in reset, cannot change link state\n",
__FUNCTION__, link->linkNumber);
return NVL_ERR_INVALID_STATE;
}

NVSWITCH_PRINT(device, INFO,
"%s : Link state request to Safe for (%s):(%s) not needed. Skipping.\n",
__FUNCTION__, device->name, link->linkName);

break;
}

case NVLINK_LINKSTATE_HS:
{
// check if link is in reset
if (nvswitch_is_link_in_reset(device, link))
{
NVSWITCH_PRINT(device, ERROR,
"%s: link #%d is still in reset, cannot change link state\n",
__FUNCTION__, link->linkNumber);
return -NVL_ERR_INVALID_STATE;
}

NVSWITCH_PRINT(device, INFO,
"%s : Link state request to Active for (%s):(%s) not needed. Skipping.\n",
__FUNCTION__, device->name, link->linkName);

break;
}

case NVLINK_LINKSTATE_INITPHASE1:
{
// Apply appropriate SIMMODE settings
Expand Down
3 changes: 2 additions & 1 deletion src/common/sdk/nvidia/inc/class/cla084_notification.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ extern "C" {
#define NVA084_NOTIFIERS_EVENT_GUEST_DRIVER_UNLOADED (4)
#define NVA084_NOTIFIERS_EVENT_PRINT_ERROR_MESSAGE (5)
#define NVA084_NOTIFIERS_EVENT_GUEST_LICENSE_STATE_CHANGED (6)
#define NVA084_NOTIFIERS_MAXCOUNT (7)
#define NVA084_NOTIFIERS_EVENT_UPDATE_GUEST_OS_TYPE (7)
#define NVA084_NOTIFIERS_MAXCOUNT (8)

#define NVA084_NOTIFICATION_STATUS_IN_PROGRESS (0x8000)
#define NVA084_NOTIFICATION_STATUS_BAD_ARGUMENT (0x4000)
Expand Down
1 change: 1 addition & 0 deletions src/nvidia-modeset/include/nvkms-evo.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ void nvEvoHeadSetControlOR(NVDispEvoPtr pDispEvo,
void nvChooseDitheringEvo(
const NVConnectorEvoRec *pConnectorEvo,
enum NvKmsDpyAttributeColorBpcValue bpc,
enum NvKmsOutputColorimetry colorimetry,
const NVDpyAttributeRequestedDitheringConfig *pReqDithering,
NVDpyAttributeCurrentDitheringConfig *pCurrDithering);

Expand Down
1 change: 1 addition & 0 deletions src/nvidia-modeset/src/nvkms-attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ static void SetDitheringCommon(NVDpyEvoPtr pDpyEvo)

nvChooseDitheringEvo(pConnectorEvo,
pApiHeadState->attributes.color.bpc,
pApiHeadState->attributes.color.colorimetry,
&pDpyEvo->requestedDithering,
&pApiHeadState->attributes.dithering);

Expand Down
54 changes: 47 additions & 7 deletions src/nvidia-modeset/src/nvkms-evo.c
Original file line number Diff line number Diff line change
Expand Up @@ -2737,10 +2737,10 @@ void nvEnableMidFrameAndDWCFWatermark(NVDevEvoPtr pDevEvo,
static enum NvKmsDpyAttributeColorBpcValue GetMinRequiredBpc(
enum NvKmsOutputColorimetry colorimetry)
{
// 10 BPC required for HDR
// >= 8 BPC required for HDR
// XXX HDR TODO: Handle other colorimetries
return (colorimetry == NVKMS_OUTPUT_COLORIMETRY_BT2100) ?
NV_KMS_DPY_ATTRIBUTE_CURRENT_COLOR_BPC_10 :
NV_KMS_DPY_ATTRIBUTE_CURRENT_COLOR_BPC_8 :
NV_KMS_DPY_ATTRIBUTE_CURRENT_COLOR_BPC_6;
}

Expand Down Expand Up @@ -3155,6 +3155,7 @@ static const struct {
void nvChooseDitheringEvo(
const NVConnectorEvoRec *pConnectorEvo,
enum NvKmsDpyAttributeColorBpcValue bpc,
enum NvKmsOutputColorimetry colorimetry,
const NVDpyAttributeRequestedDitheringConfig *pReqDithering,
NVDpyAttributeCurrentDitheringConfig *pCurrDithering)
{
Expand Down Expand Up @@ -3261,6 +3262,29 @@ void nvChooseDitheringEvo(
}
}

// XXX HDR TODO: Handle other colorimetries
if ((colorimetry == NVKMS_OUTPUT_COLORIMETRY_BT2100) &&
(pReqDithering->state !=
NV_KMS_DPY_ATTRIBUTE_REQUESTED_DITHERING_DISABLED)) {

// GetMinRequiredBpc() enforces >= 8 BPC for HDR
nvAssert(bpc >= 8);

/*
* If output has BT.2100 (HDR10) colorimetry but fewer than 10 bits of
* precision, dither to 8 BPC, or as requested.
*/
if (bpc < 10) {
currDithering.enabled = TRUE;

if (pReqDithering->depth ==
NV_KMS_DPY_ATTRIBUTE_REQUESTED_DITHERING_DEPTH_AUTO) {
currDithering.depth =
NV_KMS_DPY_ATTRIBUTE_CURRENT_DITHERING_DEPTH_8_BITS;
}
}
}

if (currDithering.enabled) {
switch (pReqDithering->mode) {
case NV_KMS_DPY_ATTRIBUTE_REQUESTED_DITHERING_MODE_TEMPORAL:
Expand Down Expand Up @@ -6828,7 +6852,8 @@ static NvBool GetDfpHdmiProtocol(const NVDpyEvoRec *pDpyEvo,
nvDpyGetOutputColorFormatInfo(pDpyEvo);
const NvBool forceHdmiFrlIsSupported = FALSE;

nvAssert(rmProtocol == NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_A ||
nvAssert(rmProtocol == NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_DUAL_TMDS ||
rmProtocol == NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_A ||
rmProtocol == NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_B);

/* Override protocol if this mode requires HDMI FRL. */
Expand All @@ -6855,10 +6880,25 @@ static NvBool GetDfpHdmiProtocol(const NVDpyEvoRec *pDpyEvo,
if (nvHdmiGetEffectivePixelClockKHz(pDpyEvo, pTimings, pDpyColor) <=
pDpyEvo->maxSingleLinkPixelClockKHz) {

*pTimingsProtocol = (rmProtocol ==
NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_A) ?
NVKMS_PROTOCOL_SOR_SINGLE_TMDS_A :
NVKMS_PROTOCOL_SOR_SINGLE_TMDS_B;
switch (rmProtocol) {
case NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_DUAL_TMDS:
/*
* Force single link TMDS protocol. HDMI does not support
* physically support dual link TMDS.
*
* TMDS_A: "use A side of the link"
*/
*pTimingsProtocol = NVKMS_PROTOCOL_SOR_SINGLE_TMDS_A;
break;
case NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_A:
*pTimingsProtocol = NVKMS_PROTOCOL_SOR_SINGLE_TMDS_A;
break;
case NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_B:
*pTimingsProtocol = NVKMS_PROTOCOL_SOR_SINGLE_TMDS_B;
break;
default:
return FALSE;
}
return TRUE;
}
} while (nvDowngradeColorSpaceAndBpc(pDpyEvo,
Expand Down
1 change: 1 addition & 0 deletions src/nvidia-modeset/src/nvkms-modeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,7 @@ ValidateProposedModeSetHwStateOneDisp(

nvChooseDitheringEvo(pDpyEvo->pConnectorEvo,
pProposedApiHead->attributes.color.bpc,
pProposedApiHead->attributes.color.colorimetry,
&pDpyEvo->requestedDithering,
&pProposedApiHead->attributes.dithering);
}
Expand Down
Loading

0 comments on commit 9d0b041

Please sign in to comment.