mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-03-02 11:49:55 +00:00
515.43.04
This commit is contained in:
55
src/nvidia/inc/kernel/gpu/gsp/gsp_init_args.h
Normal file
55
src/nvidia/inc/kernel/gpu/gsp/gsp_init_args.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef GSP_INIT_ARGS_H
|
||||
#define GSP_INIT_ARGS_H
|
||||
|
||||
#include "core/core.h"
|
||||
|
||||
typedef struct {
|
||||
RmPhysAddr cmdQueuePhysAddr;
|
||||
} GSP_RMFS_INIT_ARGUMENTS;
|
||||
|
||||
typedef struct {
|
||||
RmPhysAddr sharedMemPhysAddr;
|
||||
NvU32 pageTableEntryCount;
|
||||
NvLength cmdQueueOffset;
|
||||
NvLength statQueueOffset;
|
||||
} MESSAGE_QUEUE_INIT_ARGUMENTS;
|
||||
|
||||
typedef struct {
|
||||
NvU32 oldLevel;
|
||||
NvU32 flags;
|
||||
NvBool bInPMTransition;
|
||||
} GSP_SR_INIT_ARGUMENTS;
|
||||
|
||||
/*!
|
||||
* (Cached) GSP fw RM initialization arguments.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
MESSAGE_QUEUE_INIT_ARGUMENTS messageQueueInitArguments;
|
||||
GSP_SR_INIT_ARGUMENTS srInitArguments;
|
||||
} GSP_ARGUMENTS_CACHED;
|
||||
|
||||
#endif // GSP_INIT_ARGS_H
|
||||
145
src/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h
Normal file
145
src/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef GSP_STATIC_CONFIG_H
|
||||
#define GSP_STATIC_CONFIG_H
|
||||
|
||||
//
|
||||
// This header describes the set of static GPU configuration information
|
||||
// that is collected during GSP RM init and made available to the
|
||||
// CPU RM (aka GSP client) via the NV_RM_RPC_GET_STATIC_INFO() and
|
||||
// NV_RM_RPC_GET_GSP_STATIC_INFO() calls.
|
||||
|
||||
#include "ctrl/ctrl0080/ctrl0080gpu.h"
|
||||
#include "ctrl/ctrl0080/ctrl0080gr.h"
|
||||
#include "ctrl/ctrl2080/ctrl2080bios.h"
|
||||
#include "ctrl/ctrl2080/ctrl2080fb.h"
|
||||
#include "ctrl/ctrl2080/ctrl2080gpu.h"
|
||||
|
||||
#include "gpu/gpu.h" // COMPUTE_BRANDING_TYPE
|
||||
#include "vgpu/rpc_headers.h" // MAX_GPC_COUNT
|
||||
#include "platform/chipset/chipset.h" // BUSINFO
|
||||
|
||||
typedef struct GspSMInfo_t
|
||||
{
|
||||
NvU32 version;
|
||||
NvU32 regBankCount;
|
||||
NvU32 regBankRegCount;
|
||||
NvU32 maxWarpsPerSM;
|
||||
NvU32 maxThreadsPerWarp;
|
||||
NvU32 geomGsObufEntries;
|
||||
NvU32 geomXbufEntries;
|
||||
NvU32 maxSPPerSM;
|
||||
NvU32 rtCoreCount;
|
||||
} GspSMInfo;
|
||||
|
||||
// Fetched from GSP-RM into CPU-RM
|
||||
typedef struct GspStaticConfigInfo_t
|
||||
{
|
||||
NvU8 grCapsBits[NV0080_CTRL_GR_CAPS_TBL_SIZE];
|
||||
NV2080_CTRL_GPU_GET_GID_INFO_PARAMS gidInfo;
|
||||
NV2080_CTRL_GPU_GET_FERMI_GPC_INFO_PARAMS gpcInfo;
|
||||
NV2080_CTRL_GPU_GET_FERMI_TPC_INFO_PARAMS tpcInfo[MAX_GPC_COUNT];
|
||||
NV2080_CTRL_GPU_GET_FERMI_ZCULL_INFO_PARAMS zcullInfo[MAX_GPC_COUNT];
|
||||
NV2080_CTRL_BIOS_GET_SKU_INFO_PARAMS SKUInfo;
|
||||
NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS fbRegionInfoParams;
|
||||
COMPUTE_BRANDING_TYPE computeBranding;
|
||||
|
||||
NV0080_CTRL_GPU_GET_SRIOV_CAPS_PARAMS sriovCaps;
|
||||
NvU32 sriovMaxGfid;
|
||||
|
||||
NvU64 engineCaps;
|
||||
|
||||
GspSMInfo SM_info;
|
||||
|
||||
NvBool poisonFuseEnabled;
|
||||
|
||||
NvU64 fb_length;
|
||||
NvU32 fbio_mask;
|
||||
NvU32 fb_bus_width;
|
||||
NvU32 fb_ram_type;
|
||||
NvU32 fbp_mask;
|
||||
NvU32 l2_cache_size;
|
||||
|
||||
NvU32 gfxpBufferSize[NV2080_CTRL_CMD_GR_CTXSW_PREEMPTION_BIND_BUFFERS_CONTEXT_POOL];
|
||||
NvU32 gfxpBufferAlignment[NV2080_CTRL_CMD_GR_CTXSW_PREEMPTION_BIND_BUFFERS_CONTEXT_POOL];
|
||||
|
||||
NvU8 gpuNameString[NV2080_GPU_MAX_NAME_STRING_LENGTH];
|
||||
NvU8 gpuShortNameString[NV2080_GPU_MAX_NAME_STRING_LENGTH];
|
||||
NvU16 gpuNameString_Unicode[NV2080_GPU_MAX_NAME_STRING_LENGTH];
|
||||
NvBool bGpuInternalSku;
|
||||
NvBool bIsQuadroGeneric;
|
||||
NvBool bIsQuadroAd;
|
||||
NvBool bIsNvidiaNvs;
|
||||
NvBool bIsVgx;
|
||||
NvBool bGeforceSmb;
|
||||
NvBool bIsTitan;
|
||||
NvBool bIsTesla;
|
||||
|
||||
NvU64 bar1PdeBase;
|
||||
NvU64 bar2PdeBase;
|
||||
|
||||
NvBool bVbiosValid;
|
||||
NvU32 vbiosSubVendor;
|
||||
NvU32 vbiosSubDevice;
|
||||
|
||||
NvBool bPageRetirementSupported;
|
||||
|
||||
NvBool bSplitVasBetweenServerClientRm;
|
||||
|
||||
NvBool bClRootportNeedsNosnoopWAR;
|
||||
|
||||
VIRTUAL_DISPLAY_GET_NUM_HEADS_PARAMS displaylessMaxHeads;
|
||||
VIRTUAL_DISPLAY_GET_MAX_RESOLUTION_PARAMS displaylessMaxResolution;
|
||||
NvU64 displaylessMaxPixels;
|
||||
|
||||
// Client handle for internal RMAPI control.
|
||||
NvHandle hInternalClient;
|
||||
|
||||
// Device handle for internal RMAPI control.
|
||||
NvHandle hInternalDevice;
|
||||
|
||||
// Subdevice handle for internal RMAPI control.
|
||||
NvHandle hInternalSubdevice;
|
||||
} GspStaticConfigInfo;
|
||||
|
||||
// Pushed from CPU-RM to GSP-RM
|
||||
typedef struct GspSystemInfo
|
||||
{
|
||||
NvU64 gpuPhysAddr;
|
||||
NvU64 gpuPhysFbAddr;
|
||||
NvU64 gpuPhysInstAddr;
|
||||
NvU64 nvDomainBusDeviceFunc;
|
||||
NvU64 simAccessBufPhysAddr;
|
||||
NvU64 pcieAtomicsOpMask;
|
||||
NvU64 consoleMemSize;
|
||||
NvU32 pciConfigMirrorBase;
|
||||
NvU32 pciConfigMirrorSize;
|
||||
NvU8 oorArch;
|
||||
NvU64 clPdbProperties;
|
||||
NvU32 Chipset;
|
||||
BUSINFO FHBBusInfo;
|
||||
} GspSystemInfo;
|
||||
|
||||
|
||||
#endif /* GSP_STATIC_CONFIG_H */
|
||||
3
src/nvidia/inc/kernel/gpu/gsp/kernel_gsp.h
Normal file
3
src/nvidia/inc/kernel/gpu/gsp/kernel_gsp.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
#include "g_kernel_gsp_nvoc.h"
|
||||
|
||||
39
src/nvidia/inc/kernel/gpu/gsp/message_queue.h
Normal file
39
src/nvidia/inc/kernel/gpu/gsp/message_queue.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* GSP MESSAGE QUEUE
|
||||
*/
|
||||
|
||||
#ifndef _MESSAGE_QUEUE_H_
|
||||
#define _MESSAGE_QUEUE_H_
|
||||
|
||||
typedef struct _message_queue_info MESSAGE_QUEUE_INFO;
|
||||
|
||||
// CPU-side calls
|
||||
NV_STATUS GspMsgQueueInit(OBJGPU *pGpu, MESSAGE_QUEUE_INFO **ppMQI);
|
||||
NV_STATUS GspStatusQueueInit(OBJGPU *pGpu, MESSAGE_QUEUE_INFO **ppMQI);
|
||||
void GspMsgQueueCleanup(MESSAGE_QUEUE_INFO **ppMQI);
|
||||
NV_STATUS GspMsgQueueSendCommand(MESSAGE_QUEUE_INFO *pMQI, OBJGPU *pGpu);
|
||||
NV_STATUS GspMsgQueueReceiveStatus(MESSAGE_QUEUE_INFO *pMQI);
|
||||
|
||||
#endif // _MESSAGE_QUEUE_H_
|
||||
95
src/nvidia/inc/kernel/gpu/gsp/message_queue_priv.h
Normal file
95
src/nvidia/inc/kernel/gpu/gsp/message_queue_priv.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* GSP MESSAGE QUEUE
|
||||
*/
|
||||
|
||||
#ifndef _MESSAGE_QUEUE_PRIV_H_
|
||||
#define _MESSAGE_QUEUE_PRIV_H_
|
||||
|
||||
#include "msgq/msgq.h"
|
||||
#include "gpu/mem_mgr/virt_mem_allocator_common.h"
|
||||
|
||||
// Shared memory layout.
|
||||
//
|
||||
// Each of the following are page aligned:
|
||||
// Page table for entire shared memory layout.
|
||||
// Command queue header
|
||||
// Command queue entries
|
||||
// Status queue header
|
||||
// Status queue entries
|
||||
|
||||
typedef struct GSP_MSG_QUEUE_ELEMENT
|
||||
{
|
||||
NvU32 checkSum; // Set to value needed to make checksum always zero.
|
||||
NvU32 seqNum; // Sequence number maintained by the message queue.
|
||||
rpc_message_header_v rpc;
|
||||
} GSP_MSG_QUEUE_ELEMENT;
|
||||
|
||||
typedef struct _message_queue_info
|
||||
{
|
||||
// Parameters
|
||||
NvLength pageTableEntryCount;
|
||||
NvLength pageTableSize;
|
||||
NvLength commandQueueSize;
|
||||
NvLength statusQueueSize;
|
||||
|
||||
// Shared memory area.
|
||||
MEMORY_DESCRIPTOR *pSharedMemDesc;
|
||||
RmPhysAddr sharedMemPA; // Page table for all of shared mem.
|
||||
void *pCommandQueue;
|
||||
void *pStatusQueue;
|
||||
rpc_message_header_v *pRpcMsgBuf; // RPC message buffer VA.
|
||||
|
||||
void *pInitMsgBuf; // RPC message buffer VA.
|
||||
RmPhysAddr initMsgBufPA; // RPC message buffer PA.
|
||||
|
||||
// Other CPU-side fields
|
||||
void *pWorkArea;
|
||||
GSP_MSG_QUEUE_ELEMENT *pCmdQueueElement; // Working copy of command queue element.
|
||||
void *pMetaData;
|
||||
msgqHandle hQueue; // Do not allow requests when hQueue is null.
|
||||
NvU32 txSeqNum; // Next sequence number for tx.
|
||||
NvU32 rxSeqNum; // Next sequence number for rx.
|
||||
} MESSAGE_QUEUE_INFO;
|
||||
|
||||
//
|
||||
// Most of the following defines resolve to compile-time constants.
|
||||
//
|
||||
#define GSP_MSG_QUEUE_ELEMENT_SIZE_MIN RM_PAGE_SIZE
|
||||
#define GSP_MSG_QUEUE_ELEMENT_SIZE_MAX (GSP_MSG_QUEUE_ELEMENT_SIZE_MIN * 16)
|
||||
#define GSP_MSG_QUEUE_ELEMENT_HDR_SIZE NV_OFFSETOF(GSP_MSG_QUEUE_ELEMENT, rpc)
|
||||
|
||||
#define GSP_MSG_QUEUE_RPC_SIZE_MAX \
|
||||
(GSP_MSG_QUEUE_ELEMENT_SIZE_MAX - GSP_MSG_QUEUE_ELEMENT_HDR_SIZE)
|
||||
|
||||
#define GSP_MSG_QUEUE_BYTES_TO_ELEMENTS(b) \
|
||||
NV_DIV_AND_CEIL(b, GSP_MSG_QUEUE_ELEMENT_SIZE_MIN)
|
||||
|
||||
#define GSP_MSG_QUEUE_ALIGN RM_PAGE_SHIFT // 2 ^ 12 = 4096
|
||||
#define GSP_MSG_QUEUE_ELEMENT_ALIGN RM_PAGE_SHIFT // 2 ^ 12 = 4096
|
||||
#define GSP_MSG_QUEUE_HEADER_SIZE RM_PAGE_SIZE
|
||||
#define GSP_MSG_QUEUE_HEADER_ALIGN 4 // 2 ^ 4 = 16
|
||||
|
||||
#endif // _MESSAGE_QUEUE_PRIV_H_
|
||||
Reference in New Issue
Block a user