515.43.04

This commit is contained in:
Andy Ritger
2022-05-09 13:18:59 -07:00
commit 1739a20efc
2519 changed files with 1060036 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2005-2015 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.
*/
#pragma once
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000base.finn
//
#include "ctrl/ctrlxxxx.h"
/* NV01_ROOT (client) control commands and parameters */
#define NV0000_CTRL_CMD(cat,idx) NVXXXX_CTRL_CMD(0x0000,NV0000_CTRL_##cat,idx)
/* Client command categories (6bits) */
#define NV0000_CTRL_RESERVED (0x00)
#define NV0000_CTRL_SYSTEM (0x01)
#define NV0000_CTRL_GPU (0x02)
#define NV0000_CTRL_GSYNC (0x03)
#define NV0000_CTRL_DIAG (0x04)
#define NV0000_CTRL_EVENT (0x05)
#define NV0000_CTRL_NVD (0x06)
#define NV0000_CTRL_SWINSTR (0x07)
#define NV0000_CTRL_GSPC (0x08)
#define NV0000_CTRL_PROC (0x09)
#define NV0000_CTRL_SYNC_GPU_BOOST (0x0A)
#define NV0000_CTRL_GPUACCT (0x0B)
#define NV0000_CTRL_VGPU (0x0C)
#define NV0000_CTRL_CLIENT (0x0D)
// per-OS categories start at highest category and work backwards
#define NV0000_CTRL_OS_WINDOWS (0x3F)
#define NV0000_CTRL_OS_MACOS (0x3E)
#define NV0000_CTRL_OS_UNIX (0x3D)
/*
* NV0000_CTRL_CMD_NULL
*
* This command does nothing.
* This command does not take any parameters.
*
* Possible status values returned are:
* NV_OK
*/
#define NV0000_CTRL_CMD_NULL (0x0) /* finn: Evaluated from "(FINN_NV01_ROOT_RESERVED_INTERFACE_ID << 8) | 0x0" */
/* _ctrl0000_base_h_ */

View File

@@ -0,0 +1,167 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2006-2021 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000client.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "ctrl/ctrlxxxx.h"
#include "class/cl0000.h"
#include "rs_access.h"
/*
* NV0000_CTRL_CMD_CLIENT_GET_ADDR_SPACE_TYPE
*
* This command may be used to query memory address space type associated with an object
*
* Parameters:
* hObject[IN]
* handle of the object to look up
* addrSpaceType[OUT]
* addrSpaceType with associated memory descriptor
*
* Possible status values are:
* NV_OK
* NV_ERR_INVALID_OBJECT_HANDLE
* NV_ERR_INVALID_OBJECT
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_NOT_SUPPORTED
*/
#define NV0000_CTRL_CMD_CLIENT_GET_ADDR_SPACE_TYPE (0xd01) /* finn: Evaluated from "(FINN_NV01_ROOT_CLIENT_INTERFACE_ID << 8) | NV0000_CTRL_CLIENT_GET_ADDR_SPACE_TYPE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_CLIENT_GET_ADDR_SPACE_TYPE_PARAMS_MESSAGE_ID (0x1U)
typedef struct NV0000_CTRL_CLIENT_GET_ADDR_SPACE_TYPE_PARAMS {
NvHandle hObject; /* [in] - Handle of object to look up */
NvU32 mapFlags; /* [in] - Flags that will be used when mapping the object */
NvU32 addrSpaceType; /* [out] - Memory Address Space Type */
} NV0000_CTRL_CLIENT_GET_ADDR_SPACE_TYPE_PARAMS;
#define NV0000_CTRL_CMD_CLIENT_GET_ADDR_SPACE_TYPE_INVALID 0x00000000
#define NV0000_CTRL_CMD_CLIENT_GET_ADDR_SPACE_TYPE_SYSMEM 0x00000001
#define NV0000_CTRL_CMD_CLIENT_GET_ADDR_SPACE_TYPE_VIDMEM 0x00000002
#define NV0000_CTRL_CMD_CLIENT_GET_ADDR_SPACE_TYPE_REGMEM 0x00000003
#define NV0000_CTRL_CMD_CLIENT_GET_ADDR_SPACE_TYPE_FABRIC 0x00000004
/*
* NV0000_CTRL_CMD_CLIENT_GET_HANDLE_INFO
*
* This command may be used to query information on a handle
*/
#define NV0000_CTRL_CMD_CLIENT_GET_HANDLE_INFO (0xd02) /* finn: Evaluated from "(FINN_NV01_ROOT_CLIENT_INTERFACE_ID << 8) | NV0000_CTRL_CLIENT_GET_HANDLE_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_CLIENT_GET_HANDLE_INFO_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_CTRL_CLIENT_GET_HANDLE_INFO_PARAMS {
NvHandle hObject; /* [in] - Handle of object to look up */
NvU32 index; /* [in] - Type of lookup */
union {
NvHandle hResult; /* [out] - Result of lookup when result is a handle type */
NV_DECLARE_ALIGNED(NvU64 iResult, 8); /* [out] - Result of lookup when result is a integer */
} data;
} NV0000_CTRL_CLIENT_GET_HANDLE_INFO_PARAMS;
#define NV0000_CTRL_CMD_CLIENT_GET_HANDLE_INFO_INDEX_INVALID 0x00000000
#define NV0000_CTRL_CMD_CLIENT_GET_HANDLE_INFO_INDEX_PARENT 0x00000001
#define NV0000_CTRL_CMD_CLIENT_GET_HANDLE_INFO_INDEX_CLASSID 0x00000002
/*
* NV0000_CTRL_CMD_CLIENT_GET_ACCESS_RIGHTS
*
* This command may be used to get this client's access rights for an object
* The object to which access rights are checked does not have to be owned by
* the client calling the command, it is owned by the hClient parameter
*/
#define NV0000_CTRL_CMD_CLIENT_GET_ACCESS_RIGHTS (0xd03) /* finn: Evaluated from "(FINN_NV01_ROOT_CLIENT_INTERFACE_ID << 8) | NV0000_CTRL_CLIENT_GET_ACCESS_RIGHTS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_CLIENT_GET_ACCESS_RIGHTS_PARAMS_MESSAGE_ID (0x3U)
typedef struct NV0000_CTRL_CLIENT_GET_ACCESS_RIGHTS_PARAMS {
NvHandle hObject; /* [in] - Handle of object to look up */
NvHandle hClient; /* [in] - Handle of client which owns hObject */
RS_ACCESS_MASK maskResult; /* [out] - Result of lookup */
} NV0000_CTRL_CLIENT_GET_ACCESS_RIGHTS_PARAMS;
/*
* NV0000_CTRL_CMD_CLIENT_SET_INHERITED_SHARE_POLICY
*
* DEPRECATED: Calls NV0000_CTRL_CMD_CLIENT_SHARE_OBJECT with hObject=hClient
*
* This command will modify a client's inherited share policy list
* The policy is applied in the same way that NvRmShare applies policies,
* except to the client's inherited policy list instead of an object's policy list
*/
#define NV0000_CTRL_CMD_CLIENT_SET_INHERITED_SHARE_POLICY (0xd04) /* finn: Evaluated from "(FINN_NV01_ROOT_CLIENT_INTERFACE_ID << 8) | NV0000_CTRL_CLIENT_SET_INHERITED_SHARE_POLICY_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_CLIENT_SET_INHERITED_SHARE_POLICY_PARAMS_MESSAGE_ID (0x4U)
typedef struct NV0000_CTRL_CLIENT_SET_INHERITED_SHARE_POLICY_PARAMS {
RS_SHARE_POLICY sharePolicy; /* [in] - Share Policy to apply */
} NV0000_CTRL_CLIENT_SET_INHERITED_SHARE_POLICY_PARAMS;
/*
* NV0000_CTRL_CMD_CLIENT_GET_CHILD_HANDLE
*
* This command may be used to get a handle of a child of a given type
*/
#define NV0000_CTRL_CMD_CLIENT_GET_CHILD_HANDLE (0xd05) /* finn: Evaluated from "(FINN_NV01_ROOT_CLIENT_INTERFACE_ID << 8) | NV0000_CTRL_CMD_CLIENT_GET_CHILD_HANDLE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_CMD_CLIENT_GET_CHILD_HANDLE_PARAMS_MESSAGE_ID (0x5U)
typedef struct NV0000_CTRL_CMD_CLIENT_GET_CHILD_HANDLE_PARAMS {
NvHandle hParent; /* [in] - Handle of parent object */
NvU32 classId; /* [in] - Class ID of the child object */
NvHandle hObject; /* [out] - Handle of the child object (0 if not found) */
} NV0000_CTRL_CMD_CLIENT_GET_CHILD_HANDLE_PARAMS;
/*
* NV0000_CTRL_CMD_CLIENT_SHARE_OBJECT
*
* This command is meant to imitate the NvRmShare API.
* Applies a share policy to an object, which should be owned by the caller's client.
* The policy is applied in the same way that NvRmShare applies policies.
*
* This ctrl command is only meant to be used in older branches. For releases after R450,
* use NvRmShare directly instead.
*/
#define NV0000_CTRL_CMD_CLIENT_SHARE_OBJECT (0xd06) /* finn: Evaluated from "(FINN_NV01_ROOT_CLIENT_INTERFACE_ID << 8) | NV0000_CTRL_CLIENT_SHARE_OBJECT_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_CLIENT_SHARE_OBJECT_PARAMS_MESSAGE_ID (0x6U)
typedef struct NV0000_CTRL_CLIENT_SHARE_OBJECT_PARAMS {
NvHandle hObject; /* [in] - Handle of object to share */
RS_SHARE_POLICY sharePolicy; /* [in] - Share Policy to apply */
} NV0000_CTRL_CLIENT_SHARE_OBJECT_PARAMS;
/* _ctrl0000client_h_ */

View File

