mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-02 06:29:47 +00:00
550.54.14
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
@@ -36,7 +36,36 @@ extern "C" {
|
||||
#define RUSD_TIMESTAMP_WRITE_IN_PROGRESS (NV_U64_MAX)
|
||||
#define RUSD_TIMESTAMP_INVALID 0
|
||||
|
||||
#define RUSD_SEQ_DATA_VALID(x) ((((NvU32)(x)) & 0x1U) == 0)
|
||||
// seq = c_0 * b_0 + c_1 * (b_0 - 1) where c_0 == open_count and c_1 == close_count
|
||||
// When they are equal, data is valid, otherwise data is being written.
|
||||
// b_0 == 1 mod (b_0 - 1) and b_0 - 1 == (-1) mod b_0
|
||||
// So, c_0 == seq mod (b_0 - 1) and c_1 == (-1 * seq) mod b_0
|
||||
// c_1 cannot be calculated quite so naively because negative modulos aren't fun, so we
|
||||
// instead do c_1 == (b_0 - (seq mod b_0)) mod b_0
|
||||
//
|
||||
#define RUSD_SEQ_BASE_SHIFT 20llu
|
||||
#define RUSD_SEQ_BASE0 (1llu << RUSD_SEQ_BASE_SHIFT)
|
||||
#define RUSD_SEQ_BASE1 (RUSD_SEQ_BASE0 - 1llu)
|
||||
#define RUSD_SEQ_COEFF1(x) ((RUSD_SEQ_BASE0 - ((x) % RUSD_SEQ_BASE0)) % RUSD_SEQ_BASE0)
|
||||
#define RUSD_SEQ_COEFF0(x) ((x) % RUSD_SEQ_BASE1)
|
||||
#define RUSD_SEQ_WRAP_SHIFT 18llu
|
||||
#define RUSD_SEQ_WRAP_VAL (1llu << RUSD_SEQ_WRAP_SHIFT)
|
||||
#define RUSD_SEQ_DATA_VALID(x) (RUSD_SEQ_COEFF0(x) == RUSD_SEQ_COEFF1(x))
|
||||
|
||||
//
|
||||
// Helper macros to check seq before reading RUSD.
|
||||
// No dowhile wrap as it is using continue/break
|
||||
//
|
||||
#define RUSD_SEQ_CHECK1(SHARED_DATA) \
|
||||
NvU64 seq = (SHARED_DATA)->seq; \
|
||||
portAtomicMemoryFenceLoad(); \
|
||||
if (!RUSD_SEQ_DATA_VALID(seq)) \
|
||||
continue;
|
||||
|
||||
#define RUSD_SEQ_CHECK2(SHARED_DATA) \
|
||||
portAtomicMemoryFenceLoad(); \
|
||||
if (seq == (SHARED_DATA)->seq) \
|
||||
break;
|
||||
|
||||
enum {
|
||||
RUSD_CLK_PUBLIC_DOMAIN_GRAPHICS = 0,
|
||||
@@ -166,10 +195,12 @@ typedef struct RUSD_INST_POWER_USAGE {
|
||||
} RUSD_INST_POWER_USAGE;
|
||||
|
||||
typedef struct NV00DE_SHARED_DATA {
|
||||
volatile NvU32 seq;
|
||||
volatile NvU64 seq;
|
||||
|
||||
NvU32 bar1Size;
|
||||
NvU32 bar1AvailSize;
|
||||
NvU64 totalPmaMemory;
|
||||
NvU64 freePmaMemory;
|
||||
|
||||
// GSP polling data section
|
||||
NV_DECLARE_ALIGNED(RUSD_CLK_PUBLIC_DOMAIN_INFOS clkPublicDomainInfos, 8);
|
||||
|
||||
@@ -853,7 +853,8 @@ typedef struct NVA081_CTRL_PGPU_GET_VGPU_STREAMING_CAPABILITY_PARAMS {
|
||||
} NVA081_CTRL_PGPU_GET_VGPU_STREAMING_CAPABILITY_PARAMS;
|
||||
|
||||
/* vGPU capabilities */
|
||||
#define NVA081_CTRL_VGPU_CAPABILITY_MINI_QUARTER_GPU 0
|
||||
#define NVA081_CTRL_VGPU_CAPABILITY_MINI_QUARTER_GPU 0
|
||||
#define NVA081_CTRL_VGPU_CAPABILITY_COMPUTE_MEDIA_ENGINE_GPU 1
|
||||
|
||||
/*
|
||||
* NVA081_CTRL_CMD_VGPU_SET_CAPABILITY
|
||||
@@ -872,7 +873,7 @@ typedef struct NVA081_CTRL_PGPU_GET_VGPU_STREAMING_CAPABILITY_PARAMS {
|
||||
* NV_ERR_OBJECT_NOT_FOUND
|
||||
* NV_ERR_INVALID_ARGUMENT
|
||||
*/
|
||||
#define NVA081_CTRL_CMD_VGPU_SET_CAPABILITY (0xa081011e) /* finn: Evaluated from "(FINN_NVA081_VGPU_CONFIG_VGPU_CONFIG_INTERFACE_ID << 8) | NVA081_CTRL_VGPU_SET_CAPABILITY_PARAMS_MESSAGE_ID" */
|
||||
#define NVA081_CTRL_CMD_VGPU_SET_CAPABILITY (0xa081011e) /* finn: Evaluated from "(FINN_NVA081_VGPU_CONFIG_VGPU_CONFIG_INTERFACE_ID << 8) | NVA081_CTRL_VGPU_SET_CAPABILITY_PARAMS_MESSAGE_ID" */
|
||||
|
||||
#define NVA081_CTRL_VGPU_SET_CAPABILITY_PARAMS_MESSAGE_ID (0x1eU)
|
||||
|
||||
@@ -881,4 +882,30 @@ typedef struct NVA081_CTRL_VGPU_SET_CAPABILITY_PARAMS {
|
||||
NvBool state;
|
||||
} NVA081_CTRL_VGPU_SET_CAPABILITY_PARAMS;
|
||||
|
||||
/*
|
||||
* NVA081_CTRL_CMD_VGPU_GET_CAPABILITY
|
||||
*
|
||||
* This command is to get state of vGPU capability for the physical GPU.
|
||||
*
|
||||
* capability [IN]
|
||||
* This param specifies the requested capabiity of the device that is to be set
|
||||
* One of NVA081_CTRL_VGPU_CAPABILITY* values
|
||||
*
|
||||
* state [OUT]
|
||||
* This param specifies the state of the capability
|
||||
*
|
||||
* Possible status values returned are:
|
||||
* NV_OK
|
||||
* NV_ERR_OBJECT_NOT_FOUND
|
||||
* NV_ERR_INVALID_ARGUMENT
|
||||
*/
|
||||
#define NVA081_CTRL_CMD_VGPU_GET_CAPABILITY (0xa081011f) /* finn: Evaluated from "(FINN_NVA081_VGPU_CONFIG_VGPU_CONFIG_INTERFACE_ID << 8) | NVA081_CTRL_VGPU_GET_CAPABILITY_PARAMS_MESSAGE_ID" */
|
||||
|
||||
#define NVA081_CTRL_VGPU_GET_CAPABILITY_PARAMS_MESSAGE_ID (0x1fU)
|
||||
|
||||
typedef struct NVA081_CTRL_VGPU_GET_CAPABILITY_PARAMS {
|
||||
NvU32 capability;
|
||||
NvBool state;
|
||||
} NVA081_CTRL_VGPU_GET_CAPABILITY_PARAMS;
|
||||
|
||||
/* _ctrlA081vgpuconfig_h_ */
|
||||
|
||||
Reference in New Issue
Block a user