mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-01-31 21:49:48 +00:00
560.28.03
This commit is contained in:
@@ -37,6 +37,7 @@ typedef enum _NVAModelConfig {
|
||||
NV_AMODEL_AMPERE,
|
||||
NV_AMODEL_ADA,
|
||||
NV_AMODEL_HOPPER,
|
||||
NV_AMODEL_BLACKWELL,
|
||||
} NVAModelConfig;
|
||||
|
||||
#endif /* __NV_AMODEL_ENUM_H__ */
|
||||
|
||||
@@ -362,6 +362,7 @@ enum Nv3dShaderArch {
|
||||
NV3D_SHADER_ARCH_TURING,
|
||||
NV3D_SHADER_ARCH_AMPERE,
|
||||
NV3D_SHADER_ARCH_HOPPER,
|
||||
NV3D_SHADER_ARCH_BLACKWELL,
|
||||
NV3D_SHADER_ARCH_COUNT,
|
||||
};
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "nvidia-push-init.h" // nvPushGetSupportedClassIndex()
|
||||
#include "nvidia-push-utils.h" // nvPushIsAmodel()
|
||||
|
||||
#include <class/clcd97.h> // BLACKWELL_A
|
||||
#include <class/clcb97.h> // HOPPER_A
|
||||
#include <class/clc997.h> // ADA_A
|
||||
#include <class/clc797.h> // AMPERE_B
|
||||
@@ -58,6 +59,7 @@
|
||||
#include "g_turing_shader_info.h"
|
||||
#include "g_ampere_shader_info.h"
|
||||
#include "g_hopper_shader_info.h"
|
||||
#include "g_blackwell_shader_info.h"
|
||||
|
||||
#define _NV3D_CHANNEL_PROGRAMS_ENTRY(_archLower, _archCamel, _archUpper) \
|
||||
[NV3D_SHADER_ARCH_ ## _archUpper ] = { \
|
||||
@@ -92,6 +94,7 @@ static Nv3dChannelProgramsRec PickProgramsRec(
|
||||
_NV3D_CHANNEL_PROGRAMS_ENTRY(turing, Turing, TURING),
|
||||
_NV3D_CHANNEL_PROGRAMS_ENTRY(ampere, Ampere, AMPERE),
|
||||
_NV3D_CHANNEL_PROGRAMS_ENTRY(hopper, Hopper, HOPPER),
|
||||
_NV3D_CHANNEL_PROGRAMS_ENTRY(blackwell, Blackwell, BLACKWELL),
|
||||
};
|
||||
|
||||
return programsTable[p3dDevice->shaderArch];
|
||||
@@ -197,6 +200,7 @@ static NvU32 GetSmVersion(
|
||||
[NV_AMODEL_AMPERE] = NV2080_CTRL_GR_INFO_SM_VERSION_8_2,
|
||||
[NV_AMODEL_ADA] = NV2080_CTRL_GR_INFO_SM_VERSION_8_9,
|
||||
[NV_AMODEL_HOPPER] = NV2080_CTRL_GR_INFO_SM_VERSION_9_0,
|
||||
[NV_AMODEL_BLACKWELL] = NV2080_CTRL_GR_INFO_SM_VERSION_10_0,
|
||||
};
|
||||
|
||||
if (pPushDevice->amodelConfig >= ARRAY_LEN(table)) {
|
||||
@@ -292,6 +296,9 @@ static NvBool GetSpaVersion(
|
||||
/* Hopper */
|
||||
{ NV2080_CTRL_GR_INFO_SM_VERSION_9_0, { 9,0 } },
|
||||
|
||||
/* Blackwell */
|
||||
{ NV2080_CTRL_GR_INFO_SM_VERSION_10_0, { 10,0 } },
|
||||
{ NV2080_CTRL_GR_INFO_SM_VERSION_10_1, { 10,1 } },
|
||||
};
|
||||
|
||||
const NvU32 smVersion = GetSmVersion(pPushDevice);
|
||||
@@ -399,6 +406,7 @@ NvBool nv3dAllocDevice(
|
||||
* classNumber | | | | | |
|
||||
* | | | | | | |
|
||||
*/
|
||||
ENTRY(BLACKWELL_A,BLACKWELL, BLACKWELL, 0, 0, 32768, Hopper),
|
||||
ENTRY(HOPPER_A, HOPPER, HOPPER, 0, 0, 32768, Hopper),
|
||||
ENTRY(ADA_A, AMPERE, ADA, 0, 0, 32768, Ampere),
|
||||
ENTRY(AMPERE_B, AMPERE, AMPERE, 0, 0, 32768, Ampere),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
@@ -108,6 +108,7 @@ typedef struct _NvPushDeviceRec {
|
||||
|
||||
NvBool hostLBoverflowBug1667921 : 1;
|
||||
NvBool clientSli : 1; /* Provided by the host driver */
|
||||
NvBool hasFb : 1; /* Computed from supportedClasses[] */
|
||||
|
||||
NvU32 clientHandle; /* Provided by the host driver */
|
||||
NvU32 numSubDevices; /* Provided by the host driver */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "class/cl50a0.h" // NV50_MEMORY_VIRTUAL
|
||||
#include "class/clc56f.h" // AMPERE_CHANNEL_GPFIFO_A
|
||||
#include "class/clc86f.h" // HOPPER_CHANNEL_GPFIFO_A
|
||||
#include "class/clc96f.h" // BLACKWELL_CHANNEL_GPFIFO_A
|
||||
#include "class/clc361.h" // VOLTA_USERMODE_A
|
||||
#include "class/clc661.h" // HOPPER_USERMODE_A
|
||||
|
||||
@@ -498,6 +499,7 @@ static NvBool nvDmaAllocUserD(
|
||||
{
|
||||
NvPushDevicePtr pDevice = p->pDevice;
|
||||
int deviceIndex;
|
||||
NvBool bHasFB = pDevice->hasFb;
|
||||
|
||||
if (!pDevice->hal.caps.clientAllocatesUserD) {
|
||||
return TRUE;
|
||||
@@ -507,15 +509,28 @@ static NvBool nvDmaAllocUserD(
|
||||
deviceIndex < __nvPushGetNumDevices(pDevice);
|
||||
deviceIndex++) {
|
||||
NV_MEMORY_ALLOCATION_PARAMS memAllocParams = { 0 };
|
||||
const NvU32 attr =
|
||||
DRF_DEF(OS32, _ATTR, _LOCATION, _VIDMEM) |
|
||||
DRF_DEF(OS32, _ATTR, _PAGE_SIZE, _4KB) |
|
||||
DRF_DEF(OS32, _ATTR, _COHERENCY, _UNCACHED);
|
||||
const NvU32 flags =
|
||||
NVOS32_ALLOC_FLAGS_ALIGNMENT_FORCE |
|
||||
NVOS32_ALLOC_FLAGS_PERSISTENT_VIDMEM;
|
||||
NvU32 ret;
|
||||
|
||||
/* For GPUs which do not have framebuffer memory, use allocation from
|
||||
* system memory instead.
|
||||
*/
|
||||
const NvU32 hClass = bHasFB ? NV01_MEMORY_LOCAL_USER : NV01_MEMORY_SYSTEM;
|
||||
const NvU32 attr =
|
||||
bHasFB ?
|
||||
DRF_DEF(OS32, _ATTR, _LOCATION, _VIDMEM) |
|
||||
DRF_DEF(OS32, _ATTR, _PAGE_SIZE, _4KB) |
|
||||
DRF_DEF(OS32, _ATTR, _COHERENCY, _UNCACHED)
|
||||
:
|
||||
DRF_DEF(OS32, _ATTR, _LOCATION, _PCI) |
|
||||
DRF_DEF(OS32, _ATTR, _PAGE_SIZE, _4KB) |
|
||||
DRF_DEF(OS32, _ATTR, _COHERENCY, _UNCACHED);
|
||||
const NvU32 flags =
|
||||
bHasFB ?
|
||||
NVOS32_ALLOC_FLAGS_ALIGNMENT_FORCE |
|
||||
NVOS32_ALLOC_FLAGS_PERSISTENT_VIDMEM
|
||||
:
|
||||
NVOS32_ALLOC_FLAGS_ALIGNMENT_FORCE;
|
||||
|
||||
NvU32 hMemory = GetChannelHandle(pParams, pUsedHandleBitmask);
|
||||
|
||||
memAllocParams.owner = pDevice->clientHandle;
|
||||
@@ -528,7 +543,7 @@ static NvBool nvDmaAllocUserD(
|
||||
ret = nvPushImportRmApiAlloc(pDevice,
|
||||
pDevice->subDevice[deviceIndex].deviceHandle,
|
||||
hMemory,
|
||||
NV01_MEMORY_LOCAL_USER,
|
||||
hClass,
|
||||
&memAllocParams);
|
||||
if (ret != NV_OK) {
|
||||
return FALSE;
|
||||
@@ -540,13 +555,26 @@ static NvBool nvDmaAllocUserD(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static NvBool IsClassSupported(
|
||||
const NvPushDeviceRec *pDevice,
|
||||
NvU32 classNumber)
|
||||
{
|
||||
unsigned int j;
|
||||
for (j = 0; j < pDevice->numClasses; j++) {
|
||||
if (classNumber == pDevice->supportedClasses[j]) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int nvPushGetSupportedClassIndex(
|
||||
NvPushDevicePtr pDevice,
|
||||
const void *pClassTable,
|
||||
size_t classTableStride,
|
||||
size_t classTableLength)
|
||||
{
|
||||
unsigned int i, j;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < classTableLength; i++) {
|
||||
|
||||
@@ -562,10 +590,8 @@ int nvPushGetSupportedClassIndex(
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j < pDevice->numClasses; j++) {
|
||||
if (pClass->classNumber == pDevice->supportedClasses[j]) {
|
||||
return i;
|
||||
}
|
||||
if (IsClassSupported(pDevice, pClass->classNumber)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
@@ -579,6 +605,11 @@ static NvBool GetChannelClassAndUserDSize(
|
||||
NvPushSupportedClass base;
|
||||
size_t gpFifoSize;
|
||||
} gpFifoDmaClasses[] = {
|
||||
{
|
||||
{ BLACKWELL_CHANNEL_GPFIFO_A,
|
||||
NV_AMODEL_BLACKWELL },
|
||||
sizeof(BlackwellAControlGPFifo)
|
||||
},
|
||||
{
|
||||
{ HOPPER_CHANNEL_GPFIFO_A,
|
||||
NV_AMODEL_HOPPER },
|
||||
@@ -1485,6 +1516,8 @@ NvBool nvPushAllocDevice(
|
||||
pDevice->numClasses = pParams->numClasses;
|
||||
pDevice->supportedClasses = pParams->supportedClasses;
|
||||
|
||||
pDevice->hasFb = IsClassSupported(pDevice, NV01_MEMORY_LOCAL_USER);
|
||||
|
||||
pDevice->confidentialComputeMode = pParams->confidentialComputeMode;
|
||||
|
||||
for (sd = 0; sd < pParams->numSubDevices; sd++) {
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "class/clc56f.h" // AMPERE_CHANNEL_GPFIFO_A
|
||||
#include "class/clc86f.h" // HOPPER_CHANNEL_GPFIFO_A
|
||||
#include "class/clc361.h" // VOLTA_USERMODE_A
|
||||
#include "class/clc96f.h" // BLACKWELL_CHANNEL_GPFIFO_A
|
||||
#include "ctrl/ctrl906f.h" // NV906F_CTRL_GET_CLASS_ENGINEID
|
||||
|
||||
/*
|
||||
@@ -1097,6 +1098,9 @@ NvBool __nvPushGetHal(
|
||||
NvPushHal *pHal)
|
||||
{
|
||||
switch (channelClass) {
|
||||
case BLACKWELL_CHANNEL_GPFIFO_A:
|
||||
// backwards compatible with Hopper
|
||||
// fall through
|
||||
case HOPPER_CHANNEL_GPFIFO_A:
|
||||
pHal->caps.extendedBase = TRUE;
|
||||
// otherwise backwards compatible with the Volta DMA HAL
|
||||
|
||||
Reference in New Issue
Block a user