@@ -0,0 +1,329 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2005-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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000diag.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "ctrl/ctrlxxxx.h"
/* NV01_ROOT (client) system control commands and parameters */
/*
* NV0000_CTRL_CMD_DIAG_GET_LOCK_METER_STATE
*
* This command returns the current lock meter logging state.
*
* state
* This parameter returns the current lock meter logging state.
* NV0000_CTRL_DIAG_GET_LOCK_METER_STATE_DISABLED
* This value indicates lock metering is disabled.
* NV0000_CTRL_DIAG_GET_LOCK_METER_STATE_ENABLED
* This value indicates lock metering is enabled.
* count
* This parameter returns the total number of lock metering entries
* (NV0000_CTRL_DIAG_LOCK_METER_ENTRY) available. This value will
* not exceed NV0000_CTRL_DIAG_LOCK_METER_MAX_ENTRIES. When lock metering
* is enabled this parameter will return zero.
* missedCount
* This parameter returns the number of lock metering entries that had
* to be discarded due to a full lock metering table. This value will
* not exceed NV0000_CTRL_DIAG_LOCK_METER_MAX_TABLE_ENTRIES. When lock
* metering is enabled this parameter will return zero.
* bCircularBuffer
* This parameter returns type of buffer.
* TRUE
* Buffer is circular
* FALSE
* Buffer is sequential
*
* Possible status values returned are:
* NV_OK
*/
#define NV0000_CTRL_CMD_DIAG_GET_LOCK_METER_STATE (0x480) /* finn: Evaluated from "(FINN_NV01_ROOT_DIAG_INTERFACE_ID << 8) | NV0000_CTRL_DIAG_GET_LOCK_METER_STATE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_DIAG_GET_LOCK_METER_STATE_PARAMS_MESSAGE_ID (0x80U)
typedef struct NV0000_CTRL_DIAG_GET_LOCK_METER_STATE_PARAMS {
NvU32 state;
NvU32 count;
NvU32 missedCount;
NvBool bCircularBuffer;
} NV0000_CTRL_DIAG_GET_LOCK_METER_STATE_PARAMS;
/* valid lock metering state values */
#define NV0000_CTRL_DIAG_GET_LOCK_METER_STATE_DISABLED (0x00000000)
#define NV0000_CTRL_DIAG_GET_LOCK_METER_STATE_ENABLED (0x00000001)
/* maximum possible number of lock metering entries stored internally */
#define NV0000_CTRL_DIAG_LOCK_METER_MAX_TABLE_ENTRIES (0x20000)
/*
* NV0000_CTRL_CMD_DIAG_SET_LOCK_METER_STATE
*
* This command sets the current lock meter logging state.
*
* state
* This parameter specifies the new state of the lock metering mechanism.
* Legal state values are:
* NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_DISABLE
* This value disables lock metering.
* NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_ENABLE
* This value enables lock metering.
* NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_RESET
* This value resets, or clears, all lock metering state. Lock
* metering must be disabled prior to attempting a reset.
* bCircularBuffer
* This parameter specifies type of buffer.
* Possible values are:
* TRUE
* For circular buffer.
* FALSE
* For sequential buffer.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_INVALID_STATE
*/
#define NV0000_CTRL_CMD_DIAG_SET_LOCK_METER_STATE (0x481) /* finn: Evaluated from "(FINN_NV01_ROOT_DIAG_INTERFACE_ID << 8) | NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_PARAMS_MESSAGE_ID (0x81U)
typedef struct NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_PARAMS {
NvU32 state;
NvBool bCircularBuffer;
} NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_PARAMS;
/* valid lock metering state values */
#define NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_DISABLE (0x00000000)
#define NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_ENABLE (0x00000001)
#define NV0000_CTRL_DIAG_SET_LOCK_METER_STATE_RESET (0x00000002)
/*
* NV0000_CTRL_DIAG_LOCK_METER_ENTRY
*
* This structure represents a single lock meter entry.
*
* counter
* This field contains the number of nanonseconds elapsed since the
* the last system boot when the lock meter entry was generated.
* freq
* This field contains the CPU performance counter frequency in units
* of ticks per second.
* line
* This field contains the relevant line number.
* filename
* This field contains the relevant file name.
* tag
* This field contains a tag uniquely identifying the user of the metered
* lock operations.
* cpuNum
* This field contains the CPU number from which the metered operation
* was initiated.
* irql
* This field contains the IRQL at which the metered operation was
* initiated.
* data0
* data1
* data2
* These fields contain tag-specific data.
*/
#define NV0000_CTRL_DIAG_LOCK_METER_ENTRY_FILENAME_LENGTH (0xc)
typedef struct NV0000_CTRL_DIAG_LOCK_METER_ENTRY {
NV_DECLARE_ALIGNED(NvU64 counter, 8);
NvU32 line;
NvU8 filename[NV0000_CTRL_DIAG_LOCK_METER_ENTRY_FILENAME_LENGTH];
NvU16 tag;
NvU8 cpuNum;
NvU8 irql;
NV_DECLARE_ALIGNED(NvU64 threadId, 8);
NvU32 data0;
NvU32 data1;
NvU32 data2;
} NV0000_CTRL_DIAG_LOCK_METER_ENTRY;
/* valid lock meter entry tag values */
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ACQUIRE_SEMA (0x00000001)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ACQUIRE_SEMA_FORCED (0x00000002)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ACQUIRE_SEMA_COND (0x00000003)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_RELEASE_SEMA (0x00000004)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ACQUIRE_API (0x00000010)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_RELEASE_API (0x00000011)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ACQUIRE_GPUS (0x00000020)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_RELEASE_GPUS (0x00000021)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_DATA (0x00000100)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_RMCTRL (0x00001000)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_CFG_GET (0x00002000)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_CFG_SET (0x00002001)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_CFG_GETEX (0x00002002)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_CFG_SETEX (0x00002003)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_VIDHEAP (0x00003000)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_MAPMEM (0x00003001)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_UNMAPMEM (0x00003002)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_MAPMEM_DMA (0x00003003)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_UNMAPMEM_DMA (0x00003004)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ALLOC (0x00004000)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ALLOC_MEM (0x00004001)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_DUP_OBJECT (0x00004010)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_CLIENT (0x00005000)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_DEVICE (0x00005001)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_SUBDEVICE (0x00005002)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_SUBDEVICE_DIAG (0x00005003)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_DISP (0x00005004)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_DISP_CMN (0x00005005)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_CHANNEL (0x00005006)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_CHANNEL_MPEG (0x00005007)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_CHANNEL_DISP (0x00005008)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_MEMORY (0x00005009)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_FBMEM (0x0000500A)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_OBJECT (0x0000500B)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_FREE_EVENT (0x0000500C)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_IDLE_CHANNELS (0x00006000)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_BIND_CTXDMA (0x00007000)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ALLOC_CTXDMA (0x00007001)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_ISR (0x0000F000)
#define NV0000_CTRL_DIAG_LOCK_METER_TAG_DPC (0x0000F00F)
/*
* NV0000_CTRL_CMD_DIAG_GET_LOCK_METER_ENTRIES
*
* This command returns lock metering data in a fixed-sized array of entries.
* Each request will return up NV0000_CTRL_CMD_DIAG_GET_LOCK_METER_MAX_ENTRIES
* entries.
*
* It is up to the caller to repeat these requests to retrieve the total number
* of entries reported by NV0000_CTRL_CMD_DIAG_GET_LOCK_METER_STATE.
*
* entryCount
* This parameter returns the total number of valid entries returned
* in the entries array. This value will not exceed
* NV0000_CTRL_DIAG_GET_LOCK_METER_ENTRIES_MAX but may be less.
* A value of zero indicates there are no more valid entries.
* entries
* This parameter contains the storage into which lock metering entry
* data is returned.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_INVALID_STATE
*/
#define NV0000_CTRL_CMD_DIAG_GET_LOCK_METER_ENTRIES (0x485) /* finn: Evaluated from "(FINN_NV01_ROOT_DIAG_INTERFACE_ID << 8) | NV0000_CTRL_DIAG_GET_LOCK_METER_ENTRIES_PARAMS_MESSAGE_ID" */
/* total number of entries returned */
#define NV0000_CTRL_DIAG_GET_LOCK_METER_ENTRIES_MAX (0x40)
#define NV0000_CTRL_DIAG_GET_LOCK_METER_ENTRIES_PARAMS_MESSAGE_ID (0x85U)
typedef struct NV0000_CTRL_DIAG_GET_LOCK_METER_ENTRIES_PARAMS {
NvU32 entryCount;
NV_DECLARE_ALIGNED(NV0000_CTRL_DIAG_LOCK_METER_ENTRY entries[NV0000_CTRL_DIAG_GET_LOCK_METER_ENTRIES_MAX], 8);
} NV0000_CTRL_DIAG_GET_LOCK_METER_ENTRIES_PARAMS;
/*
* NV0000_CTRL_CMD_DIAG_PROFILE_RPC
*
* This command returns the RPC runtime information, and
* will only return valid when it is running inside VGX mode.
*
* rpcProfileCmd:
* RPC profiler command issued by rpc profiler utility
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_DIAG_PROFILE_RPC (0x488) /* finn: Evaluated from "(FINN_NV01_ROOT_DIAG_INTERFACE_ID << 8) | NV0000_CTRL_DIAG_PROFILE_RPC_PARAMS_MESSAGE_ID" */
typedef struct RPC_METER_ENTRY {
NV_DECLARE_ALIGNED(NvU64 startTimeInNs, 8);
NV_DECLARE_ALIGNED(NvU64 endTimeInNs, 8);
NV_DECLARE_ALIGNED(NvU64 rpcDataTag, 8);
NV_DECLARE_ALIGNED(NvU64 rpcExtraData, 8);
} RPC_METER_ENTRY;
#define NV0000_CTRL_DIAG_PROFILE_RPC_PARAMS_MESSAGE_ID (0x88U)
typedef struct NV0000_CTRL_DIAG_PROFILE_RPC_PARAMS {
NvU32 rpcProfileCmd;
} NV0000_CTRL_DIAG_PROFILE_RPC_PARAMS;
#define NV0000_CTRL_PROFILE_RPC_CMD_DISABLE (0x00000000)
#define NV0000_CTRL_PROFILE_RPC_CMD_ENABLE (0x00000001)
#define NV0000_CTRL_PROFILE_RPC_CMD_RESET (0x00000002)
/*
* NV0000_CTRL_CMD_DIAG_DUMP_RPC
*
* This command returns the RPC runtime information, which
* will be logged by NV0000_CTRL_CMD_DIAG_PROFILE_RPC command
* when running inside VGX mode.
*
* When issuing this command, the RPC profiler has to be disabled.
*
* firstEntryOffset:
* [IN] offset for first entry.
*
* outputEntryCout:
* [OUT] number of entries returned in rpcProfilerBuffer.
*
* remainingEntryCount:
* [OUT] number of entries remaining.
*
* elapsedTimeInNs:
* [OUT] runtime for the RPC profiler tool.
*
* rpcProfilerBuffer:
* [OUT] buffer to store the RPC entries
*/
#define NV0000_CTRL_CMD_DIAG_DUMP_RPC (0x489) /* finn: Evaluated from "(FINN_NV01_ROOT_DIAG_INTERFACE_ID << 8) | NV0000_CTRL_DIAG_DUMP_RPC_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_DIAG_RPC_MAX_ENTRIES (100)
#define NV0000_CTRL_DIAG_DUMP_RPC_PARAMS_MESSAGE_ID (0x89U)
typedef struct NV0000_CTRL_DIAG_DUMP_RPC_PARAMS {
NvU32 firstEntryOffset;
NvU32 outputEntryCount;
NvU32 remainingEntryCount;
NV_DECLARE_ALIGNED(NvU64 elapsedTimeInNs, 8);
NV_DECLARE_ALIGNED(RPC_METER_ENTRY rpcProfilerBuffer[NV0000_CTRL_DIAG_RPC_MAX_ENTRIES], 8);
} NV0000_CTRL_DIAG_DUMP_RPC_PARAMS;
/* _ctrl0000diag_h_ */

View File

@@ -0,0 +1,116 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2006-2015 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000event.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "ctrl/ctrlxxxx.h"
#include "class/cl0000.h"
/*
* NV0000_CTRL_CMD_EVENT_SET_NOTIFICATION
*
* This command sets event notification for the system events.
*
* event
* This parameter specifies the type of event to which the specified
* action is to be applied. The valid event values can be found in
* cl0000.h.
*
* action
* This parameter specifies the desired event notification action.
* Valid notification actions include:
* NV0000_CTRL_EVENT_SET_NOTIFICATION_ACTION_DISABLE
* This action disables event notification for the specified
* event.
* NV0000_CTRL_EVENT_SET_NOTIFICATION_ACTION_SINGLE
* This action enables single-shot event notification for the
* specified event.
* NV0000_CTRL_EVENT_SET_NOTIFICATION_ACTION_REPEAT
* This action enables repeated event notification for the
* specified event.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_INVALID_STATE
* NV_ERR_INVALID_CLIENT
*
*/
#define NV0000_CTRL_CMD_EVENT_SET_NOTIFICATION (0x501) /* finn: Evaluated from "(FINN_NV01_ROOT_EVENT_INTERFACE_ID << 8) | NV0000_CTRL_EVENT_SET_NOTIFICATION_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_EVENT_SET_NOTIFICATION_PARAMS_MESSAGE_ID (0x1U)
typedef struct NV0000_CTRL_EVENT_SET_NOTIFICATION_PARAMS {
NvU32 event;
NvU32 action;
} NV0000_CTRL_EVENT_SET_NOTIFICATION_PARAMS;
/* valid action values */
#define NV0000_CTRL_EVENT_SET_NOTIFICATION_ACTION_DISABLE (0x00000000)
#define NV0000_CTRL_EVENT_SET_NOTIFICATION_ACTION_SINGLE (0x00000001)
#define NV0000_CTRL_EVENT_SET_NOTIFICATION_ACTION_REPEAT (0x00000002)
/*
* NV0000_CTRL_CMD_GET_SYSTEM_EVENT_STATUS
*
* This command returns the status of the specified system event type.
* See the description of NV01_EVENT for details on registering events.
*
* event
* This parameter specifies the event type. Valid event type values
* can be found in cl0000.h.
* status
* This parameter returns the status for a given event type. Valid
* status values can be found in cl0000.h.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_INVALID_CLIENT
*
*/
#define NV0000_CTRL_CMD_GET_SYSTEM_EVENT_STATUS (0x502) /* finn: Evaluated from "(FINN_NV01_ROOT_EVENT_INTERFACE_ID << 8) | NV0000_CTRL_GET_SYSTEM_EVENT_STATUS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GET_SYSTEM_EVENT_STATUS_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_CTRL_GET_SYSTEM_EVENT_STATUS_PARAMS {
NvU32 event;
NvU32 status;
} NV0000_CTRL_GET_SYSTEM_EVENT_STATUS_PARAMS;
/* _ctrl0000event_h_ */

View File

@@ -0,0 +1,854 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2005-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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000gpu.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "ctrl/ctrl0000/ctrl0000system.h"
#include "ctrl/ctrlxxxx.h"
#include "nvlimits.h"
/* NV01_ROOT (client) GPU control commands and parameters */
/*
* NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS
*
* This command returns a table of attached gpuId values.
* The table is NV0000_CTRL_GPU_MAX_ATTACHED_GPUS entries in size.
*
* gpuIds[]
* This parameter returns the table of attached GPU IDs.
* The GPU ID is an opaque platform-dependent value that can be used
* with the NV0000_CTRL_CMD_GPU_GET_ID_INFO command to retrieve
* additional information about the GPU. The valid entries in gpuIds[]
* are contiguous, with a value of NV0000_CTRL_GPU_INVALID_ID indicating
* the invalid entries.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_OPERATING_SYSTEM
*/
#define NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS (0x201) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_ATTACHED_IDS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_MAX_ATTACHED_GPUS 32
#define NV0000_CTRL_GPU_INVALID_ID (0xffffffff)
#define NV0000_CTRL_GPU_GET_ATTACHED_IDS_PARAMS_MESSAGE_ID (0x1U)
typedef struct NV0000_CTRL_GPU_GET_ATTACHED_IDS_PARAMS {
NvU32 gpuIds[NV0000_CTRL_GPU_MAX_ATTACHED_GPUS];
} NV0000_CTRL_GPU_GET_ATTACHED_IDS_PARAMS;
/*
* Deprecated. Please use NV0000_CTRL_CMD_GPU_GET_ID_INFO_V2 instead.
*/
#define NV0000_CTRL_CMD_GPU_GET_ID_INFO (0x202) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_ID_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_MAX_SZNAME 128
#define NV0000_CTRL_NO_NUMA_NODE (-1)
#define NV0000_CTRL_GPU_GET_ID_INFO_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_CTRL_GPU_GET_ID_INFO_PARAMS {
NvU32 gpuId;
NvU32 gpuFlags;
NvU32 deviceInstance;
NvU32 subDeviceInstance;
NV_DECLARE_ALIGNED(NvP64 szName, 8);
NvU32 sliStatus;
NvU32 boardId;
NvU32 gpuInstance;
NvS32 numaId;
} NV0000_CTRL_GPU_GET_ID_INFO_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_GET_ID_INFO_V2
* This command returns GPU instance information for the specified GPU.
*
* [in] gpuId
* This parameter should specify a valid GPU ID value. If there
* is no GPU present with the specified ID, a status of
* NV_ERR_INVALID_ARGUMENT is returned.
* [out] gpuFlags
* This parameter returns various flags values for the specified GPU.
* Valid flag values include:
* NV0000_CTRL_GPU_ID_INFO_IN_USE
* When true this flag indicates there are client references
* to the GPU in the form of device class instantiations (see
* NV01_DEVICE or NV03_DEVICE descriptions for details).
* NV0000_CTRL_GPU_ID_INFO_LINKED_INTO_SLI_DEVICE
* When true this flag indicates the GPU is linked into an
* active SLI device.
* NV0000_CTRL_GPU_ID_INFO_MOBILE
* When true this flag indicates the GPU is a mobile GPU.
* NV0000_CTRL_GPU_ID_BOOT_MASTER
* When true this flag indicates the GPU is the boot master GPU.
* NV0000_CTRL_GPU_ID_INFO_SOC
* When true this flag indicates the GPU is part of a
* System-on-Chip (SOC).
* NV0000_CTRL_GPU_ID_INFO_ATS_ENABLED
* When ATS is enabled on the system.
* [out] deviceInstance
* This parameter returns the broadcast device instance number associated
* with the specified GPU. This value can be used to instantiate
* a broadcast reference to the GPU using the NV01_DEVICE classes.
* [out] subDeviceInstance
* This parameter returns the unicast subdevice instance number
* associated with the specified GPU. This value can be used to
* instantiate a unicast reference to the GPU using the NV20_SUBDEVICE
* classes.
* [out] sliStatus
* This parameters returns the SLI status for the specified GPU.
* Legal values for this member are described by NV0000_CTRL_SLI_STATUS.
* [out] boardId
* This parameter returns the board ID value with which the
* specified GPU is associated. Multiple GPUs can share the
* same board ID in multi-GPU configurations.
* [out] gpuInstance
* This parameter returns the GPU instance number for the specified GPU.
* GPU instance numbers are assigned in bus-probe order beginning with
* zero and are limited to one less the number of GPUs in the system.
* [out] numaId
* This parameter returns the ID of NUMA node for the specified GPU.
* In case there is no NUMA node, NV0000_CTRL_NO_NUMA_NODE is returned.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GPU_GET_ID_INFO_V2 (0x205) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_ID_INFO_V2_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_GET_ID_INFO_V2_PARAMS_MESSAGE_ID (0x5U)
typedef struct NV0000_CTRL_GPU_GET_ID_INFO_V2_PARAMS {
NvU32 gpuId;
NvU32 gpuFlags;
NvU32 deviceInstance;
NvU32 subDeviceInstance;
NvU32 sliStatus;
NvU32 boardId;
NvU32 gpuInstance;
NvS32 numaId;
} NV0000_CTRL_GPU_GET_ID_INFO_V2_PARAMS;
/* valid flags values */
#define NV0000_CTRL_GPU_ID_INFO_IN_USE 0:0
#define NV0000_CTRL_GPU_ID_INFO_IN_USE_FALSE (0x00000000)
#define NV0000_CTRL_GPU_ID_INFO_IN_USE_TRUE (0x00000001)
#define NV0000_CTRL_GPU_ID_INFO_LINKED_INTO_SLI_DEVICE 1:1
#define NV0000_CTRL_GPU_ID_INFO_LINKED_INTO_SLI_DEVICE_FALSE (0x00000000)
#define NV0000_CTRL_GPU_ID_INFO_LINKED_INTO_SLI_DEVICE_TRUE (0x00000001)
#define NV0000_CTRL_GPU_ID_INFO_MOBILE 2:2
#define NV0000_CTRL_GPU_ID_INFO_MOBILE_FALSE (0x00000000)
#define NV0000_CTRL_GPU_ID_INFO_MOBILE_TRUE (0x00000001)
#define NV0000_CTRL_GPU_ID_INFO_BOOT_MASTER 3:3
#define NV0000_CTRL_GPU_ID_INFO_BOOT_MASTER_FALSE (0x00000000)
#define NV0000_CTRL_GPU_ID_INFO_BOOT_MASTER_TRUE (0x00000001)
#define NV0000_CTRL_GPU_ID_INFO_SOC 5:5
#define NV0000_CTRL_GPU_ID_INFO_SOC_FALSE (0x00000000)
#define NV0000_CTRL_GPU_ID_INFO_SOC_TRUE (0x00000001)
#define NV0000_CTRL_GPU_ID_INFO_ATS_ENABLED 6:6
#define NV0000_CTRL_GPU_ID_INFO_ATS_ENABLED_FALSE (0x00000000)
#define NV0000_CTRL_GPU_ID_INFO_ATS_ENABLED_TRUE (0x00000001)
/*
* NV0000_CTRL_CMD_GPU_GET_INIT_STATUS
*
* This command returns the initialization status for the specified GPU, and
* will return NV_ERR_INVALID_STATE if called prior to GPU
* initialization.
*
* gpuId
* This parameter should specify a valid GPU ID value. If there
* is no GPU present with the specified ID, a status of
* NV_ERR_INVALID_ARGUMENT is returned.
* status
* This parameter returns the status code identifying the initialization
* state of the GPU. If this parameter has the value NV_OK,
* then no errors were detected during GPU initialization. Otherwise, this
* parameter specifies the top-level error that was detected during GPU
* initialization. Note that a value of NV_OK only means that
* no errors were detected during the actual GPU initialization, and other
* errors may have occurred that prevent the GPU from being attached or
* accessible via the NV01_DEVICE or NV20_SUBDEVICE classes.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_INVALID_STATE
*/
#define NV0000_CTRL_CMD_GPU_GET_INIT_STATUS (0x203) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_INIT_STATUS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_GET_INIT_STATUS_PARAMS_MESSAGE_ID (0x3U)
typedef struct NV0000_CTRL_GPU_GET_INIT_STATUS_PARAMS {
NvU32 gpuId;
NvU32 status;
} NV0000_CTRL_GPU_GET_INIT_STATUS_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_GET_DEVICE_IDS
*
* This command returns a mask of valid device IDs. These device IDs
* can be used to instantiate the NV01_DEVICE_0 class (see NV01_DEVICE_0
* for more information).
*
* deviceIds
* This parameter returns the mask of valid device IDs. Each enabled bit
* in the mask corresponds to a valid device instance. Valid device
* instances can be used to initialize the NV0080_ALLOC_PARAMETERS
* structure when using NvRmAlloc to instantiate device handles. The
* number of device IDs will not exceed NV_MAX_DEVICES in number.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_PARAM_STRUCT
*/
#define NV0000_CTRL_CMD_GPU_GET_DEVICE_IDS (0x204) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_DEVICE_IDS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_GET_DEVICE_IDS_PARAMS_MESSAGE_ID (0x4U)
typedef struct NV0000_CTRL_GPU_GET_DEVICE_IDS_PARAMS {
NvU32 deviceIds;
} NV0000_CTRL_GPU_GET_DEVICE_IDS_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_GET_PROBED_IDS
*
* This command returns a table of probed gpuId values.
* The table is NV0000_CTRL_GPU_MAX_PROBED_GPUS entries in size.
*
* gpuIds[]
* This parameter returns the table of probed GPU IDs.
* The GPU ID is an opaque platform-dependent value that can
* be used with the NV0000_CTRL_CMD_GPU_ATTACH_IDS and
* NV0000_CTRL_CMD_GPU_DETACH_ID commands to attach and detach
* the GPU.
* The valid entries in gpuIds[] are contiguous, with a value
* of NV0000_CTRL_GPU_INVALID_ID indicating the invalid entries.
* excludedGpuIds[]
* This parameter returns the table of excluded GPU IDs.
* An excluded GPU ID is an opaque platform-dependent value that
* can be used with NV0000_CTRL_CMD_GPU_GET_PCI_INFO and
* NV0000_CTRL_CMD_GPU_GET_UUID_INFO.
* The valid entries in excludedGpuIds[] are contiguous, with a value
* of NV0000_CTRL_GPU_INVALID_ID indicating the invalid entries.
*
* Possible status values returned are:
* NV_OK
*/
#define NV0000_CTRL_CMD_GPU_GET_PROBED_IDS (0x214) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_PROBED_IDS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_MAX_PROBED_GPUS NV_MAX_DEVICES
#define NV0000_CTRL_GPU_GET_PROBED_IDS_PARAMS_MESSAGE_ID (0x14U)
typedef struct NV0000_CTRL_GPU_GET_PROBED_IDS_PARAMS {
NvU32 gpuIds[NV0000_CTRL_GPU_MAX_PROBED_GPUS];
NvU32 excludedGpuIds[NV0000_CTRL_GPU_MAX_PROBED_GPUS];
} NV0000_CTRL_GPU_GET_PROBED_IDS_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_GET_PCI_INFO
*
* This command takes a gpuId and returns PCI bus information about
* the device. If the OS does not support returning PCI bus
* information, this call will return NV_ERR_NOT_SUPPORTED
*
* gpuId
* This parameter should specify a valid GPU ID value. If there
* is no GPU present with the specified ID, a status of
* NV_ERR_INVALID_ARGUMENT is returned.
*
* domain
* This parameter returns the PCI domain of the GPU.
*
* bus
* This parameter returns the PCI bus of the GPU.
*
* slot
* This parameter returns the PCI slot of the GPU.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_NOT_SUPPORTED
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GPU_GET_PCI_INFO (0x21b) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_PCI_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_GET_PCI_INFO_PARAMS_MESSAGE_ID (0x1BU)
typedef struct NV0000_CTRL_GPU_GET_PCI_INFO_PARAMS {
NvU32 gpuId;
NvU32 domain;
NvU16 bus;
NvU16 slot;
} NV0000_CTRL_GPU_GET_PCI_INFO_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_ATTACH_IDS
*
* This command attaches the GPUs with the gpuIds matching those in
* the table provided by the client.
* The table is NV0000_CTRL_GPU_MAX_PROBED_GPUS entries in size.
*
* gpuIds[]
* This parameter holds the table of gpuIds to attach. At least
* one gpuId must be specified; clients may use the special
* gpuId value NV0000_CTRL_GPU_ATTACH_ALL_PROBED_IDS to indicate
* that all probed GPUs are to be attached.
* The entries in gpuIds[] must be contiguous, with a value of
* NV0000_CTRL_GPU_INVALID_ID to indicate the first invalid
* entry.
* If one or more of the gpuId values do not specify a GPU found
* in the system, the NV_ERR_INVALID_ARGUMENT error
* status is returned.
*
* failedId
* If NV0000_CTRL_GPU_ATTACH_ALL_PROBED_IDS is specified and
* a GPU cannot be attached, the NV0000_CTRL_CMD_GPU_ATTACH_IDS
* command returns an error code and saves the failing GPU's
* gpuId in this field.
*
* If a table of gpuIds is provided, these gpuIds will be validated
* against the RM's table of probed gpuIds and attached in turn,
* if valid; if NV0000_CTRL_GPU_ATTACH_ALL_PROBED_IDS is used, all
* probed gpuIds will be attached, in the order the associated GPUs
* were probed in by the RM.
*
* If a gpuId fails to attach, this gpuId is stored in the failedId
* field. Any GPUs attached by the command prior the failure are
* detached.
*
* If multiple clients use NV0000_CTRL_CMD_GPU_ATTACH_IDS to attach
* a gpuId, the RM ensures that the gpuId won't be detached until
* all clients have issued a call to NV0000_CTRL_CMD_GPU_DETACH_IDS
* to detach the gpuId (or have terminated).
*
* Possible status values returned are:
* NV_OK
* NV_ERR_OPERATING_SYSTEM
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_IRQ_EDGE_TRIGGERED
* NV_ERR_IRQ_NOT_FIRING
*/
#define NV0000_CTRL_CMD_GPU_ATTACH_IDS (0x215) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_ATTACH_IDS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_ATTACH_ALL_PROBED_IDS (0x0000ffff)
#define NV0000_CTRL_GPU_ATTACH_IDS_PARAMS_MESSAGE_ID (0x15U)
typedef struct NV0000_CTRL_GPU_ATTACH_IDS_PARAMS {
NvU32 gpuIds[NV0000_CTRL_GPU_MAX_PROBED_GPUS];
NvU32 failedId;
} NV0000_CTRL_GPU_ATTACH_IDS_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_DETACH_IDS
*
* This command detaches the GPUs with the gpuIds matching those in
* the table provided by the client.
* The table is NV0000_CTRL_GPU_MAX_ATTACHED_GPUS entries in size.
*
* gpuIds[]
* This parameter holds the table of gpuIds to detach. At least
* one gpuId must be specified; clients may use the special
* gpuId NV0000_CTRL_GPU_DETACH_ALL_ATTACHED_IDS to indicate that
* all attached GPUs are to be detached.
* The entries in gpuIds[] must be contiguous, with a value of
* NV0000_CTRL_GPU_INVALID_ID to indicate the first invalid
* entry.
* If one or more of the gpuId values do not specify a GPU found
* in the system, the NV_ERR_INVALID_ARGUMENT error
* status is returned.
*
* If a table of gpuIds is provided, these gpuIds will be validated
* against the RM's list of attached gpuIds; each valid gpuId is
* detached immediately if it's no longer in use (i.e. if there are
* no client references to the associated GPU in the form of
* device class instantiations (see the NV01_DEVICE or NV03_DEVICE
* descriptions for details)) and if no other client still requires
* the associated GPU to be attached.
*
* If a given gpuId can't be detached immediately, it will instead
* be detached when the last client reference is freed or when
* the last client that issued NV0000_CTRL_CMD_GPU_ATTACH_IDS for
* this gpuId either issues NV0000_CTRL_CMD_GPU_DETACH_IDS or exits
* without detaching the gpuId explicitly.
*
* Clients may use the NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS command
* to obtain a table of the attached gpuIds.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_OPERATING_SYSTEM
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GPU_DETACH_IDS (0x216) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_DETACH_IDS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_DETACH_ALL_ATTACHED_IDS (0x0000ffff)
#define NV0000_CTRL_GPU_DETACH_IDS_PARAMS_MESSAGE_ID (0x16U)
typedef struct NV0000_CTRL_GPU_DETACH_IDS_PARAMS {
NvU32 gpuIds[NV0000_CTRL_GPU_MAX_ATTACHED_GPUS];
} NV0000_CTRL_GPU_DETACH_IDS_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_GET_SVM_SIZE
*
* This command is used to get the SVM size.
*
* gpuId
* This parameter uniquely identifies the GPU whose associated
* SVM size is to be returned. The value of this field must
* match one of those in the table returned by
* NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS
*
* SvmSize
* SVM size is returned in this.
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_INVALID_STATE
*
*/
#define NV0000_CTRL_CMD_GPU_GET_SVM_SIZE (0x240) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_SVM_SIZE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_GET_SVM_SIZE_PARAMS_MESSAGE_ID (0x40U)
typedef struct NV0000_CTRL_GPU_GET_SVM_SIZE_PARAMS {
NvU32 gpuId;
NvU32 svmSize;
} NV0000_CTRL_GPU_GET_SVM_SIZE_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_GET_UUID_INFO
*
* This command returns requested information pertaining to the GPU
* specified by the GPU UUID passed in.
*
* Generally only GPUs that have been attached are visible to this call. Therefore
* queries on unattached GPUs will fail with NV_ERR_OBJECT_NOT_FOUND. However,
* a query for a SHA1 UUID may succeed for an unattached GPU in cases where the GID
* is cached, such as an excluded GPU.
*
* gpuGuid (INPUT)
* The GPU UUID of the gpu whose parameters are to be returned. Refer to
* NV0000_CTRL_CMD_GPU_GET_ID_INFO for more information.
*
* flags (INPUT)
* The _FORMAT* flags designate ascii string format or a binary format.
*
* The _TYPE* flags designate either SHA-1-based (32-hex-character) or
* SHA-256-based (64-hex-character).
*
* gpuId (OUTPUT)
* The GPU ID of the GPU identified by gpuGuid. Refer to
* NV0000_CTRL_CMD_GPU_GET_ID_INFO for more information.
*
* deviceInstance (OUTPUT)
* The device instance of the GPU identified by gpuGuid. Refer to
* NV0000_CTRL_CMD_GPU_GET_ID_INFO for more information.
*
* subdeviceInstance (OUTPUT)
* The subdevice instance of the GPU identified by gpuGuid. Refer to
* NV0000_CTRL_CMD_GPU_GET_ID_INFO for more information.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_OBJECT_NOT_FOUND
*
*/
#define NV0000_CTRL_CMD_GPU_GET_UUID_INFO (0x274) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_UUID_INFO_PARAMS_MESSAGE_ID" */
/* maximum possible number of bytes of GID information */
#define NV0000_GPU_MAX_GID_LENGTH (0x00000100)
#define NV0000_CTRL_GPU_GET_UUID_INFO_PARAMS_MESSAGE_ID (0x74U)
typedef struct NV0000_CTRL_GPU_GET_UUID_INFO_PARAMS {
NvU8 gpuUuid[NV0000_GPU_MAX_GID_LENGTH];
NvU32 flags;
NvU32 gpuId;
NvU32 deviceInstance;
NvU32 subdeviceInstance;
} NV0000_CTRL_GPU_GET_UUID_INFO_PARAMS;
#define NV0000_CTRL_CMD_GPU_GET_UUID_INFO_FLAGS_FORMAT 1:0
#define NV0000_CTRL_CMD_GPU_GET_UUID_INFO_FLAGS_FORMAT_ASCII (0x00000000)
#define NV0000_CTRL_CMD_GPU_GET_UUID_INFO_FLAGS_FORMAT_BINARY (0x00000002)
#define NV0000_CTRL_CMD_GPU_GET_UUID_INFO_FLAGS_TYPE 2:2
#define NV0000_CTRL_CMD_GPU_GET_UUID_INFO_FLAGS_TYPE_SHA1 (0x00000000)
#define NV0000_CTRL_CMD_GPU_GET_UUID_INFO_FLAGS_TYPE_SHA256 (0x00000001)
/*
* NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID
*
* This command returns the GPU UUID for the provided GPU ID.
* Note that only GPUs that have been attached are visible to this call.
* Therefore queries on unattached GPUs will fail
* with NV_ERR_OBJECT_NOT_FOUND.
*
* gpuId (INPUT)
* The GPU ID whose parameters are to be returned. Refer to
* NV0000_CTRL_CMD_GPU_GET_ID_INFO for more information.
*
* flags (INPUT)
*
* NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_FORMAT_ASCII
* This value is used to request the GPU UUID in ASCII format.
* NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_FORMAT_BINARY
* This value is used to request the GPU UUID in binary format.
*
* NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_TYPE_SHA1
* This value is used to request that the GPU UUID value
* be SHA1-based (32-hex-character).
* NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_TYPE_SHA256
* This value is used to request that the GPU UUID value
* be SHA256-based (64-hex-character).
*
* gpuUuid[NV0000_GPU_MAX_GID_LENGTH] (OUTPUT)
* The GPU UUID of the GPU identified by GPU ID. Refer to
* NV0000_CTRL_CMD_GPU_GET_ID_INFO for more information.
*
* uuidStrLen (OUTPUT)
* The length of the UUID returned which is related to the format that
* was requested using flags.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_OBJECT_NOT_FOUND
* NV_ERR_OPERATING_SYSTEM
*/
#define NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID (0x275) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_UUID_FROM_GPU_ID_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_GET_UUID_FROM_GPU_ID_PARAMS_MESSAGE_ID (0x75U)
typedef struct NV0000_CTRL_GPU_GET_UUID_FROM_GPU_ID_PARAMS {
NvU32 gpuId;
NvU32 flags;
NvU8 gpuUuid[NV0000_GPU_MAX_GID_LENGTH];
NvU32 uuidStrLen;
} NV0000_CTRL_GPU_GET_UUID_FROM_GPU_ID_PARAMS;
/* valid format values */
#define NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_FORMAT 1:0
#define NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_FORMAT_ASCII (0x00000000)
#define NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_FORMAT_BINARY (0x00000002)
/*valid type values*/
#define NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_TYPE 2:2
#define NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_TYPE_SHA1 (0x00000000)
#define NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_TYPE_SHA256 (0x00000001)
/*
* NV0000_CTRL_CMD_GPU_MODIFY_DRAIN_STATE
*
* This command is used to enter or exit the so called "drain" state.
* When this state is enabled, the existing clients continue executing
* as usual, however no new client connections are allowed.
* This is done in order to "drain" the system of the running clients
* in preparation to selectively powering down the GPU.
* No GPU can enter a bleed state if that GPU is in an SLI group.
* In that case, NV_ERR_IN_USE is returned.
* Requires administrator privileges.
*
* It is expected, that the "drain" state will be eventually deprecated
* and replaced with another mechanism to quiesce a GPU (Bug 1718113).
*
* gpuId (INPUT)
* This parameter should specify a valid GPU ID value. If there
* is no GPU present with the specified ID, a status of
* NV_ERR_INVALID_ARGUMENT is returned.
* newState (INPUT)
* This input parameter is used to enter or exit the "drain"
* software state of the GPU specified by the gpuId parameter.
* Possible values are:
* NV0000_CTRL_GPU_DRAIN_STATE_ENABLED
* NV0000_CTRL_GPU_DRAIN_STATE_DISABLED
* flags (INPUT)
* NV0000_CTRL_GPU_DRAIN_STATE_FLAG_REMOVE_DEVICE
* if set, upon reaching quiescence, a request will be made to
* the OS to "forget" the PCI device associated with the
* GPU specified by the gpuId parameter, in case such a request
* is supported by the OS. Otherwise, NV_ERR_NOT_SUPPORTED
* will be returned.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INSUFFICIENT_PERMISSIONS
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_NOT_SUPPORTED
* NV_ERR_IN_USE
*/
#define NV0000_CTRL_CMD_GPU_MODIFY_DRAIN_STATE (0x278) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_MODIFY_DRAIN_STATE_PARAMS_MESSAGE_ID" */
/* Possible values of newState */
#define NV0000_CTRL_GPU_DRAIN_STATE_DISABLED (0x00000000)
#define NV0000_CTRL_GPU_DRAIN_STATE_ENABLED (0x00000001)
/* Defined bits for the "flags" argument */
#define NV0000_CTRL_GPU_DRAIN_STATE_FLAG_REMOVE_DEVICE (0x00000001)
#define NV0000_CTRL_GPU_DRAIN_STATE_FLAG_LINK_DISABLE (0x00000002)
#define NV0000_CTRL_GPU_MODIFY_DRAIN_STATE_PARAMS_MESSAGE_ID (0x78U)
typedef struct NV0000_CTRL_GPU_MODIFY_DRAIN_STATE_PARAMS {
NvU32 gpuId;
NvU32 newState;
NvU32 flags;
} NV0000_CTRL_GPU_MODIFY_DRAIN_STATE_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_QUERY_DRAIN_STATE
*
* gpuId (INPUT)
* This parameter should specify a valid GPU ID value. If there
* is no GPU present with the specified ID, a status of
* NVOS_STATUS_ERROR_INVALID_ARGUMENT is returned.
* drainState (OUTPUT)
* This parameter returns a value indicating if the "drain"
* state is currently enabled or not for the specified GPU. See the
* description of NV0000_CTRL_CMD_GPU_MODIFY_DRAIN_STATE.
* Possible values are:
* NV0000_CTRL_GPU_DRAIN_STATE_ENABLED
* NV0000_CTRL_GPU_DRAIN_STATE_DISABLED
* flags (OUTPUT)
* NV0000_CTRL_GPU_DRAIN_STATE_FLAG_REMOVE_DEVICE
* if set, upon reaching quiesence, the GPU device will be
* removed automatically from the kernel space, similar
* to what writing "1" to the sysfs "remove" node does.
* NV0000_CTRL_GPU_DRAIN_STATE_FLAG_LINK_DISABLE
* after removing the GPU, also disable the parent bridge's
* PCIe link. This flag can only be set in conjunction with
* NV0000_CTRL_GPU_DRAIN_STATE_FLAG_REMOVE_DEVICE, and then
* only when the GPU is already idle (not attached).
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GPU_QUERY_DRAIN_STATE (0x279) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_QUERY_DRAIN_STATE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_QUERY_DRAIN_STATE_PARAMS_MESSAGE_ID (0x79U)
typedef struct NV0000_CTRL_GPU_QUERY_DRAIN_STATE_PARAMS {
NvU32 gpuId;
NvU32 drainState;
NvU32 flags;
} NV0000_CTRL_GPU_QUERY_DRAIN_STATE_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_DISCOVER
*
* This request asks the OS to scan the PCI tree or a sub-tree for GPUs,
* that are not yet known to the OS, and to make them available for use.
* If all of domain:bus:slot.function are zeros, the entire tree is scanned,
* otherwise the parameters identify the bridge device, that roots the
* subtree to be scanned.
* Requires administrator privileges.
*
* domain (INPUT)
* PCI domain of the bridge
* bus (INPUT)
* PCI bus of the bridge
* slot (INPUT)
* PCI slot of the bridge
* function (INPUT)
* PCI function of the bridge
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_INVALID_DEVICE
* NV_ERR_INSUFFICIENT_PERMISSIONS
* NV_ERR_OPERATING_SYSTEM
* NV_ERR_NOT_SUPPORTED
*/
#define NV0000_CTRL_CMD_GPU_DISCOVER (0x27a) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | 0x7A" */
typedef struct NV0000_CTRL_GPU_DISCOVER_PARAMS {
NvU32 domain;
NvU8 bus;
NvU8 slot;
NvU8 function;
} NV0000_CTRL_GPU_DISCOVER_PARAMS;
/*
* NV0000_CTRL_CMD_GPU_GET_MEMOP_ENABLE
*
* This command is used to get the content of the MemOp (CUDA Memory Operation)
* enablement mask, which can be overridden by using the MemOpOverride RegKey.
*
* The enableMask member must be treated as a bitmask, where each bit controls
* the enablement of a feature.
*
* So far, the only feature which is defined controls to whole MemOp APIs.
*
* Possible status values returned are:
* NV_OK
*
*/
#define NV0000_CTRL_CMD_GPU_GET_MEMOP_ENABLE (0x27b) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_GET_MEMOP_ENABLE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_GET_MEMOP_ENABLE_PARAMS_MESSAGE_ID (0x7BU)
typedef struct NV0000_CTRL_GPU_GET_MEMOP_ENABLE_PARAMS {
NvU32 enableMask;
} NV0000_CTRL_GPU_GET_MEMOP_ENABLE_PARAMS;
#define NV0000_CTRL_GPU_FLAGS_MEMOP_ENABLE (0x00000001)
/*
* NV0000_CTRL_CMD_GPU_DISABLE_NVLINK_INIT
*
* This privileged command is used to disable initialization for the NVLinks
* provided in the mask.
*
* The mask must be applied before the GPU is attached. DISABLE_NVLINK_INIT
* is an NOP for non-NVLink GPUs.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_INVALID_DEVICE
* NV_ERR_INSUFFICIENT_PERMISSIONS
* NV_ERR_INVALID_STATE
* NV_ERR_IN_USE
*
*/
#define NV0000_CTRL_CMD_GPU_DISABLE_NVLINK_INIT (0x281) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_DISABLE_NVLINK_INIT_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_DISABLE_NVLINK_INIT_PARAMS_MESSAGE_ID (0x81U)
typedef struct NV0000_CTRL_GPU_DISABLE_NVLINK_INIT_PARAMS {
NvU32 gpuId;
NvU32 mask;
NvBool bSkipHwNvlinkDisable;
} NV0000_CTRL_GPU_DISABLE_NVLINK_INIT_PARAMS;
#define NV0000_CTRL_GPU_LEGACY_CONFIG_MAX_PARAM_DATA 0x00000175
#define NV0000_CTRL_GPU_LEGACY_CONFIG_MAX_PROPERTIES_IN 6
#define NV0000_CTRL_GPU_LEGACY_CONFIG_MAX_PROPERTIES_OUT 5
/*
* NV0000_CTRL_CMD_GPU_LEGACY_CONFIG
*
* Path to use legacy RM GetConfig/Set API. This API is being phased out.
*/
#define NV0000_CTRL_CMD_GPU_LEGACY_CONFIG (0x282) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_LEGACY_CONFIG_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_LEGACY_CONFIG_PARAMS_MESSAGE_ID (0x82U)
typedef struct NV0000_CTRL_GPU_LEGACY_CONFIG_PARAMS {
NvHandle hContext; /* [in] - Handle of object to perform operation on (Device, Subdevice, etc) */
NvU32 opType; /* [in] - Type of API */
NvV32 index; /* [in] - command type */
NvU32 dataType; /* [out] - data union type */
union {
struct {
NvV32 value;
} configGet;
struct {
NvU32 newValue;
NvU32 oldValue;
} configSet;
struct {
NvU8 paramData[NV0000_CTRL_GPU_LEGACY_CONFIG_MAX_PARAM_DATA];
NvU32 paramSize;
} configEx;
struct {
NvU32 propertyId;
NvU32 propertyIn[NV0000_CTRL_GPU_LEGACY_CONFIG_MAX_PROPERTIES_IN];
NvU32 propertyOut[NV0000_CTRL_GPU_LEGACY_CONFIG_MAX_PROPERTIES_OUT];
} reservedProperty;
} data;
} NV0000_CTRL_GPU_LEGACY_CONFIG_PARAMS;
#define NV0000_CTRL_GPU_LEGACY_CONFIG_OP_TYPE_GET (0x00000000)
#define NV0000_CTRL_GPU_LEGACY_CONFIG_OP_TYPE_SET (0x00000001)
#define NV0000_CTRL_GPU_LEGACY_CONFIG_OP_TYPE_GET_EX (0x00000002)
#define NV0000_CTRL_GPU_LEGACY_CONFIG_OP_TYPE_SET_EX (0x00000003)
#define NV0000_CTRL_GPU_LEGACY_CONFIG_OP_TYPE_RESERVED (0x00000004)
/*
* NV0000_CTRL_CMD_IDLE_CHANNELS
*/
#define NV0000_CTRL_CMD_IDLE_CHANNELS (0x283) /* finn: Evaluated from "(FINN_NV01_ROOT_GPU_INTERFACE_ID << 8) | NV0000_CTRL_GPU_IDLE_CHANNELS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPU_IDLE_CHANNELS_PARAMS_MESSAGE_ID (0x83U)
typedef struct NV0000_CTRL_GPU_IDLE_CHANNELS_PARAMS {
NvHandle hDevice;
NvHandle hChannel;
NvV32 numChannels;
/* C form: NvP64 phClients NV_ALIGN_BYTES(8); */
NV_DECLARE_ALIGNED(NvP64 phClients, 8);
/* C form: NvP64 phDevices NV_ALIGN_BYTES(8); */
NV_DECLARE_ALIGNED(NvP64 phDevices, 8);
/* C form: NvP64 phChannels NV_ALIGN_BYTES(8); */
NV_DECLARE_ALIGNED(NvP64 phChannels, 8);
NvV32 flags;
NvV32 timeout;
} NV0000_CTRL_GPU_IDLE_CHANNELS_PARAMS;
/* _ctrl0000gpu_h_ */

View File

@@ -0,0 +1,258 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2013-2015 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000gpuacct.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
/*
* NV0000_CTRL_CMD_GPUACCT_SET_ACCOUNTING_STATE
*
* This command is used to enable or disable the per process GPU accounting.
* This is part of GPU's software state and will persist if persistent
* software state is enabled. Refer to the description of
* NV0080_CTRL_CMD_GPU_MODIFY_SW_STATE_PERSISTENCE for more information.
*
* gpuId
* This parameter should specify a valid GPU ID value. Refer to the
* description of NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS for more
* information. If there is no GPU present with the specified ID,
* a status of NV_ERR_INVALID_ARGUMENT is returned.
* pid
* This input parameter specifies the process id of the process for which
* the accounting state needs to be set.
* In case of VGX host, this parameter specifies VGPU plugin(VM) pid. This
* parameter is set only when this RM control is called from VGPU plugin,
* otherwise it is zero meaning set/reset the accounting state for the
* specified GPU.
* newState
* This input parameter is used to enable or disable the GPU accounting.
* Possible values are:
* NV0000_CTRL_GPU_ACCOUNTING_STATE_ENABLED
* NV0000_CTRL_GPU_ACCOUNTING_STATE_DISABLED
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GPUACCT_SET_ACCOUNTING_STATE (0xb01) /* finn: Evaluated from "(FINN_NV01_ROOT_GPUACCT_INTERFACE_ID << 8) | NV0000_CTRL_GPUACCT_SET_ACCOUNTING_STATE_PARAMS_MESSAGE_ID" */
/* Possible values of persistentSwState */
#define NV0000_CTRL_GPU_ACCOUNTING_STATE_ENABLED (0x00000000)
#define NV0000_CTRL_GPU_ACCOUNTING_STATE_DISABLED (0x00000001)
#define NV0000_CTRL_GPUACCT_SET_ACCOUNTING_STATE_PARAMS_MESSAGE_ID (0x1U)
typedef struct NV0000_CTRL_GPUACCT_SET_ACCOUNTING_STATE_PARAMS {
NvU32 gpuId;
NvU32 pid;
NvU32 newState;
} NV0000_CTRL_GPUACCT_SET_ACCOUNTING_STATE_PARAMS;
/*
* NV0000_CTRL_CMD_GPUACCT_GET_ACCOUNTING_STATE
*
* This command is used to get the current state of GPU accounting.
*
* gpuId
* This parameter should specify a valid GPU ID value. Refer to the
* description of NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS for more
* information. If there is no GPU present with the specified ID,
* a status of NV_ERR_INVALID_ARGUMENT is returned.
* pid
* This input parameter specifies the process id of the process of which the
* accounting state needs to be queried.
* In case of VGX host, this parameter specifies VGPU plugin(VM) pid. This
* parameter is set only when this RM control is called from VGPU plugin,
* otherwise it is zero meaning the accounting state needs to be queried for
* the specified GPU.
* state
* This parameter returns a value indicating if per process GPU accounting
* is currently enabled or not for the specified GPU. See the
* description of NV0000_CTRL_CMD_GPU_SET_ACCOUNTING_STATE.
* Possible values are:
* NV0000_CTRL_GPU_ACCOUNTING_STATE_ENABLED
* NV0000_CTRL_GPU_ACCOUNTING_STATE_DISABLED
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GPUACCT_GET_ACCOUNTING_STATE (0xb02) /* finn: Evaluated from "(FINN_NV01_ROOT_GPUACCT_INTERFACE_ID << 8) | NV0000_CTRL_GPUACCT_GET_ACCOUNTING_STATE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPUACCT_GET_ACCOUNTING_STATE_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_CTRL_GPUACCT_GET_ACCOUNTING_STATE_PARAMS {
NvU32 gpuId;
NvU32 pid;
NvU32 state;
} NV0000_CTRL_GPUACCT_GET_ACCOUNTING_STATE_PARAMS;
/*
* NV0000_CTRL_GPUACCT_GET_PROC_ACCOUNTING_INFO_PARAMS
*
* This command returns GPU accounting data for the process.
*
* gpuId
* This parameter should specify a valid GPU ID value. Refer to the
* description of NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS for more
* information. If there is no GPU present with the specified ID,
* a status of NV_ERR_INVALID_ARGUMENT is returned.
* pid
* This parameter specifies the PID of the process for which information is
* to be queried.
* In case of VGX host, this parameter specifies VGPU plugin(VM) pid inside
* which the subPid is running. This parameter is set to VGPU plugin pid
* when this RM control is called from VGPU plugin.
* subPid
* In case of VGX host, this parameter specifies the PID of the process for
* which information is to be queried. In other cases, it is zero.
* gpuUtil
* This parameter returns the average GR utilization during the process's
* lifetime.
* fbUtil
* This parameter returns the average FB bandwidth utilization during the
* process's lifetime.
* maxFbUsage
* This parameter returns the maximum FB allocated (in bytes) by the process.
* startTime
* This parameter returns the time stamp value in micro seconds at the time
* process started utilizing GPU.
* stopTime
* This parameter returns the time stamp value in micro seconds at the time
* process stopped utilizing GPU.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GPUACCT_GET_PROC_ACCOUNTING_INFO (0xb03) /* finn: Evaluated from "(FINN_NV01_ROOT_GPUACCT_INTERFACE_ID << 8) | NV0000_CTRL_GPUACCT_GET_PROC_ACCOUNTING_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPUACCT_GET_PROC_ACCOUNTING_INFO_PARAMS_MESSAGE_ID (0x3U)
typedef struct NV0000_CTRL_GPUACCT_GET_PROC_ACCOUNTING_INFO_PARAMS {
NvU32 gpuId;
NvU32 pid;
NvU32 subPid;
NvU32 gpuUtil;
NvU32 fbUtil;
NV_DECLARE_ALIGNED(NvU64 maxFbUsage, 8);
NV_DECLARE_ALIGNED(NvU64 startTime, 8);
NV_DECLARE_ALIGNED(NvU64 endTime, 8);
} NV0000_CTRL_GPUACCT_GET_PROC_ACCOUNTING_INFO_PARAMS;
/*
* NV0000_CTRL_CMD_GPUACCT_GET_ACCOUNTING_PIDS
*
* This command is used to get the PIDS of processes with accounting
* information in the driver.
*
* gpuId
* This parameter should specify a valid GPU ID value. Refer to the
* description of NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS for more
* information. If there is no GPU present with the specified ID,
* a status of NV_ERR_INVALID_ARGUMENT is returned.
* pid
* This input parameter specifies the process id of the process of which the
* information needs to be queried.
* In case of VGX host, this parameter specifies VGPU plugin(VM) pid. This
* parameter is set only when this RM control is called from VGPU plugin,
* otherwise it is zero meaning get the pid list of the all the processes
* running on the specified GPU.
* pidTbl
* This parameter returns the table of all PIDs for which driver has
* accounting info.
* pidCount
* This parameter returns the number of entries in the PID table.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GPUACCT_GET_ACCOUNTING_PIDS (0xb04) /* finn: Evaluated from "(FINN_NV01_ROOT_GPUACCT_INTERFACE_ID << 8) | NV0000_CTRL_GPUACCT_GET_ACCOUNTING_PIDS_PARAMS_MESSAGE_ID" */
/* max size of pidTable */
#define NV0000_GPUACCT_PID_MAX_COUNT 4000
#define NV0000_CTRL_GPUACCT_GET_ACCOUNTING_PIDS_PARAMS_MESSAGE_ID (0x4U)
typedef struct NV0000_CTRL_GPUACCT_GET_ACCOUNTING_PIDS_PARAMS {
NvU32 gpuId;
NvU32 pid;
NvU32 pidTbl[NV0000_GPUACCT_PID_MAX_COUNT];
NvU32 pidCount;
} NV0000_CTRL_GPUACCT_GET_ACCOUNTING_PIDS_PARAMS;
/*
* NV0000_CTRL_CMD_GPUACCT_CLEAR_ACCOUNTING_DATA
*
* This command is used to clear previously collected GPU accounting data. This
* will have no affect on data for the running processes, accounting data for
* these processes will not be cleared and will still be logged for these
* processes. In order to clear ALL accounting data, accounting needs to be
* disabled using NV0000_CTRL_CMD_GPUACCT_SET_ACCOUNTING_STATE before executing
* this command.
*
* gpuId
* This parameter should specify a valid GPU ID value. Refer to the
* description of NV0000_CTRL_CMD_GPU_GET_ATTACHED_IDS for more
* information. If there is no GPU present with the specified ID,
* a status of NV_ERR_INVALID_ARGUMENT is returned.
* pid
* This input parameter specifies the process id of the process for which
* the accounting data needs to be cleared.
* In case of VGX host, this parameter specifies VGPU plugin(VM) pid for
* which the accounting data needs to be cleared. This parameter is set only
* when this RM control is called from VGPU plugin, otherwise it is zero
* meaning clear the accounting data of processes running on baremetal
* system.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_INVALID_STATE
*/
#define NV0000_CTRL_CMD_GPUACCT_CLEAR_ACCOUNTING_DATA (0xb05) /* finn: Evaluated from "(FINN_NV01_ROOT_GPUACCT_INTERFACE_ID << 8) | NV0000_CTRL_GPUACCT_CLEAR_ACCOUNTING_DATA_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GPUACCT_CLEAR_ACCOUNTING_DATA_PARAMS_MESSAGE_ID (0x5U)
typedef struct NV0000_CTRL_GPUACCT_CLEAR_ACCOUNTING_DATA_PARAMS {
NvU32 gpuId;
NvU32 pid;
} NV0000_CTRL_GPUACCT_CLEAR_ACCOUNTING_DATA_PARAMS;

View File

@@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2005-2016 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000gspc.finn
//

View File

@@ -0,0 +1,104 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2006-2015 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000gsync.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "ctrl/ctrlxxxx.h"
#include "class/cl30f1.h"
/* NV01_ROOT (client) system controller control commands and parameters */
/*
* NV0000_CTRL_CMD_GSYNC_GET_ATTACHED_IDS
*
* This command returns a table of attached gsyncId values.
* The table is NV0000_CTRL_GSYNC_MAX_ATTACHED_GSYNCS entries in size.
*
* gsyncIds[]
* This parameter returns the table of attached gsync IDs.
* The gsync ID is an opaque platform-dependent value that
* can be used with the NV0000_CTRL_CMD_GSYNC_GET_ID_INFO command to
* retrieve additional information about the gsync device.
* The valid entries in gsyncIds[] are contiguous, with a value
* of NV0000_CTRL_GSYNC_INVALID_ID indicating the invalid entries.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_OPERATING_SYSTEM
*/
#define NV0000_CTRL_CMD_GSYNC_GET_ATTACHED_IDS (0x301) /* finn: Evaluated from "(FINN_NV01_ROOT_GSYNC_INTERFACE_ID << 8) | NV0000_CTRL_GSYNC_GET_ATTACHED_IDS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GSYNC_GET_ATTACHED_IDS_PARAMS_MESSAGE_ID (0x1U)
typedef struct NV0000_CTRL_GSYNC_GET_ATTACHED_IDS_PARAMS {
NvU32 gsyncIds[NV30F1_MAX_GSYNCS];
} NV0000_CTRL_GSYNC_GET_ATTACHED_IDS_PARAMS;
/* this value marks entries in gsyncIds[] as invalid */
#define NV0000_CTRL_GSYNC_INVALID_ID (0xffffffff)
/*
* NV0000_CTRL_CMD_GSYNC_GET_ID_INFO
*
* This command returns gsync instance information for the
* specified gsync device.
*
* gsyncId
* This parameter should specify a valid gsync ID value.
* If there is no gsync present with the specified ID, a
* status of NV_ERR_INVALID_ARGUMENT is returned.
* gsyncFlags
* This parameter returns the current state of the gsync device.
* gsyncInstance
* This parameter returns the instance number associated with the
* specified gsync. This value can be used to instantiate
* a reference to the gsync using one of the NV30_GSYNC
* classes.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_PARAM_STRUCT
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_GSYNC_GET_ID_INFO (0x302) /* finn: Evaluated from "(FINN_NV01_ROOT_GSYNC_INTERFACE_ID << 8) | NV0000_CTRL_GSYNC_GET_ID_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_GSYNC_GET_ID_INFO_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_CTRL_GSYNC_GET_ID_INFO_PARAMS {
NvU32 gsyncId;
NvU32 gsyncFlags;
NvU32 gsyncInstance;
} NV0000_CTRL_GSYNC_GET_ID_INFO_PARAMS;
/* _ctrl0000gsync_h_ */

View File

@@ -0,0 +1,639 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2005-2021 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000nvd.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "ctrl/ctrlxxxx.h"
/* NV01_ROOT (client) nvd control commands and parameters */
/*
* NV0080_CTRL_NVD_DUMP_COMPONENT
*
* The following dump components are used to describe legal ranges in
* commands below:
*
* NV0080_CTRL_CMD_NVD_DUMP_COMPONENT_SYS
* This is the system dump component.
* NV0080_CTRL_CMD_NVD_DUMP_COMPONENT_NVLOG
* This is the nvlog dump component.
* NV0080_CTRL_CMD_NVD_DUMP_COMPONENT_RESERVED
* This component is reserved.
*
* See nvdump.h for more information on dump component values.
*/
#define NV0000_CTRL_NVD_DUMP_COMPONENT_SYS (0x400)
#define NV0000_CTRL_NVD_DUMP_COMPONENT_NVLOG (0x800)
#define NV0000_CTRL_NVD_DUMP_COMPONENT_RESERVED (0xB00)
/*
* NV0000_CTRL_CMD_NVD_GET_DUMP_SIZE
*
* This command gets the expected dump size of a particular system
* dump component. Note that events that occur between this command
* and a later NV0000_CTRL_CMD_NVD_GET_DUMP command could alter the size of
* the buffer required.
*
* component
* This parameter specifies the system dump component for which the
* dump size is desired. Legal values for this parameter must
* be greater than or equal to NV0000_CTRL_NVD_DUMP_COMPONENT_SYS and
* less than NV0000_CTRL_NVD_GET_DUMP_COMPONENT_NVLOG.
* size
* This parameter returns the expected size in bytes. The maximum
* value of this call is NV0000_CTRL_NVD_MAX_DUMP_SIZE.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT if components are invalid.
*/
#define NV0000_CTRL_CMD_NVD_GET_DUMP_SIZE (0x601) /* finn: Evaluated from "(FINN_NV01_ROOT_NVD_INTERFACE_ID << 8) | NV0000_CTRL_NVD_GET_DUMP_SIZE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_NVD_GET_DUMP_SIZE_PARAMS_MESSAGE_ID (0x1U)
typedef struct NV0000_CTRL_NVD_GET_DUMP_SIZE_PARAMS {
NvU32 component;
NvU32 size;
} NV0000_CTRL_NVD_GET_DUMP_SIZE_PARAMS;
/* Max size that a GET_DUMP_SIZE_PARAMS call can return */
#define NV0000_CTRL_NVD_MAX_DUMP_SIZE (1000000)
/*
* NV0000_CTRL_CMD_NVD_GET_DUMP
*
* This command gets a dump of a particular system dump component. If triggers
* is non-zero, the command waits for the trigger to occur before it returns.
*
* pBuffer
* This parameter points to the buffer for the data.
* component
* This parameter specifies the system dump component for which the
* dump is to be retrieved. Legal values for this parameter must
* be greater than or equal to NV0000_CTRL_NVD_DUMP_COMPONENT_SYS and
* less than NV0000_CTRL_NVD_GET_DUMP_COMPONENT_NVLOG.
* size
* On entry, this parameter specifies the maximum length for
* the returned data. On exit, it specifies the number of bytes
* returned.
*
* Possible status values returned are:
* NV_OK
* NVOS_ERROR_INVALID_ARGUMENT if components are invalid.
* NVOS_ERROR_INVALID_ADDRESS if pBuffer is invalid
* NVOS_ERROR_INVALID_???? if the buffer was too small
*/
#define NV0000_CTRL_CMD_NVD_GET_DUMP (0x602) /* finn: Evaluated from "(FINN_NV01_ROOT_NVD_INTERFACE_ID << 8) | NV0000_CTRL_NVD_GET_DUMP_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_NVD_GET_DUMP_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_CTRL_NVD_GET_DUMP_PARAMS {
NV_DECLARE_ALIGNED(NvP64 pBuffer, 8);
NvU32 component;
NvU32 size;
} NV0000_CTRL_NVD_GET_DUMP_PARAMS;
/*
* NV0000_CTRL_CMD_NVD_GET_TIMESTAMP
*
* This command returns the current value of the timestamp used
* by the RM in NvDebug dumps. It is provided to keep the RM and NvDebug
* clients on the same time base.
*
* cpuClkId
* See also NV2080_CTRL_CMD_TIMER_GET_GPU_CPU_TIME_CORRELATION_INFO
* This parameter specifies the source of the CPU clock. Legal values for
* this parameter include:
* NV0000_NVD_CPU_TIME_CLK_ID_DEFAULT and NV0000_NVD_CPU_TIME_CLK_ID_OSTIME
* This clock id will provide real time in microseconds since 00:00:00 UTC on January 1, 1970.
* It is calculated as follows:
* (seconds * 1000000) + uSeconds
* NV0000_NVD_CPU_TIME_CLK_ID_PLATFORM_API
* This clock id will provide time stamp that is constant-rate, high
* precision using platform API that is also available in the user mode.
* NV0000_NVD_CPU_TIME_CLK_ID_TSC
* This clock id will provide time stamp using CPU's time stamp counter.
*
* timestamp
* Retrieved timestamp
*
* Possible status values returned are:
* NV_OK
* NV_ERR_NOT_SUPPORTED
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_NVD_CPU_TIME_CLK_ID_DEFAULT (0x00000000)
#define NV0000_NVD_CPU_TIME_CLK_ID_OSTIME (0x00000001)
#define NV0000_NVD_CPU_TIME_CLK_ID_TSC (0x00000002)
#define NV0000_NVD_CPU_TIME_CLK_ID_PLATFORM_API (0x00000003)
#define NV0000_CTRL_CMD_NVD_GET_TIMESTAMP (0x603) /* finn: Evaluated from "(FINN_NV01_ROOT_NVD_INTERFACE_ID << 8) | NV0000_CTRL_NVD_GET_TIMESTAMP_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_NVD_GET_TIMESTAMP_PARAMS_MESSAGE_ID (0x3U)
typedef struct NV0000_CTRL_NVD_GET_TIMESTAMP_PARAMS {
NV_DECLARE_ALIGNED(NvU64 timestamp, 8);
NvU8 cpuClkId;
} NV0000_CTRL_NVD_GET_TIMESTAMP_PARAMS;
/*
* NV0000_CTRL_CMD_NVD_GET_NVLOG_INFO
*
* This command gets the current state of the NvLog buffer system.
*
* component (in)
* This parameter specifies the system dump component for which the
* NvLog info is desired. Legal values for this parameter must
* be greater than or equal to NV0000_CTRL_NVD_DUMP_COMPONENT_NVLOG and
* less than NV0000_CTRL_NVD_DUMP_COMPONENT_RESERVED.
* version (out)
* This parameter returns the version of the Nvlog subsystem.
* runtimeSizes (out)
* This parameter returns the array of sizes for all supported printf
* specifiers. This information is necessary to know how many bytes
* to decode when given a certain specifier (such as %d).
* The following describes the contents of each array entry:
* NV0000_CTRL_NVD_RUNTIME_SIZE_UNUSED
* This array entry has special meaning and is unused in the
* runtimeSizes array.
* NV0000_CTRL_NVD_RUNTIME_SIZE_INT
* This array entry returns the size of integer types for use in
* interpreting the %d, %u, %x, %X, %i, %o specifiers.
* NV0000_CTRL_NVD_RUNTIME_SIZE_LONG_LONG
* This array entry returns the size of long long integer types for
* using in interpreting the %lld, %llu, %llx, %llX, %lli, %llo
* specifiers.
* NV0000_CTRL_NVD_RUNTIME_SIZE_STRING
* This array entry returns zero as strings are not allowed.
* NV0000_CTRL_NVD_RUNTIME_SIZE_PTR
* This array entry returns the size of the pointer type for use
* in interpreting the %p specifier.
* NV0000_CTRL_NVD_RUNTIME_SIZE_CHAR
* This array entry returns the size of the char type for use in
* intpreting the %c specifier.
* NV0000_CTRL_NVD_RUNTIME_SIZE_FLOAT
* This array entry returns the size of the float types for use in
* in interpreting the %f, %g, %e, %F, %G, %E specifiers.
* All remaining entries are reserved and return 0.
* printFlags (out)
* This parameter returns the flags of the NvLog system.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_BUFFER_FLAGS
* See NV0000_CTRL_CMD_NVD_GET_NVLOG_BUF_INFO for more details.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_BUFFER_SIZE
* This field returns the buffer size in KBytes. A value of zero
* is returned when logging is disabled.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_TIMESTAMP
* This field returns the format of the timestamp. Legal values
* for this parameter include:
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_TIMESTAMP_NONE
* This value indicates no timestamp.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_TIMESTAMP_32BIT
* This value indicates a 32-bit timestamp.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_TIMESTAMP_64BIT
* This value indicates a 64-bit timestamp.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_TIMESTAMP_32BIT_DIFF
* This value indicates a 32-bit differential timestamp.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_RESERVED
* This field is reserved.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_RUNTIME_LEVEL
* This field returns the lowest debug level for which logging
* is enabled by default.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_INIT
* This field indicates if logging for the specified component has
* been initialized. Legal values for this parameter include:
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_INIT_NO
* This value indicates NvLog is uninitialized.
* NV0000_CTRL_NVD_NVLOG_PRINT_FLAGS_INIT_YES
* This value indicates NvLog has been initialized.
* signature (out)
* This parameter is the signature of the database
* required to decode these logs, autogenerated at buildtime.
* bufferTags (out)
* This parameter identifies the buffer tag used during allocation
* or a value of '0' if buffer is unallocated for each possible
* buffer.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT if components are invalid.
*/
#define NV0000_CTRL_CMD_NVD_GET_NVLOG_INFO (0x604) /* finn: Evaluated from "(FINN_NV01_ROOT_NVD_INTERFACE_ID << 8) | NV0000_CTRL_NVD_GET_NVLOG_INFO_PARAMS_MESSAGE_ID" */
/* maximum size of the runtimeSizes array */
#define NV0000_CTRL_NVD_MAX_RUNTIME_SIZES (16)
/* size of signature parameter */
#define NV0000_CTRL_NVD_SIGNATURE_SIZE (4)
/* Maximum number of buffers */
#define NV0000_CTRL_NVD_MAX_BUFFERS (256)
#define NV0000_CTRL_NVD_GET_NVLOG_INFO_PARAMS_MESSAGE_ID (0x4U)
typedef struct NV0000_CTRL_NVD_GET_NVLOG_INFO_PARAMS {
NvU32 component;
NvU32 version;
NvU8 runtimeSizes[NV0000_CTRL_NVD_MAX_RUNTIME_SIZES];
NvU32 printFlags;
NvU32 signature[NV0000_CTRL_NVD_SIGNATURE_SIZE];
NvU32 bufferTags[NV0000_CTRL_NVD_MAX_BUFFERS];
} NV0000_CTRL_NVD_GET_NVLOG_INFO_PARAMS;
/* runtimeSize array indices */
#define NV0000_CTRL_NVD_RUNTIME_SIZE_UNUSED (0)
#define NV0000_CTRL_NVD_RUNTIME_SIZE_INT (1)
#define NV0000_CTRL_NVD_RUNTIME_SIZE_LONG_LONG (2)
#define NV0000_CTRL_NVD_RUNTIME_SIZE_STRING (3)
#define NV0000_CTRL_NVD_RUNTIME_SIZE_PTR (4)
#define NV0000_CTRL_NVD_RUNTIME_SIZE_CHAR (5)
#define NV0000_CTRL_NVD_RUNTIME_SIZE_FLOAT (6)
/* printFlags fields and values */
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_BUFFER_INFO 7:0
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_BUFFER_SIZE 23:8
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_BUFFER_SIZE_DISABLE (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_BUFFER_SIZE_DEFAULT (0x00000004)
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_RUNTIME_LEVEL 28:25
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_TIMESTAMP 30:29
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_TIMESTAMP_NONE (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_TIMESTAMP_32 (0x00000001)
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_TIMESTAMP_64 (0x00000002)
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_TIMESTAMP_32_DIFF (0x00000003)
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_INITED 31:31
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_INITED_NO (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_INFO_PRINTFLAGS_INITED_YES (0x00000001)
/*
* NV0000_CTRL_CMD_NVD_GET_NVLOG_BUFFER_INFO
*
* This command gets the current state of a specific buffer in the NvLog
* buffer system.
*
* component (in)
* This parameter specifies the system dump component for which the
* NvLog info is desired. Legal values for this parameter must
* be greater than or equal to NV0000_CTRL_NVD_DUMP_COMPONENT_NVLOG and
* less than NV0000_CTRL_NVD_DUMP_COMPONENT_RESERVED.
* buffer (in/out)
* This parameter specifies the buffer number from which to retrieve the
* buffer information. Valid values are 0 to (NV0000_CTRL_NVD_MAX_BUFFERS - 1).
* If the buffer is specified using the 'tag' parameter, the buffer
* number is returned through this one.
* tag (in/out)
* If this parameter is non-zero, it will be used to specify the buffer,
* instead of 'buffer' parameter. It returns the tag of the specified buffer
* size (out)
* This parameter returns the size of the specified buffer.
* flags (in/out)
* On input, this parameter sets the following behavior:
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_PAUSE
* This flag controls if the nvlog system should pause output
* to this buffer.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_PAUSE_YES
* The buffer should be paused until another command
* unpauses this buffer.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_PAUSE_NO
* The buffer should not be paused.
* On output, this parameter returns the flags of a specified buffer:
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_DISABLED
* This flag indicates if logging to the specified buffer is
* disabled or not.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_TYPE
* This flag indicates the buffer logging type:
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_TYPE_RING
* This type value indicates logging to the buffer wraps.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_TYPE_NOWRAP
* This type value indicates logging to the buffer does not wrap.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_EXPANDABLE
* This flag indicates if the buffer size is expandable.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_EXPANDABLE_NO
* The buffer is not expandable.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_EXPANDABLE_YES
* The buffer is expandable.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_NON_PAGED
* This flag indicates if the buffer occupies non-paged or pageable
* memory.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_NON_PAGED_NO
* The buffer is in pageable memory.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_NON_PAGES_YES
* The buffer is in non-paged memory.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_LOCKING
* This flag indicates the locking mode for the specified buffer.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_LOCKING_NONE
* This locking value indicates that no locking is performed. This
* locking mode is typically used for inherently single-threaded
* buffers.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_LOCKING_STATE
* This locking value indicates that the buffer is locked only
* during state changes and that memory copying is unlocked. This
* mode should not be used tiny buffers that overflow every write
* or two.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_LOCKING_FULL
* This locking value indicates the buffer is locked for the full
* duration of the write.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_OCA
* This flag indicates if the buffer is stored in OCA dumps.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_OCA_NO
* The buffer is not included in OCA dumps.
* NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_OCA_YES
* The buffer is included in OCA dumps.
* pos (out)
* This parameter is the current position of the tracker/cursor in the
* buffer.
* overflow (out)
* This parameter is the number of times the buffer has overflowed.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT if components are invalid.
*/
#define NV0000_CTRL_CMD_NVD_GET_NVLOG_BUFFER_INFO (0x605) /* finn: Evaluated from "(FINN_NV01_ROOT_NVD_INTERFACE_ID << 8) | NV0000_CTRL_NVD_GET_NVLOG_BUFFER_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_NVD_GET_NVLOG_BUFFER_INFO_PARAMS_MESSAGE_ID (0x5U)
typedef struct NV0000_CTRL_NVD_GET_NVLOG_BUFFER_INFO_PARAMS {
NvU32 component;
NvU32 buffer;
NvU32 tag;
NvU32 size;
NvU32 flags;
NvU32 pos;
NvU32 overflow;
} NV0000_CTRL_NVD_GET_NVLOG_BUFFER_INFO_PARAMS;
/* flags fields and values */
/* input */
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_PAUSE 0:0
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_PAUSE_NO (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_PAUSE_YES (0x00000001)
/* output */
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_DISABLED 0:0
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_DISABLED_NO (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_DISABLED_YES (0x00000001)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_TYPE 1:1
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_TYPE_RING (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_TYPE_NOWRAP (0x00000001)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_EXPANDABLE 2:2
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_EXPANDABLE_NO (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_EXPANDABLE_YES (0x00000001)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_NONPAGED 3:3
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_NONPAGED_NO (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_NONPAGED_YES (0x00000001)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_LOCKING 5:4
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_LOCKING_NONE (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_LOCKING_STATE (0x00000001)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_LOCKING_FULL (0x00000002)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_OCA 6:6
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_OCA_NO (0x00000000)
#define NV0000_CTRL_NVD_NVLOG_BUFFER_INFO_FLAGS_OCA_YES (0x00000001)
/*
* NV0000_CTRL_CMD_NVD_GET_NVLOG
*
* This command retrieves the specified dump block from the specified
* NvLog buffer. To retrieve the entire buffer, the caller should start
* with blockNum set to 0 and continue issuing calls with an incremented
* blockNum until the returned size value is less than
* NV0000_CTRL_NVD_NVLOG_MAX_BLOCK_SIZE.
*
* component (in)
* This parameter specifies the system dump component for which the NvLog
* dump operation is to be directed. Legal values for this parameter
* must be greater than or equal to NV0000_CTRL_NVD_DUMP_COMPONENT_NVLOG
* and less than NV0000_CTRL_NVD_DUMP_COMPONENT_RESERVED.
* buffer (in)
* This parameter specifies the NvLog buffer to dump.
* blockNum (in)
* This parameter specifies the block number for which data is to be
* dumped.
* size (in/out)
* On entry, this parameter specifies the maximum length in bytes for
* the returned data (should be set to NV0000_CTRL_NVLOG_MAX_BLOCK_SIZE).
* On exit, it specifies the number of bytes returned.
* data (out)
* This parameter returns the data for the specified block. The size
* patameter values indicates the number of valid bytes returned.
*
* Possible status values returned are:
* NV_OK
* NVOS_ERROR_INVALID_ARGUMENT if components are invalid.
*/
#define NV0000_CTRL_CMD_NVD_GET_NVLOG (0x606) /* finn: Evaluated from "(FINN_NV01_ROOT_NVD_INTERFACE_ID << 8) | NV0000_CTRL_NVD_GET_NVLOG_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_NVLOG_MAX_BLOCK_SIZE (4000)
#define NV0000_CTRL_NVD_GET_NVLOG_PARAMS_MESSAGE_ID (0x6U)
typedef struct NV0000_CTRL_NVD_GET_NVLOG_PARAMS {
NvU32 component;
NvU32 buffer;
NvU32 blockNum;
NvU32 size;
NvU8 data[NV0000_CTRL_NVLOG_MAX_BLOCK_SIZE];
} NV0000_CTRL_NVD_GET_NVLOG_PARAMS;
/*
* NV0000_CTRL_CMD_NVD_GET_RCERR_RPT
*
* This command returns block of registers that were recorded at the time
* of an RC error for the current process.
*
* reqIdx:
* [IN] the index of the report being requested.
* index rolls over to 0.
* if the requested index is not in the circular buffer, then no data is
* transferred & either NV_ERR_INVALID_INDEX (indicating the specified
* index is not in the table) is returned.
*
* rptIdx:
* [OUT] the index of the report being returned.
* if the requested index is not in the circular buffer, then the value is
* undefined, no data istransferred & NV_ERR_INVALID_INDEX is returned.
* if the the specified index is present, but does not meet the requested
* criteria (refer to the owner & processId fields). the rptIdx will be
* set to a value that does not match the reqIdx, and no data will be
* transferred. NV_ERR_INSUFFICIENT_PERMISSIONS is still returned.
*
* gpuTag:
* [OUT] id of the GPU whose data was collected.
*
* rptTimeInNs:
* [OUT] the timestamp for when the report was created.
*
* startIdx:
* [OUT] the index of the oldest start record for the first report that
* matches the specified criteria (refer to the owner & processId
* fields). If no records match the specified criteria, this value is
* undefined, the failure code NV_ERR_MISSING_TABLE_ENTRY will
* be returned, and no data will be transferred.
*
* endIdx:
* [OUT] the index of the newest end record for the most recent report that
* matches the specified criteria (refer to the owner & processId
* fields). If no records match the specified criteria, this value is
* undefined, the failure code NV_ERR_MISSING_TABLE_ENTRY will
* be returned, and no data will be transferred.
*
* rptType:
* [OUT] indicator of what data is in the report.
*
* flags
* [OUT] a set odf flags indicating attributes of the record
* NV0000_CTRL_CMD_NVD_RCERR_RPT_FLAGS_POS_FIRST -- indicates this is the first record of a report.
* NV0000_CTRL_CMD_NVD_RCERR_RPT_FLAGS_POS_LAST -- indicates this is the last record of the report.
* NV0000_CTRL_CMD_NVD_RCERR_RPT_FLAGS_RANGE_VALID -- indicates this is the response contains a valid
* index range.
* Note, this may be set when an error is returned indicating a valid range was found, but event of
* the requested index was not.
* NV0000_CTRL_CMD_NVD_RCERR_RPT_FLAGS_DATA_VALID -- indicates this is the response contains valid data.
*
* rptCount:
* [OUT] number of entries returned in report.
*
* owner:
* [IN] Entries are only returned if they have the same owner as the specified owner or the specified
* owner Id is NV0000_CTRL_CMD_NVD_RPT_ANY_OWNER_ID.
* if the requested index is not owned by the specified owner, the rptIdx
* will be set to a value that does not match the reqIdx, and no data will
* be transferred. NV_ERR_INSUFFICIENT_PERMISSIONS is returned.
*
* processId:
* [IN] Deprecated
* report:
* [OUT] array of rptCount enum/value pair entries containing the data from the report.
* entries beyond rptCount are undefined.
*
*
* Possible status values returned are:
* NV_OK -- we found & transferred the requested record.
* NV_ERR_MISSING_TABLE_ENTRY -- we don't find any records that meet the criteria.
* NV_ERR_INVALID_INDEX -- the requested index was not found in the buffer.
* NV_ERR_INSUFFICIENT_PERMISSIONS -- the requested record was found, but it did not meet the criteria.
* NV_ERR_BUSY_RETRY -- We could not access the circular buffer.
*
*/
#define NV0000_CTRL_CMD_NVD_GET_RCERR_RPT (0x607) /* finn: Evaluated from "(FINN_NV01_ROOT_NVD_INTERFACE_ID << 8) | NV0000_CTRL_CMD_NVD_GET_RCERR_RPT_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_MAX_ENTRIES 200
// report types
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_TYPE_TEST 0
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_TYPE_GRSTATUS 1
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_TYPE_GPCSTATUS 2
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_TYPE_MMU_FAULT_STATUS 3
// pseudo register enums attribute content
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_REG_EMPTY 0x00000000
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_REG_OVERFLOWED 0x00000001 // number of missed entries.
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_REG_MAX_PSEDO_REG 0x0000000f
// Flags Definitions
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_FLAGS_POS_FIRST 0x00000001 // indicates this is the first record of a report.
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_FLAGS_POS_LAST 0x00000002 // indicates this is the last record of the report.
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_FLAGS_RANGE_VALID 0x00000004 // indicates this is the response contains a valid range
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_FLAGS_DATA_VALID 0x00000008 // indicates this is the response contains valid data
// Attribute Definitions
#define TPC_REG_ATTR(gpcId, tpcId) ((gpcId << 8) | (tpcId))
#define ROP_REG_ATTR(gpcId, ropId) ((gpcId << 8) | (ropId))
#define SM_REG_ATTR(gpcId, tpcId, smId) ((((gpcId) << 16) | ((tpcId) << 8)) | (smId))
// Process Id Pseudo values
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_ANY_PROCESS_ID 0x00000000 // get report for any process ID
#define NV0000_CTRL_CMD_NVD_RCERR_RPT_ANY_OWNER_ID 0xFFFFFFFF // get report for any owner ID
typedef struct NV0000_CTRL_CMD_NVD_RCERR_RPT_REG_ENTRY {
NvU32 tag;
NvU32 value;
NvU32 attribute;
} NV0000_CTRL_CMD_NVD_RCERR_RPT_REG_ENTRY;
#define NV0000_CTRL_CMD_NVD_GET_RCERR_RPT_PARAMS_MESSAGE_ID (0x7U)
typedef struct NV0000_CTRL_CMD_NVD_GET_RCERR_RPT_PARAMS {
NvU16 reqIdx;
NvU16 rptIdx;
NvU32 GPUTag;
NvU32 rptTime; // time in seconds since 1/1/1970
NvU16 startIdx;
NvU16 endIdx;
NvU16 rptType;
NvU32 flags;
NvU16 rptCount;
NvU32 owner; // indicating whose reports to get
NvU32 processId; // deprecated field
NV0000_CTRL_CMD_NVD_RCERR_RPT_REG_ENTRY report[NV0000_CTRL_CMD_NVD_RCERR_RPT_MAX_ENTRIES];
} NV0000_CTRL_CMD_NVD_GET_RCERR_RPT_PARAMS;
/*
* NV0000_CTRL_CMD_NVD_GET_DPC_ISR_TS
*
* This command returns the time stamp information that are collected from
* the execution of various DPCs/ISRs. This time stamp information is for
* debugging purposes only and would help with analyzing regressions and
* latencies for DPC/ISR execution times.
*
* tsBufferSize
* This field specifies the size of the buffer that the caller allocates.
* tsBuffer
* THis field specifies a pointer in the callers address space to the
* buffer into which the timestamp info on DPC/ISR is to be returned.
* This buffer must at least be as big as tsBufferSize.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_OPERATING_SYSTEM
*/
#define NV0000_CTRL_CMD_NVD_GET_DPC_ISR_TS (0x608) /* finn: Evaluated from "(FINN_NV01_ROOT_NVD_INTERFACE_ID << 8) | NV0000_CTRL_NVD_GET_DPC_ISR_TS_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_NVD_GET_DPC_ISR_TS_PARAMS_MESSAGE_ID (0x8U)
typedef struct NV0000_CTRL_NVD_GET_DPC_ISR_TS_PARAMS {
NvU32 tsBufferSize;
NV_DECLARE_ALIGNED(NvP64 pTSBuffer, 8);
} NV0000_CTRL_NVD_GET_DPC_ISR_TS_PARAMS;
/* _ctrl0000nvd_h_ */

View File

@@ -0,0 +1,101 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2014-2015 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000proc.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "nvlimits.h"
/*
* NV0000_CTRL_CMD_SET_SUB_PROCESS_ID
*
* Save the sub process ID and sub process name in client database
* subProcID
* Sub process ID
* subProcessName
* Sub process name
*
* In vGPU environment, sub process means the guest user/kernel process running
* within a single VM. It also refers to any sub process (or sub-sub process)
* within a parent process.
*
* Please refer to the wiki for more details about sub process concept: Resource_Server
*
* Possible return values are:
* NV_OK
*/
#define NV0000_CTRL_SET_SUB_PROCESS_ID_PARAMS_MESSAGE_ID (0x1U)
typedef struct NV0000_CTRL_SET_SUB_PROCESS_ID_PARAMS {
NvU32 subProcessID;
char subProcessName[NV_PROC_NAME_MAX_LENGTH];
} NV0000_CTRL_SET_SUB_PROCESS_ID_PARAMS;
/*
* NV0000_CTRL_CMD_DISABLE_SUB_PROCESS_USERD_ISOLATION
*
* Disable sub process USERD isolation.
* bIsSubProcIsolated
* NV_TRUE to disable sub process USERD isolation
*
* USERD allocated by different domains should not be put into the same physical page.
* This provides the basic security isolation because a physical page is the unit of
* granularity at which OS can provide isolation between processes.
*
* GUEST_USER: USERD allocated by guest user process
* GUEST_KERNEL: USERD allocated by guest kernel process
* GUEST_INSECURE: USERD allocated by guest/kernel process,
* INSECURE means there is no isolation between guest user and guest kernel
* HOST_USER: USERD allocated by host user process
* HOST_KERNEL: USERD allocated by host kernel process
*
* When sub process USERD isolation is disabled, we won't distinguish USERD allocated by guest
* user and guest kernel. They all belong to the GUEST_INSECURE domain.
*
* Please refer to wiki for more details: RM_USERD_Isolation
*
* Possible return values are:
* NV_OK
*/
#define NV0000_CTRL_DISABLE_SUB_PROCESS_USERD_ISOLATION_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_CTRL_DISABLE_SUB_PROCESS_USERD_ISOLATION_PARAMS {
NvBool bIsSubProcessDisabled;
} NV0000_CTRL_DISABLE_SUB_PROCESS_USERD_ISOLATION_PARAMS;
#define NV0000_CTRL_CMD_SET_SUB_PROCESS_ID (0x901) /* finn: Evaluated from "(FINN_NV01_ROOT_PROC_INTERFACE_ID << 8) | NV0000_CTRL_SET_SUB_PROCESS_ID_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_CMD_DISABLE_SUB_PROCESS_USERD_ISOLATION (0x902) /* finn: Evaluated from "(FINN_NV01_ROOT_PROC_INTERFACE_ID << 8) | NV0000_CTRL_DISABLE_SUB_PROCESS_USERD_ISOLATION_PARAMS_MESSAGE_ID" */
/* _ctrl0000proc_h_ */

View File

@@ -0,0 +1,115 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2015-2021 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000syncgpuboost.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "ctrl/ctrlxxxx.h"
#include "nvtypes.h"
#include "nvlimits.h"
/* --------------------------- Macros ----------------------------------------*/
// There are at least 2 GPUs in a sync group. Hence max is half of max devices.
#define NV0000_SYNC_GPU_BOOST_MAX_GROUPS (0x10) /* finn: Evaluated from "((NV_MAX_DEVICES) >> 1)" */
#define NV0000_SYNC_GPU_BOOST_INVALID_GROUP_ID 0xFFFFFFFF
/*-------------------------Command Prototypes---------------------------------*/
/*!
* Query whether SYNC GPU BOOST MANAGER is enabled or disabled.
*/
#define NV0000_CTRL_CMD_SYNC_GPU_BOOST_INFO (0xa01) /* finn: Evaluated from "(FINN_NV01_ROOT_SYNC_GPU_BOOST_INTERFACE_ID << 8) | NV0000_SYNC_GPU_BOOST_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_SYNC_GPU_BOOST_INFO_PARAMS_MESSAGE_ID (0x1U)
typedef struct NV0000_SYNC_GPU_BOOST_INFO_PARAMS {
// [out] Specifies if Sync Gpu Boost Manager is enabled or not.
NvBool bEnabled;
} NV0000_SYNC_GPU_BOOST_INFO_PARAMS;
/*!
* Creates a Synchronized GPU-Boost Group (SGBG)
*/
#define NV0000_CTRL_CMD_SYNC_GPU_BOOST_GROUP_CREATE (0xa02) /* finn: Evaluated from "(FINN_NV01_ROOT_SYNC_GPU_BOOST_INTERFACE_ID << 8) | NV0000_SYNC_GPU_BOOST_GROUP_CREATE_PARAMS_MESSAGE_ID" */
/*!
* Describes a Synchronized GPU-Boost Group configuration
*/
typedef struct NV0000_SYNC_GPU_BOOST_GROUP_CONFIG {
// [in] Number of elements in @ref gpuIds
NvU32 gpuCount;
// [in] IDs of GPUs to be put in the Sync Boost Group
NvU32 gpuIds[NV_MAX_DEVICES];
// [out] Unique ID of the SGBG, if created
NvU32 boostGroupId;
// [in] If this group represents bridgeless SLI
NvBool bBridgeless;
} NV0000_SYNC_GPU_BOOST_GROUP_CONFIG;
#define NV0000_SYNC_GPU_BOOST_GROUP_CREATE_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_SYNC_GPU_BOOST_GROUP_CREATE_PARAMS {
NV0000_SYNC_GPU_BOOST_GROUP_CONFIG boostConfig;
} NV0000_SYNC_GPU_BOOST_GROUP_CREATE_PARAMS;
/*!
* Destroys a previously created Synchronized GPU-Boost Group(SGBG)
*/
#define NV0000_CTRL_CMD_SYNC_GPU_BOOST_GROUP_DESTROY (0xa03) /* finn: Evaluated from "(FINN_NV01_ROOT_SYNC_GPU_BOOST_INTERFACE_ID << 8) | NV0000_SYNC_GPU_BOOST_GROUP_DESTROY_PARAMS_MESSAGE_ID" */
#define NV0000_SYNC_GPU_BOOST_GROUP_DESTROY_PARAMS_MESSAGE_ID (0x3U)
typedef struct NV0000_SYNC_GPU_BOOST_GROUP_DESTROY_PARAMS {
// [[in] Unique ID of the SGBG to be destroyed
NvU32 boostGroupId;
} NV0000_SYNC_GPU_BOOST_GROUP_DESTROY_PARAMS;
/*!
* Get configuration information for all Synchronized Boost Groups in the system.
*/
#define NV0000_CTRL_CMD_SYNC_GPU_BOOST_GROUP_INFO (0xa04) /* finn: Evaluated from "(FINN_NV01_ROOT_SYNC_GPU_BOOST_INTERFACE_ID << 8) | NV0000_SYNC_GPU_BOOST_GROUP_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_SYNC_GPU_BOOST_GROUP_INFO_PARAMS_MESSAGE_ID (0x4U)
typedef struct NV0000_SYNC_GPU_BOOST_GROUP_INFO_PARAMS {
// [out] Number of groups retrieved. @ref NV0000_SYNC_GPU_BOOST_GROUP_INFO_PARAMS::boostGroups
NvU32 groupCount;
// [out] @ref NV0000_SYNC_GPU_BOOST_GROUP_CONFIG
NV0000_SYNC_GPU_BOOST_GROUP_CONFIG pBoostGroups[NV0000_SYNC_GPU_BOOST_MAX_GROUPS];
} NV0000_SYNC_GPU_BOOST_GROUP_INFO_PARAMS;
/* _ctrl0000syncgpuboost_h_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,433 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2009-2021 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000unix.finn
//
#include "ctrl/ctrl0000/ctrl0000base.h"
#include "ctrl/ctrlxxxx.h"
/* NV01_ROOT (client) Linux control commands and parameters */
/*
* NV0000_CTRL_CMD_OS_UNIX_FLUSH_USER_CACHE
*
* This command may be used to force a cache flush for a range of virtual addresses in
* memory. Can be used for either user or kernel addresses.
*
* offset, length
* These parameters specify the offset within the memory block
* and the number of bytes to flush/invalidate
* cacheOps
* This parameter flags whether to flush, invalidate or do both.
* Possible values are:
* NV0000_CTRL_OS_UNIX_FLAGS_USER_CACHE_FLUSH
* NV0000_CTRL_OS_UNIX_FLAGS_USER_CACHE_INVALIDATE
* NV0000_CTRL_OS_UNIX_FLAGS_USER_CACHE_FLUSH_INVALIDATE
* hDevice
* This parameter is the handle to the device
* hObject
* This parameter is the handle to the memory structure being operated on.
* internalOnly
* Intended for internal use unless client is running in MODS UNIX environment,
* in which case this parameter specify the virtual address of the memory block
* to flush.
*
* Possible status values are:
* NV_OK
* NV_ERR_OBJECT_NOT_FOUND
* NV_ERR_INVALID_OBJECT_HANDLE
* NV_ERR_INVALID_COMMAND
* NV_ERR_INVALID_LIMIT
* NV_ERR_NOT_SUPPORTED
*/
#define NV0000_CTRL_CMD_OS_UNIX_FLUSH_USER_CACHE (0x3d02) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | NV0000_CTRL_OS_UNIX_FLUSH_USER_CACHE_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_OS_UNIX_FLUSH_USER_CACHE_PARAMS_MESSAGE_ID (0x2U)
typedef struct NV0000_CTRL_OS_UNIX_FLUSH_USER_CACHE_PARAMS {
NV_DECLARE_ALIGNED(NvU64 offset, 8);
NV_DECLARE_ALIGNED(NvU64 length, 8);
NvU32 cacheOps;
NvHandle hDevice;
NvHandle hObject;
NV_DECLARE_ALIGNED(NvU64 internalOnly, 8);
} NV0000_CTRL_OS_UNIX_FLUSH_USER_CACHE_PARAMS;
#define NV0000_CTRL_OS_UNIX_FLAGS_USER_CACHE_FLUSH (0x00000001)
#define NV0000_CTRL_OS_UNIX_FLAGS_USER_CACHE_INVALIDATE (0x00000002)
#define NV0000_CTRL_OS_UNIX_FLAGS_USER_CACHE_FLUSH_INVALIDATE (0x00000003)
/*
* NV0000_CTRL_CMD_OS_UNIX_GET_CONTROL_FILE_DESCRIPTOR
*
* This command is used to get the control file descriptor.
*
* Possible status values returned are:
* NV_OK
*
*/
#define NV0000_CTRL_CMD_OS_UNIX_GET_CONTROL_FILE_DESCRIPTOR (0x3d04) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | 0x4" */
typedef struct NV0000_CTRL_OS_UNIX_GET_CONTROL_FILE_DESCRIPTOR_PARAMS {
NvS32 fd;
} NV0000_CTRL_OS_UNIX_GET_CONTROL_FILE_DESCRIPTOR_PARAMS;
typedef enum NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TYPE {
NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TYPE_NONE = 0,
NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TYPE_RM = 1,
} NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TYPE;
typedef struct NV0000_CTRL_OS_UNIX_EXPORT_OBJECT {
NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TYPE type;
union {
struct {
NvHandle hDevice;
NvHandle hParent;
NvHandle hObject;
} rmObject;
} data;
} NV0000_CTRL_OS_UNIX_EXPORT_OBJECT;
/*
* NV0000_CTRL_CMD_OS_UNIX_EXPORT_OBJECT_TO_FD
*
* This command may be used to export NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TYPE
* object to file descriptor.
*
* Note that the 'fd' parameter is an input parameter at the kernel level, but
* an output parameter for usermode RMAPI clients -- the RMAPI library will
* open a new FD automatically if a usermode RMAPI client exports an object.
*
* Kernel-mode RM clients can export an object to an FD in two steps:
* 1. User client calls this RMControl with the flag 'EMPTY_FD_TRUE' to create
* an empty FD to receive the object, then passes that FD to the kernel-mode
* RM client.
* 2. Kernel-mode RM client fills in the rest of the
* NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_PARAMS as usual and calls RM to
* associate its desired RM object with the empty FD from its usermode
* client.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_NOT_SUPPORTED
* NV_ERR_OBJECT_NOT_FOUND
* NV_ERR_INVALID_OBJECT_HANDLE
* NV_ERR_INVALID_PARAMETER
*/
#define NV0000_CTRL_CMD_OS_UNIX_EXPORT_OBJECT_TO_FD (0x3d05) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_PARAMS_MESSAGE_ID (0x5U)
typedef struct NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_PARAMS {
NV0000_CTRL_OS_UNIX_EXPORT_OBJECT object; /* IN */
NvS32 fd; /* IN/OUT */
NvU32 flags; /* IN */
} NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_PARAMS;
/*
* If EMPTY_FD is TRUE, the 'fd' will be created but no object will be
* associated with it. The hDevice parameter is still required, to determine
* the correct device node on which to create the file descriptor.
* (An empty FD can then be passed to a kernel-mode driver to associate it with
* an actual object.)
*/
#define NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_FLAGS_EMPTY_FD 0:0
#define NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_FLAGS_EMPTY_FD_FALSE (0x00000000)
#define NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_FLAGS_EMPTY_FD_TRUE (0x00000001)
/*
* NV0000_CTRL_CMD_OS_UNIX_IMPORT_OBJECT_FROM_FD
*
* This command may be used to import back
* NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TYPE object from file descriptor.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_NOT_SUPPORTED
* NV_ERR_OBJECT_NOT_FOUND
* NV_ERR_INVALID_OBJECT_HANDLE
* NV_ERR_INVALID_PARAMETER
*/
#define NV0000_CTRL_CMD_OS_UNIX_IMPORT_OBJECT_FROM_FD (0x3d06) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | NV0000_CTRL_OS_UNIX_IMPORT_OBJECT_FROM_FD_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_OS_UNIX_IMPORT_OBJECT_FROM_FD_PARAMS_MESSAGE_ID (0x6U)
typedef struct NV0000_CTRL_OS_UNIX_IMPORT_OBJECT_FROM_FD_PARAMS {
NvS32 fd; /* IN */
NV0000_CTRL_OS_UNIX_EXPORT_OBJECT object; /* IN */
} NV0000_CTRL_OS_UNIX_IMPORT_OBJECT_FROM_FD_PARAMS;
/*
* NV0000_CTRL_CMD_OS_GET_GPU_INFO
*
* This command will query the OS specific info for the specified GPU.
*
* gpuId
* This parameter should specify a valid GPU ID value. If there
* is no GPU present with the specified ID, a status of
* NV_ERR_INVALID_ARGUMENT is returned.
* minorNum
* This parameter returns minor number of device node.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
*/
#define NV0000_CTRL_CMD_OS_GET_GPU_INFO (0x3d07) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | 0x7" */
typedef struct NV0000_CTRL_OS_GET_GPU_INFO_PARAMS {
NvU32 gpuId; /* IN */
NvU32 minorNum; /* OUT */
} NV0000_CTRL_OS_GET_GPU_INFO_PARAMS;
/*
* NV0000_CTRL_CMD_OS_UNIX_GET_EXPORT_OBJECT_INFO
*
* This command will query the deviceInstance for the specified FD
* which is referencing an exported object.
*
* fd
* File descriptor parameter is referencing an exported object on a Unix system.
*
* deviceInstatnce
* This parameter returns a deviceInstance on which the object is located.
*
* maxObjects
* This parameter returns the maximum number of object handles that may be
* contained in the file descriptor.
*
* metadata
* This parameter returns the user metadata passed into the
* _EXPORT_OBJECTS_TO_FD control call.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
* NV_ERR_OBJECT_NOT_FOUND
*/
#define NV0000_CTRL_CMD_OS_UNIX_GET_EXPORT_OBJECT_INFO (0x3d08) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS_MESSAGE_ID" */
#define NV0000_OS_UNIX_EXPORT_OBJECT_FD_BUFFER_SIZE 64
#define NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS_MESSAGE_ID (0x8U)
typedef struct NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS {
NvS32 fd; /* IN */
NvU32 deviceInstance; /* OUT */
NvU16 maxObjects; /* OUT */
NvU8 metadata[NV0000_OS_UNIX_EXPORT_OBJECT_FD_BUFFER_SIZE]; /* OUT */
} NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS;
/*
* NV0000_CTRL_CMD_OS_UNIX_REFRESH_RMAPI_DEVICE_LIST
*
* This command will re-fetch probed GPUs information and update RMAPI library's
* internal detected GPU context information accordingly. Without this, GPUs
* attached to RM after RMAPI client initialization will not be accessible and
* all RMAPI library calls will fail on them.
* Currently this is used by NVSwitch Fabric Manager in conjunction with NVSwitch
* Shared Virtualization feature where GPUs are hot-plugged to OS/RM (by Hypervisor)
* and Fabric Manager is signaled externally by the Hypervisor to initialize those GPUs.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_STATE
* NV_ERR_OPERATING_SYSTEM
*/
#define NV0000_CTRL_CMD_OS_UNIX_REFRESH_RMAPI_DEVICE_LIST (0x3d09) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | 0x9" */
/*
* This control call has been deprecated. It will be deleted soon.
* Use NV0000_CTRL_CMD_OS_UNIX_EXPORT_OBJECT_TO_FD (singular) or
* NV0000_CTRL_CMD_OS_UNIX_EXPORT_OBJECTS_TO_FD (plural) instead.
*/
#define NV0000_CTRL_CMD_OS_UNIX_CREATE_EXPORT_OBJECT_FD (0x3d0a) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | NV0000_CTRL_OS_UNIX_CREATE_EXPORT_OBJECT_FD_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_OS_UNIX_CREATE_EXPORT_OBJECT_FD_BUFFER_SIZE NV0000_OS_UNIX_EXPORT_OBJECT_FD_BUFFER_SIZE
#define NV0000_CTRL_OS_UNIX_CREATE_EXPORT_OBJECT_FD_PARAMS_MESSAGE_ID (0xAU)
typedef struct NV0000_CTRL_OS_UNIX_CREATE_EXPORT_OBJECT_FD_PARAMS {
NvHandle hDevice; /* IN */
NvU16 maxObjects; /* IN */
NvU8 metadata[NV0000_CTRL_OS_UNIX_CREATE_EXPORT_OBJECT_FD_BUFFER_SIZE]; /* IN */
NvS32 fd; /* IN/OUT */
} NV0000_CTRL_OS_UNIX_CREATE_EXPORT_OBJECT_FD_PARAMS;
/*
* NV0000_CTRL_CMD_OS_UNIX_EXPORT_OBJECTS_TO_FD
*
* Exports RM handles to an fd that was provided, also creates an FD if
* requested.
*
* The objects in the 'handles' array are exported into the fd
* as the range [index, index + numObjects).
*
* If index + numObjects is greater than the maxObjects value used
* to create the file descriptor, NV_ERR_INVALID_PARAMETER is returned.
*
* If 'numObjects and 'index' overlap with a prior call, the newer call's RM object
* handles will overwrite the previously exported handles from the previous call.
* This overlapping behavior can also be used to unexport a handle by setting
* the appropriate object in 'objects' to 0.
*
* fd
* A file descriptor. If -1, a new FD will be created.
*
* hDevice
* The owning device of the objects to be exported (must be the same for
* all objects).
*
* maxObjects
* The total number of objects that the client wishes to export to the FD.
* This parameter will be honored only when the FD is getting created.
*
* metadata
* A buffer for clients to write some metadata to and pass to the importing
* client. This parameter will be honored only when the FD is getting
* created.
*
* objects
* Array of RM object handles to export to the fd.
*
* numObjects
* The number of handles the user wishes to export in this call.
*
* index
* The index into the export fd at which to start exporting the handles in
* 'objects' (for use in iterative calls).
*
* Possible status values returned are:
* NV_OK
* NV_ERR_OUT_OF_RANGE
* NV_ERR_NOT_SUPPORTED
* NV_ERR_OBJECT_NOT_FOUND
* NV_ERR_INVALID_OBJECT_HANDLE
*/
#define NV0000_CTRL_CMD_OS_UNIX_EXPORT_OBJECTS_TO_FD (0x3d0b) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | NV0000_CTRL_OS_UNIX_EXPORT_OBJECTS_TO_FD_PARAMS_MESSAGE_ID" */
#define NV0000_CTRL_OS_UNIX_EXPORT_OBJECTS_TO_FD_MAX_OBJECTS 512
#define NV0000_CTRL_OS_UNIX_EXPORT_OBJECTS_TO_FD_PARAMS_MESSAGE_ID (0xBU)
typedef struct NV0000_CTRL_OS_UNIX_EXPORT_OBJECTS_TO_FD_PARAMS {
NvS32 fd; /* IN/OUT */
NvHandle hDevice; /* IN */
NvU16 maxObjects; /* IN */
NvU8 metadata[NV0000_OS_UNIX_EXPORT_OBJECT_FD_BUFFER_SIZE]; /* IN */
NvHandle objects[NV0000_CTRL_OS_UNIX_EXPORT_OBJECTS_TO_FD_MAX_OBJECTS]; /* IN */
NvU16 numObjects; /* IN */
NvU16 index; /* IN */
} NV0000_CTRL_OS_UNIX_EXPORT_OBJECTS_TO_FD_PARAMS;
/*
* NV0000_CTRL_CMD_OS_UNIX_IMPORT_OBJECTS_FROM_FD
*
* This command can be used to import back RM handles
* that were exported to an fd using the
* NV0000_CTRL_CMD_OS_UNIX_EXPORT_OBJECTS_TO_FD control call.
*
* If index + numObjects is greater than the maxObjects value used
* to create the file descriptor, NV_ERR_INVALID_PARAMETER is returned
* and no objects are imported.
*
* For each valid handle in the 'objects' array parameter at index 'i',
* the corresponding object handle at index ('i' + 'index') contained by
* the fd will be imported. If the object at index ('i' + 'index') has
* not been exported into the fd, no object will be imported.
*
* If any of handles contained in the 'objects' array parameter are invalid
* and the corresponding export object handle is valid,
* NV_ERR_INVALID_PARAMETER will be returned and no handles will be imported.
*
* fd
* The export fd on which to import handles out of.
*
* hParent
* The parent RM handle of which all of the exported objects will
* be duped under.
*
* objects
* An array of RM handles. The exported objects will be duped under
* these handles during the import process.
*
* objectTypes
* An array of RM handle types. The type _NONE will be returned if
* the object was not imported. Other possible object types are
* mentioned below.
*
* numObjects
* The number of valid object handles in the 'objects' array. This should
* be set to the number of objects that the client wishes to import.
*
* index
* The index into the fd in which to start importing from. For
* use in iterative calls.
*
* Possible status values returned are:
* NV_OK
* NV_ERR_OUT_OF_RANGE
* NV_ERR_NOT_SUPPORTED
* NV_ERR_OBJECT_NOT_FOUND
* NV_ERR_INVALID_OBJECT_HANDLE
* NV_ERR_INVALID_PARAMETER
*/
#define NV0000_CTRL_CMD_OS_UNIX_IMPORT_OBJECTS_FROM_FD (0x3d0c) /* finn: Evaluated from "(FINN_NV01_ROOT_OS_UNIX_INTERFACE_ID << 8) | NV0000_CTRL_OS_UNIX_IMPORT_OBJECTS_FROM_FD_PARAMS_MESSAGE_ID" */
//
// TODO Bump this back up to 512 after the FLA revamp is complete
//
#define NV0000_CTRL_OS_UNIX_IMPORT_OBJECTS_TO_FD_MAX_OBJECTS 128
#define NV0000_CTRL_CMD_OS_UNIX_IMPORT_OBJECT_TYPE_NONE 0
#define NV0000_CTRL_CMD_OS_UNIX_IMPORT_OBJECT_TYPE_VIDMEM 1
#define NV0000_CTRL_CMD_OS_UNIX_IMPORT_OBJECT_TYPE_SYSMEM 2
#define NV0000_CTRL_CMD_OS_UNIX_IMPORT_OBJECT_TYPE_FABRIC 3
#define NV0000_CTRL_OS_UNIX_IMPORT_OBJECTS_FROM_FD_PARAMS_MESSAGE_ID (0xCU)
typedef struct NV0000_CTRL_OS_UNIX_IMPORT_OBJECTS_FROM_FD_PARAMS {
NvS32 fd; /* IN */
NvHandle hParent; /* IN */
NvHandle objects[NV0000_CTRL_OS_UNIX_IMPORT_OBJECTS_TO_FD_MAX_OBJECTS]; /* IN */
NvU8 objectTypes[NV0000_CTRL_OS_UNIX_IMPORT_OBJECTS_TO_FD_MAX_OBJECTS]; /* OUT */
NvU16 numObjects; /* IN */
NvU16 index; /* IN */
} NV0000_CTRL_OS_UNIX_IMPORT_OBJECTS_FROM_FD_PARAMS;
/* _ctrl0000unix_h_ */

View File

@@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2016-2018 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.
*/
#pragma once
#include <nvtypes.h>
//
// This file was generated with FINN, an NVIDIA coding tool.
// Source file: ctrl/ctrl0000/ctrl0000vgpu.finn
//