1 #ifndef _G_KERNEL_GRAPHICS_CONTEXT_NVOC_H_ 2 #define _G_KERNEL_GRAPHICS_CONTEXT_NVOC_H_ 3 #include "nvoc/runtime.h" 4 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 9 /* 10 * SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 11 * SPDX-License-Identifier: MIT 12 * 13 * Permission is hereby granted, free of charge, to any person obtaining a 14 * copy of this software and associated documentation files (the "Software"), 15 * to deal in the Software without restriction, including without limitation 16 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 17 * and/or sell copies of the Software, and to permit persons to whom the 18 * Software is furnished to do so, subject to the following conditions: 19 * 20 * The above copyright notice and this permission notice shall be included in 21 * all copies or substantial portions of the Software. 22 * 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 29 * DEALINGS IN THE SOFTWARE. 30 */ 31 32 #include "g_kernel_graphics_context_nvoc.h" 33 34 #ifndef _KERNEL_GRAPHICS_CONTEXT_H_ 35 #define _KERNEL_GRAPHICS_CONTEXT_H_ 36 37 #include "gpu/gpu_resource.h" 38 #include "resserv/rs_server.h" 39 #include "resserv/rs_resource.h" 40 #include "ctrl/ctrl83de.h" 41 #include "ctrl/ctrl0090.h" 42 #include "mmu/gmmu_fmt.h" 43 #include "gpu/gpu_halspec.h" 44 #include "mem_mgr/vaddr_list.h" 45 #include "kernel/gpu/gr/kernel_graphics_context_buffers.h" 46 47 struct KernelChannel; 48 49 #ifndef __NVOC_CLASS_KernelChannel_TYPEDEF__ 50 #define __NVOC_CLASS_KernelChannel_TYPEDEF__ 51 typedef struct KernelChannel KernelChannel; 52 #endif /* __NVOC_CLASS_KernelChannel_TYPEDEF__ */ 53 54 #ifndef __nvoc_class_id_KernelChannel 55 #define __nvoc_class_id_KernelChannel 0x5d8d70 56 #endif /* __nvoc_class_id_KernelChannel */ 57 58 59 struct KernelChannelGroupApi; 60 61 #ifndef __NVOC_CLASS_KernelChannelGroupApi_TYPEDEF__ 62 #define __NVOC_CLASS_KernelChannelGroupApi_TYPEDEF__ 63 typedef struct KernelChannelGroupApi KernelChannelGroupApi; 64 #endif /* __NVOC_CLASS_KernelChannelGroupApi_TYPEDEF__ */ 65 66 #ifndef __nvoc_class_id_KernelChannelGroupApi 67 #define __nvoc_class_id_KernelChannelGroupApi 0x2b5b80 68 #endif /* __nvoc_class_id_KernelChannelGroupApi */ 69 70 71 72 typedef struct 73 { 74 const NV_ADDRESS_SPACE *pAllocList; 75 NvU32 cpuAttr; 76 } GR_BUFFER_ATTR; 77 78 typedef struct NV_CONTEXT_BUFFER 79 { 80 MEMORY_DESCRIPTOR *pMemDesc; 81 VA_LIST vAddrList; 82 } NV_CONTEXT_BUFFER; 83 84 typedef enum 85 { 86 GR_OBJECT_TYPE_3D, 87 GR_OBJECT_TYPE_2D, 88 GR_OBJECT_TYPE_MEM, 89 GR_OBJECT_TYPE_COMPUTE, 90 GR_OBJECT_TYPE_INVALID, 91 } GR_OBJECT_TYPE; 92 93 typedef struct 94 { 95 MEMORY_DESCRIPTOR *memDesc[GR_GLOBALCTX_BUFFER_COUNT]; 96 NvBool bAllocated; 97 98 // Tracks whether Physical has initialized the memory descriptor for the promoted Kernel buffer 99 NvBool bInitialized[GR_GLOBALCTX_BUFFER_COUNT]; 100 } GR_GLOBALCTX_BUFFERS; 101 102 struct KernelGraphicsContextUnicast; 103 typedef struct KernelGraphicsContextUnicast KernelGraphicsContextUnicast; 104 105 struct KernelGraphics; 106 107 #ifndef __NVOC_CLASS_KernelGraphics_TYPEDEF__ 108 #define __NVOC_CLASS_KernelGraphics_TYPEDEF__ 109 typedef struct KernelGraphics KernelGraphics; 110 #endif /* __NVOC_CLASS_KernelGraphics_TYPEDEF__ */ 111 112 #ifndef __nvoc_class_id_KernelGraphics 113 #define __nvoc_class_id_KernelGraphics 0xea3fa9 114 #endif /* __nvoc_class_id_KernelGraphics */ 115 116 117 struct KernelGraphicsContextShared; 118 119 #ifndef __NVOC_CLASS_KernelGraphicsContextShared_TYPEDEF__ 120 #define __NVOC_CLASS_KernelGraphicsContextShared_TYPEDEF__ 121 typedef struct KernelGraphicsContextShared KernelGraphicsContextShared; 122 #endif /* __NVOC_CLASS_KernelGraphicsContextShared_TYPEDEF__ */ 123 124 #ifndef __nvoc_class_id_KernelGraphicsContextShared 125 #define __nvoc_class_id_KernelGraphicsContextShared 0xe7abeb 126 #endif /* __nvoc_class_id_KernelGraphicsContextShared */ 127 128 129 struct KernelGraphicsObject; 130 131 #ifndef __NVOC_CLASS_KernelGraphicsObject_TYPEDEF__ 132 #define __NVOC_CLASS_KernelGraphicsObject_TYPEDEF__ 133 typedef struct KernelGraphicsObject KernelGraphicsObject; 134 #endif /* __NVOC_CLASS_KernelGraphicsObject_TYPEDEF__ */ 135 136 #ifndef __nvoc_class_id_KernelGraphicsObject 137 #define __nvoc_class_id_KernelGraphicsObject 0x097648 138 #endif /* __nvoc_class_id_KernelGraphicsObject */ 139 140 141 142 /*! 143 * KernelGraphicsContext is a logical abstraction of GrContext object (Per Channel or 144 * per ChannelGroup) in Kernel side. The Public API of the GrContext is exposed through 145 * this object, and any interfaces which do not manage the underlying HW can be managed 146 * by this object. 147 */ 148 #ifdef NVOC_KERNEL_GRAPHICS_CONTEXT_H_PRIVATE_ACCESS_ALLOWED 149 #define PRIVATE_FIELD(x) x 150 #else 151 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x) 152 #endif 153 struct KernelGraphicsContext { 154 const struct NVOC_RTTI *__nvoc_rtti; 155 struct GpuResource __nvoc_base_GpuResource; 156 struct Object *__nvoc_pbase_Object; 157 struct RsResource *__nvoc_pbase_RsResource; 158 struct RmResourceCommon *__nvoc_pbase_RmResourceCommon; 159 struct RmResource *__nvoc_pbase_RmResource; 160 struct GpuResource *__nvoc_pbase_GpuResource; 161 struct KernelGraphicsContext *__nvoc_pbase_KernelGraphicsContext; 162 NvBool (*__kgrctxCanCopy__)(struct KernelGraphicsContext *); 163 NvHandle (*__kgrctxGetInternalObjectHandle__)(struct KernelGraphicsContext *); 164 NV_STATUS (*__kgrctxCtrlGetTpcPartitionMode__)(struct KernelGraphicsContext *, NV0090_CTRL_TPC_PARTITION_MODE_PARAMS *); 165 NV_STATUS (*__kgrctxCtrlSetTpcPartitionMode__)(struct KernelGraphicsContext *, NV0090_CTRL_TPC_PARTITION_MODE_PARAMS *); 166 NV_STATUS (*__kgrctxCtrlGetMMUDebugMode__)(struct KernelGraphicsContext *, NV0090_CTRL_GET_MMU_DEBUG_MODE_PARAMS *); 167 NV_STATUS (*__kgrctxCtrlProgramVidmemPromote__)(struct KernelGraphicsContext *, NV0090_CTRL_PROGRAM_VIDMEM_PROMOTE_PARAMS *); 168 NvBool (*__kgrctxShareCallback__)(struct KernelGraphicsContext *, struct RsClient *, struct RsResourceRef *, RS_SHARE_POLICY *); 169 NV_STATUS (*__kgrctxCheckMemInterUnmap__)(struct KernelGraphicsContext *, NvBool); 170 NV_STATUS (*__kgrctxMapTo__)(struct KernelGraphicsContext *, RS_RES_MAP_TO_PARAMS *); 171 NV_STATUS (*__kgrctxGetMapAddrSpace__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, NvU32, NV_ADDRESS_SPACE *); 172 NvU32 (*__kgrctxGetRefCount__)(struct KernelGraphicsContext *); 173 void (*__kgrctxAddAdditionalDependants__)(struct RsClient *, struct KernelGraphicsContext *, RsResourceRef *); 174 NV_STATUS (*__kgrctxControl_Prologue__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 175 NV_STATUS (*__kgrctxGetRegBaseOffsetAndSize__)(struct KernelGraphicsContext *, struct OBJGPU *, NvU32 *, NvU32 *); 176 NV_STATUS (*__kgrctxInternalControlForward__)(struct KernelGraphicsContext *, NvU32, void *, NvU32); 177 NV_STATUS (*__kgrctxUnmapFrom__)(struct KernelGraphicsContext *, RS_RES_UNMAP_FROM_PARAMS *); 178 void (*__kgrctxControl_Epilogue__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 179 NV_STATUS (*__kgrctxControlLookup__)(struct KernelGraphicsContext *, struct RS_RES_CONTROL_PARAMS_INTERNAL *, const struct NVOC_EXPORTED_METHOD_DEF **); 180 NV_STATUS (*__kgrctxControl__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 181 NV_STATUS (*__kgrctxUnmap__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, struct RsCpuMapping *); 182 NV_STATUS (*__kgrctxGetMemInterMapParams__)(struct KernelGraphicsContext *, RMRES_MEM_INTER_MAP_PARAMS *); 183 NV_STATUS (*__kgrctxGetMemoryMappingDescriptor__)(struct KernelGraphicsContext *, struct MEMORY_DESCRIPTOR **); 184 NV_STATUS (*__kgrctxControlFilter__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 185 NV_STATUS (*__kgrctxControlSerialization_Prologue__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 186 void (*__kgrctxPreDestruct__)(struct KernelGraphicsContext *); 187 NV_STATUS (*__kgrctxIsDuplicate__)(struct KernelGraphicsContext *, NvHandle, NvBool *); 188 void (*__kgrctxControlSerialization_Epilogue__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 189 NV_STATUS (*__kgrctxMap__)(struct KernelGraphicsContext *, struct CALL_CONTEXT *, struct RS_CPU_MAP_PARAMS *, struct RsCpuMapping *); 190 NvBool (*__kgrctxAccessCallback__)(struct KernelGraphicsContext *, struct RsClient *, void *, RsAccessRight); 191 struct KernelGraphicsContextShared *PRIVATE_FIELD(pShared); 192 }; 193 194 #ifndef __NVOC_CLASS_KernelGraphicsContext_TYPEDEF__ 195 #define __NVOC_CLASS_KernelGraphicsContext_TYPEDEF__ 196 typedef struct KernelGraphicsContext KernelGraphicsContext; 197 #endif /* __NVOC_CLASS_KernelGraphicsContext_TYPEDEF__ */ 198 199 #ifndef __nvoc_class_id_KernelGraphicsContext 200 #define __nvoc_class_id_KernelGraphicsContext 0x7ead09 201 #endif /* __nvoc_class_id_KernelGraphicsContext */ 202 203 extern const struct NVOC_CLASS_DEF __nvoc_class_def_KernelGraphicsContext; 204 205 #define __staticCast_KernelGraphicsContext(pThis) \ 206 ((pThis)->__nvoc_pbase_KernelGraphicsContext) 207 208 #ifdef __nvoc_kernel_graphics_context_h_disabled 209 #define __dynamicCast_KernelGraphicsContext(pThis) ((KernelGraphicsContext*)NULL) 210 #else //__nvoc_kernel_graphics_context_h_disabled 211 #define __dynamicCast_KernelGraphicsContext(pThis) \ 212 ((KernelGraphicsContext*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(KernelGraphicsContext))) 213 #endif //__nvoc_kernel_graphics_context_h_disabled 214 215 216 NV_STATUS __nvoc_objCreateDynamic_KernelGraphicsContext(KernelGraphicsContext**, Dynamic*, NvU32, va_list); 217 218 NV_STATUS __nvoc_objCreate_KernelGraphicsContext(KernelGraphicsContext**, Dynamic*, NvU32, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams); 219 #define __objCreate_KernelGraphicsContext(ppNewObj, pParent, createFlags, arg_pCallContext, arg_pParams) \ 220 __nvoc_objCreate_KernelGraphicsContext((ppNewObj), staticCast((pParent), Dynamic), (createFlags), arg_pCallContext, arg_pParams) 221 222 #define kgrctxCanCopy(arg0) kgrctxCanCopy_DISPATCH(arg0) 223 #define kgrctxGetInternalObjectHandle(arg0) kgrctxGetInternalObjectHandle_DISPATCH(arg0) 224 #define kgrctxCtrlGetTpcPartitionMode(pKernelGraphicsContext, pParams) kgrctxCtrlGetTpcPartitionMode_DISPATCH(pKernelGraphicsContext, pParams) 225 #define kgrctxCtrlSetTpcPartitionMode(pKernelGraphicsContext, pParams) kgrctxCtrlSetTpcPartitionMode_DISPATCH(pKernelGraphicsContext, pParams) 226 #define kgrctxCtrlGetMMUDebugMode(pKernelGraphicsContext, pParams) kgrctxCtrlGetMMUDebugMode_DISPATCH(pKernelGraphicsContext, pParams) 227 #define kgrctxCtrlProgramVidmemPromote(pKernelGraphicsContext, pParams) kgrctxCtrlProgramVidmemPromote_DISPATCH(pKernelGraphicsContext, pParams) 228 #define kgrctxShareCallback(pGpuResource, pInvokingClient, pParentRef, pSharePolicy) kgrctxShareCallback_DISPATCH(pGpuResource, pInvokingClient, pParentRef, pSharePolicy) 229 #define kgrctxCheckMemInterUnmap(pRmResource, bSubdeviceHandleProvided) kgrctxCheckMemInterUnmap_DISPATCH(pRmResource, bSubdeviceHandleProvided) 230 #define kgrctxMapTo(pResource, pParams) kgrctxMapTo_DISPATCH(pResource, pParams) 231 #define kgrctxGetMapAddrSpace(pGpuResource, pCallContext, mapFlags, pAddrSpace) kgrctxGetMapAddrSpace_DISPATCH(pGpuResource, pCallContext, mapFlags, pAddrSpace) 232 #define kgrctxGetRefCount(pResource) kgrctxGetRefCount_DISPATCH(pResource) 233 #define kgrctxAddAdditionalDependants(pClient, pResource, pReference) kgrctxAddAdditionalDependants_DISPATCH(pClient, pResource, pReference) 234 #define kgrctxControl_Prologue(pResource, pCallContext, pParams) kgrctxControl_Prologue_DISPATCH(pResource, pCallContext, pParams) 235 #define kgrctxGetRegBaseOffsetAndSize(pGpuResource, pGpu, pOffset, pSize) kgrctxGetRegBaseOffsetAndSize_DISPATCH(pGpuResource, pGpu, pOffset, pSize) 236 #define kgrctxInternalControlForward(pGpuResource, command, pParams, size) kgrctxInternalControlForward_DISPATCH(pGpuResource, command, pParams, size) 237 #define kgrctxUnmapFrom(pResource, pParams) kgrctxUnmapFrom_DISPATCH(pResource, pParams) 238 #define kgrctxControl_Epilogue(pResource, pCallContext, pParams) kgrctxControl_Epilogue_DISPATCH(pResource, pCallContext, pParams) 239 #define kgrctxControlLookup(pResource, pParams, ppEntry) kgrctxControlLookup_DISPATCH(pResource, pParams, ppEntry) 240 #define kgrctxControl(pGpuResource, pCallContext, pParams) kgrctxControl_DISPATCH(pGpuResource, pCallContext, pParams) 241 #define kgrctxUnmap(pGpuResource, pCallContext, pCpuMapping) kgrctxUnmap_DISPATCH(pGpuResource, pCallContext, pCpuMapping) 242 #define kgrctxGetMemInterMapParams(pRmResource, pParams) kgrctxGetMemInterMapParams_DISPATCH(pRmResource, pParams) 243 #define kgrctxGetMemoryMappingDescriptor(pRmResource, ppMemDesc) kgrctxGetMemoryMappingDescriptor_DISPATCH(pRmResource, ppMemDesc) 244 #define kgrctxControlFilter(pResource, pCallContext, pParams) kgrctxControlFilter_DISPATCH(pResource, pCallContext, pParams) 245 #define kgrctxControlSerialization_Prologue(pResource, pCallContext, pParams) kgrctxControlSerialization_Prologue_DISPATCH(pResource, pCallContext, pParams) 246 #define kgrctxPreDestruct(pResource) kgrctxPreDestruct_DISPATCH(pResource) 247 #define kgrctxIsDuplicate(pResource, hMemory, pDuplicate) kgrctxIsDuplicate_DISPATCH(pResource, hMemory, pDuplicate) 248 #define kgrctxControlSerialization_Epilogue(pResource, pCallContext, pParams) kgrctxControlSerialization_Epilogue_DISPATCH(pResource, pCallContext, pParams) 249 #define kgrctxMap(pGpuResource, pCallContext, pParams, pCpuMapping) kgrctxMap_DISPATCH(pGpuResource, pCallContext, pParams, pCpuMapping) 250 #define kgrctxAccessCallback(pResource, pInvokingClient, pAllocParams, accessRight) kgrctxAccessCallback_DISPATCH(pResource, pInvokingClient, pAllocParams, accessRight) 251 NvBool kgrctxShouldManageCtxBuffers_KERNEL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NvU32 gfid); 252 253 254 #ifdef __nvoc_kernel_graphics_context_h_disabled 255 static inline NvBool kgrctxShouldManageCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NvU32 gfid) { 256 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 257 return NV_FALSE; 258 } 259 #else //__nvoc_kernel_graphics_context_h_disabled 260 #define kgrctxShouldManageCtxBuffers(arg0, arg1, gfid) kgrctxShouldManageCtxBuffers_KERNEL(arg0, arg1, gfid) 261 #endif //__nvoc_kernel_graphics_context_h_disabled 262 263 #define kgrctxShouldManageCtxBuffers_HAL(arg0, arg1, gfid) kgrctxShouldManageCtxBuffers(arg0, arg1, gfid) 264 265 NvBool kgrctxShouldCleanup_KERNEL(struct OBJGPU *pGpu, struct KernelGraphicsContext *pKernelGraphicsContext); 266 267 268 #ifdef __nvoc_kernel_graphics_context_h_disabled 269 static inline NvBool kgrctxShouldCleanup(struct OBJGPU *pGpu, struct KernelGraphicsContext *pKernelGraphicsContext) { 270 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 271 return NV_FALSE; 272 } 273 #else //__nvoc_kernel_graphics_context_h_disabled 274 #define kgrctxShouldCleanup(pGpu, pKernelGraphicsContext) kgrctxShouldCleanup_KERNEL(pGpu, pKernelGraphicsContext) 275 #endif //__nvoc_kernel_graphics_context_h_disabled 276 277 #define kgrctxShouldCleanup_HAL(pGpu, pKernelGraphicsContext) kgrctxShouldCleanup(pGpu, pKernelGraphicsContext) 278 279 NvBool kgrctxShouldPreAllocPmBuffer_PF(struct OBJGPU *pGpu, struct KernelGraphicsContext *pKernelGraphicsContext, struct KernelChannel *pKernelChannel); 280 281 282 #ifdef __nvoc_kernel_graphics_context_h_disabled 283 static inline NvBool kgrctxShouldPreAllocPmBuffer(struct OBJGPU *pGpu, struct KernelGraphicsContext *pKernelGraphicsContext, struct KernelChannel *pKernelChannel) { 284 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 285 return NV_FALSE; 286 } 287 #else //__nvoc_kernel_graphics_context_h_disabled 288 #define kgrctxShouldPreAllocPmBuffer(pGpu, pKernelGraphicsContext, pKernelChannel) kgrctxShouldPreAllocPmBuffer_PF(pGpu, pKernelGraphicsContext, pKernelChannel) 289 #endif //__nvoc_kernel_graphics_context_h_disabled 290 291 #define kgrctxShouldPreAllocPmBuffer_HAL(pGpu, pKernelGraphicsContext, pKernelChannel) kgrctxShouldPreAllocPmBuffer(pGpu, pKernelGraphicsContext, pKernelChannel) 292 293 void kgrctxUnmapBuffers_KERNEL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, KernelGraphicsContextUnicast *arg2, struct KernelChannel *arg3); 294 295 296 #ifdef __nvoc_kernel_graphics_context_h_disabled 297 static inline void kgrctxUnmapBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, KernelGraphicsContextUnicast *arg2, struct KernelChannel *arg3) { 298 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 299 } 300 #else //__nvoc_kernel_graphics_context_h_disabled 301 #define kgrctxUnmapBuffers(arg0, arg1, arg2, arg3) kgrctxUnmapBuffers_KERNEL(arg0, arg1, arg2, arg3) 302 #endif //__nvoc_kernel_graphics_context_h_disabled 303 304 #define kgrctxUnmapBuffers_HAL(arg0, arg1, arg2, arg3) kgrctxUnmapBuffers(arg0, arg1, arg2, arg3) 305 306 NV_STATUS kgrctxUnmapCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphicsObject *arg2, struct KernelGraphics *arg3, NvBool bDestructor); 307 308 309 #ifdef __nvoc_kernel_graphics_context_h_disabled 310 static inline NV_STATUS kgrctxUnmapCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphicsObject *arg2, struct KernelGraphics *arg3, NvBool bDestructor) { 311 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 312 return NV_ERR_NOT_SUPPORTED; 313 } 314 #else //__nvoc_kernel_graphics_context_h_disabled 315 #define kgrctxUnmapCtxBuffers(arg0, arg1, arg2, arg3, bDestructor) kgrctxUnmapCtxBuffers_IMPL(arg0, arg1, arg2, arg3, bDestructor) 316 #endif //__nvoc_kernel_graphics_context_h_disabled 317 318 #define kgrctxUnmapCtxBuffers_HAL(arg0, arg1, arg2, arg3, bDestructor) kgrctxUnmapCtxBuffers(arg0, arg1, arg2, arg3, bDestructor) 319 320 void kgrctxIncObjectCount_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NvU32 classNum); 321 322 323 #ifdef __nvoc_kernel_graphics_context_h_disabled 324 static inline void kgrctxIncObjectCount(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NvU32 classNum) { 325 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 326 } 327 #else //__nvoc_kernel_graphics_context_h_disabled 328 #define kgrctxIncObjectCount(arg0, arg1, classNum) kgrctxIncObjectCount_IMPL(arg0, arg1, classNum) 329 #endif //__nvoc_kernel_graphics_context_h_disabled 330 331 #define kgrctxIncObjectCount_HAL(arg0, arg1, classNum) kgrctxIncObjectCount(arg0, arg1, classNum) 332 333 void kgrctxDecObjectCount_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NvU32 classNum); 334 335 336 #ifdef __nvoc_kernel_graphics_context_h_disabled 337 static inline void kgrctxDecObjectCount(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NvU32 classNum) { 338 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 339 } 340 #else //__nvoc_kernel_graphics_context_h_disabled 341 #define kgrctxDecObjectCount(arg0, arg1, classNum) kgrctxDecObjectCount_IMPL(arg0, arg1, classNum) 342 #endif //__nvoc_kernel_graphics_context_h_disabled 343 344 #define kgrctxDecObjectCount_HAL(arg0, arg1, classNum) kgrctxDecObjectCount(arg0, arg1, classNum) 345 346 GR_GLOBALCTX_BUFFER kgrctxGetRegisterAccessMapId_PF(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelChannel *arg2); 347 348 349 #ifdef __nvoc_kernel_graphics_context_h_disabled 350 static inline GR_GLOBALCTX_BUFFER kgrctxGetRegisterAccessMapId(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelChannel *arg2) { 351 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 352 GR_GLOBALCTX_BUFFER ret; 353 portMemSet(&ret, 0, sizeof(GR_GLOBALCTX_BUFFER)); 354 return ret; 355 } 356 #else //__nvoc_kernel_graphics_context_h_disabled 357 #define kgrctxGetRegisterAccessMapId(arg0, arg1, arg2) kgrctxGetRegisterAccessMapId_PF(arg0, arg1, arg2) 358 #endif //__nvoc_kernel_graphics_context_h_disabled 359 360 #define kgrctxGetRegisterAccessMapId_HAL(arg0, arg1, arg2) kgrctxGetRegisterAccessMapId(arg0, arg1, arg2) 361 362 static inline NvBool kgrctxCanCopy_0c883b(struct KernelGraphicsContext *arg0) { 363 return ((NvBool)(0 == 0)); 364 } 365 366 static inline NvBool kgrctxCanCopy_DISPATCH(struct KernelGraphicsContext *arg0) { 367 return arg0->__kgrctxCanCopy__(arg0); 368 } 369 370 NvHandle kgrctxGetInternalObjectHandle_IMPL(struct KernelGraphicsContext *arg0); 371 372 static inline NvHandle kgrctxGetInternalObjectHandle_DISPATCH(struct KernelGraphicsContext *arg0) { 373 return arg0->__kgrctxGetInternalObjectHandle__(arg0); 374 } 375 376 NV_STATUS kgrctxCtrlGetTpcPartitionMode_IMPL(struct KernelGraphicsContext *pKernelGraphicsContext, NV0090_CTRL_TPC_PARTITION_MODE_PARAMS *pParams); 377 378 static inline NV_STATUS kgrctxCtrlGetTpcPartitionMode_DISPATCH(struct KernelGraphicsContext *pKernelGraphicsContext, NV0090_CTRL_TPC_PARTITION_MODE_PARAMS *pParams) { 379 return pKernelGraphicsContext->__kgrctxCtrlGetTpcPartitionMode__(pKernelGraphicsContext, pParams); 380 } 381 382 NV_STATUS kgrctxCtrlSetTpcPartitionMode_IMPL(struct KernelGraphicsContext *pKernelGraphicsContext, NV0090_CTRL_TPC_PARTITION_MODE_PARAMS *pParams); 383 384 static inline NV_STATUS kgrctxCtrlSetTpcPartitionMode_DISPATCH(struct KernelGraphicsContext *pKernelGraphicsContext, NV0090_CTRL_TPC_PARTITION_MODE_PARAMS *pParams) { 385 return pKernelGraphicsContext->__kgrctxCtrlSetTpcPartitionMode__(pKernelGraphicsContext, pParams); 386 } 387 388 NV_STATUS kgrctxCtrlGetMMUDebugMode_IMPL(struct KernelGraphicsContext *pKernelGraphicsContext, NV0090_CTRL_GET_MMU_DEBUG_MODE_PARAMS *pParams); 389 390 static inline NV_STATUS kgrctxCtrlGetMMUDebugMode_DISPATCH(struct KernelGraphicsContext *pKernelGraphicsContext, NV0090_CTRL_GET_MMU_DEBUG_MODE_PARAMS *pParams) { 391 return pKernelGraphicsContext->__kgrctxCtrlGetMMUDebugMode__(pKernelGraphicsContext, pParams); 392 } 393 394 NV_STATUS kgrctxCtrlProgramVidmemPromote_IMPL(struct KernelGraphicsContext *pKernelGraphicsContext, NV0090_CTRL_PROGRAM_VIDMEM_PROMOTE_PARAMS *pParams); 395 396 static inline NV_STATUS kgrctxCtrlProgramVidmemPromote_DISPATCH(struct KernelGraphicsContext *pKernelGraphicsContext, NV0090_CTRL_PROGRAM_VIDMEM_PROMOTE_PARAMS *pParams) { 397 return pKernelGraphicsContext->__kgrctxCtrlProgramVidmemPromote__(pKernelGraphicsContext, pParams); 398 } 399 400 static inline NvBool kgrctxShareCallback_DISPATCH(struct KernelGraphicsContext *pGpuResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) { 401 return pGpuResource->__kgrctxShareCallback__(pGpuResource, pInvokingClient, pParentRef, pSharePolicy); 402 } 403 404 static inline NV_STATUS kgrctxCheckMemInterUnmap_DISPATCH(struct KernelGraphicsContext *pRmResource, NvBool bSubdeviceHandleProvided) { 405 return pRmResource->__kgrctxCheckMemInterUnmap__(pRmResource, bSubdeviceHandleProvided); 406 } 407 408 static inline NV_STATUS kgrctxMapTo_DISPATCH(struct KernelGraphicsContext *pResource, RS_RES_MAP_TO_PARAMS *pParams) { 409 return pResource->__kgrctxMapTo__(pResource, pParams); 410 } 411 412 static inline NV_STATUS kgrctxGetMapAddrSpace_DISPATCH(struct KernelGraphicsContext *pGpuResource, struct CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) { 413 return pGpuResource->__kgrctxGetMapAddrSpace__(pGpuResource, pCallContext, mapFlags, pAddrSpace); 414 } 415 416 static inline NvU32 kgrctxGetRefCount_DISPATCH(struct KernelGraphicsContext *pResource) { 417 return pResource->__kgrctxGetRefCount__(pResource); 418 } 419 420 static inline void kgrctxAddAdditionalDependants_DISPATCH(struct RsClient *pClient, struct KernelGraphicsContext *pResource, RsResourceRef *pReference) { 421 pResource->__kgrctxAddAdditionalDependants__(pClient, pResource, pReference); 422 } 423 424 static inline NV_STATUS kgrctxControl_Prologue_DISPATCH(struct KernelGraphicsContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 425 return pResource->__kgrctxControl_Prologue__(pResource, pCallContext, pParams); 426 } 427 428 static inline NV_STATUS kgrctxGetRegBaseOffsetAndSize_DISPATCH(struct KernelGraphicsContext *pGpuResource, struct OBJGPU *pGpu, NvU32 *pOffset, NvU32 *pSize) { 429 return pGpuResource->__kgrctxGetRegBaseOffsetAndSize__(pGpuResource, pGpu, pOffset, pSize); 430 } 431 432 static inline NV_STATUS kgrctxInternalControlForward_DISPATCH(struct KernelGraphicsContext *pGpuResource, NvU32 command, void *pParams, NvU32 size) { 433 return pGpuResource->__kgrctxInternalControlForward__(pGpuResource, command, pParams, size); 434 } 435 436 static inline NV_STATUS kgrctxUnmapFrom_DISPATCH(struct KernelGraphicsContext *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) { 437 return pResource->__kgrctxUnmapFrom__(pResource, pParams); 438 } 439 440 static inline void kgrctxControl_Epilogue_DISPATCH(struct KernelGraphicsContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 441 pResource->__kgrctxControl_Epilogue__(pResource, pCallContext, pParams); 442 } 443 444 static inline NV_STATUS kgrctxControlLookup_DISPATCH(struct KernelGraphicsContext *pResource, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams, const struct NVOC_EXPORTED_METHOD_DEF **ppEntry) { 445 return pResource->__kgrctxControlLookup__(pResource, pParams, ppEntry); 446 } 447 448 static inline NV_STATUS kgrctxControl_DISPATCH(struct KernelGraphicsContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 449 return pGpuResource->__kgrctxControl__(pGpuResource, pCallContext, pParams); 450 } 451 452 static inline NV_STATUS kgrctxUnmap_DISPATCH(struct KernelGraphicsContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RsCpuMapping *pCpuMapping) { 453 return pGpuResource->__kgrctxUnmap__(pGpuResource, pCallContext, pCpuMapping); 454 } 455 456 static inline NV_STATUS kgrctxGetMemInterMapParams_DISPATCH(struct KernelGraphicsContext *pRmResource, RMRES_MEM_INTER_MAP_PARAMS *pParams) { 457 return pRmResource->__kgrctxGetMemInterMapParams__(pRmResource, pParams); 458 } 459 460 static inline NV_STATUS kgrctxGetMemoryMappingDescriptor_DISPATCH(struct KernelGraphicsContext *pRmResource, struct MEMORY_DESCRIPTOR **ppMemDesc) { 461 return pRmResource->__kgrctxGetMemoryMappingDescriptor__(pRmResource, ppMemDesc); 462 } 463 464 static inline NV_STATUS kgrctxControlFilter_DISPATCH(struct KernelGraphicsContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 465 return pResource->__kgrctxControlFilter__(pResource, pCallContext, pParams); 466 } 467 468 static inline NV_STATUS kgrctxControlSerialization_Prologue_DISPATCH(struct KernelGraphicsContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 469 return pResource->__kgrctxControlSerialization_Prologue__(pResource, pCallContext, pParams); 470 } 471 472 static inline void kgrctxPreDestruct_DISPATCH(struct KernelGraphicsContext *pResource) { 473 pResource->__kgrctxPreDestruct__(pResource); 474 } 475 476 static inline NV_STATUS kgrctxIsDuplicate_DISPATCH(struct KernelGraphicsContext *pResource, NvHandle hMemory, NvBool *pDuplicate) { 477 return pResource->__kgrctxIsDuplicate__(pResource, hMemory, pDuplicate); 478 } 479 480 static inline void kgrctxControlSerialization_Epilogue_DISPATCH(struct KernelGraphicsContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 481 pResource->__kgrctxControlSerialization_Epilogue__(pResource, pCallContext, pParams); 482 } 483 484 static inline NV_STATUS kgrctxMap_DISPATCH(struct KernelGraphicsContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, struct RsCpuMapping *pCpuMapping) { 485 return pGpuResource->__kgrctxMap__(pGpuResource, pCallContext, pParams, pCpuMapping); 486 } 487 488 static inline NvBool kgrctxAccessCallback_DISPATCH(struct KernelGraphicsContext *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) { 489 return pResource->__kgrctxAccessCallback__(pResource, pInvokingClient, pAllocParams, accessRight); 490 } 491 492 NV_STATUS kgrctxFromKernelChannel_IMPL(struct KernelChannel *arg0, struct KernelGraphicsContext **arg1); 493 494 #define kgrctxFromKernelChannel(arg0, arg1) kgrctxFromKernelChannel_IMPL(arg0, arg1) 495 NV_STATUS kgrctxFromKernelChannelGroupApi_IMPL(struct KernelChannelGroupApi *arg0, struct KernelGraphicsContext **arg1); 496 497 #define kgrctxFromKernelChannelGroupApi(arg0, arg1) kgrctxFromKernelChannelGroupApi_IMPL(arg0, arg1) 498 NV_STATUS kgrctxGetGlobalContextBufferExternalId_IMPL(GR_GLOBALCTX_BUFFER arg0, NvU32 *pExternalId); 499 500 #define kgrctxGetGlobalContextBufferExternalId(arg0, pExternalId) kgrctxGetGlobalContextBufferExternalId_IMPL(arg0, pExternalId) 501 NV_STATUS kgrctxGetGlobalContextBufferInternalId_IMPL(NvU32 externalId, GR_GLOBALCTX_BUFFER *arg0); 502 503 #define kgrctxGetGlobalContextBufferInternalId(externalId, arg0) kgrctxGetGlobalContextBufferInternalId_IMPL(externalId, arg0) 504 NV_STATUS kgrctxCtxBufferToFifoEngineId_IMPL(GR_CTX_BUFFER arg0, NvU32 *pFifoEngineId); 505 506 #define kgrctxCtxBufferToFifoEngineId(arg0, pFifoEngineId) kgrctxCtxBufferToFifoEngineId_IMPL(arg0, pFifoEngineId) 507 NV_STATUS kgrctxGlobalCtxBufferToFifoEngineId_IMPL(GR_GLOBALCTX_BUFFER arg0, NvU32 *pFifoEngineId); 508 509 #define kgrctxGlobalCtxBufferToFifoEngineId(arg0, pFifoEngineId) kgrctxGlobalCtxBufferToFifoEngineId_IMPL(arg0, pFifoEngineId) 510 NV_STATUS kgrctxGetGidInfoInPlace_IMPL(struct OBJGPU *pGpu, NvU8 *pUuidBuffer, NvU32 uuidBufferSize, NvU32 flags); 511 512 #define kgrctxGetGidInfoInPlace(pGpu, pUuidBuffer, uuidBufferSize, flags) kgrctxGetGidInfoInPlace_IMPL(pGpu, pUuidBuffer, uuidBufferSize, flags) 513 GMMU_APERTURE kgrctxGetExternalAllocAperture_IMPL(NvU32 addressSpace); 514 515 #define kgrctxGetExternalAllocAperture(addressSpace) kgrctxGetExternalAllocAperture_IMPL(addressSpace) 516 NV_STATUS kgrctxFillCtxBufferInfo_IMPL(struct MEMORY_DESCRIPTOR *arg0, NvU32 externalId, NvBool bBufferGlobal, NV2080_CTRL_GR_CTX_BUFFER_INFO *arg1); 517 518 #define kgrctxFillCtxBufferInfo(arg0, externalId, bBufferGlobal, arg1) kgrctxFillCtxBufferInfo_IMPL(arg0, externalId, bBufferGlobal, arg1) 519 NV_STATUS kgrctxConstruct_IMPL(struct KernelGraphicsContext *arg_pKernelGraphicsContext, struct CALL_CONTEXT *arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg_pParams); 520 521 #define __nvoc_kgrctxConstruct(arg_pKernelGraphicsContext, arg_pCallContext, arg_pParams) kgrctxConstruct_IMPL(arg_pKernelGraphicsContext, arg_pCallContext, arg_pParams) 522 NV_STATUS kgrctxCopyConstruct_IMPL(struct KernelGraphicsContext *arg0, struct CALL_CONTEXT *arg1, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg2); 523 524 #ifdef __nvoc_kernel_graphics_context_h_disabled 525 static inline NV_STATUS kgrctxCopyConstruct(struct KernelGraphicsContext *arg0, struct CALL_CONTEXT *arg1, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg2) { 526 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 527 return NV_ERR_NOT_SUPPORTED; 528 } 529 #else //__nvoc_kernel_graphics_context_h_disabled 530 #define kgrctxCopyConstruct(arg0, arg1, arg2) kgrctxCopyConstruct_IMPL(arg0, arg1, arg2) 531 #endif //__nvoc_kernel_graphics_context_h_disabled 532 533 void kgrctxDestruct_IMPL(struct KernelGraphicsContext *arg0); 534 535 #define __nvoc_kgrctxDestruct(arg0) kgrctxDestruct_IMPL(arg0) 536 NV_STATUS kgrctxGetUnicast_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, KernelGraphicsContextUnicast **arg2); 537 538 #ifdef __nvoc_kernel_graphics_context_h_disabled 539 static inline NV_STATUS kgrctxGetUnicast(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, KernelGraphicsContextUnicast **arg2) { 540 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 541 return NV_ERR_NOT_SUPPORTED; 542 } 543 #else //__nvoc_kernel_graphics_context_h_disabled 544 #define kgrctxGetUnicast(arg0, arg1, arg2) kgrctxGetUnicast_IMPL(arg0, arg1, arg2) 545 #endif //__nvoc_kernel_graphics_context_h_disabled 546 547 NV_STATUS kgrctxLookupMmuFaultInfo_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NV83DE_CTRL_DEBUG_READ_MMU_FAULT_INFO_PARAMS *arg2); 548 549 #ifdef __nvoc_kernel_graphics_context_h_disabled 550 static inline NV_STATUS kgrctxLookupMmuFaultInfo(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NV83DE_CTRL_DEBUG_READ_MMU_FAULT_INFO_PARAMS *arg2) { 551 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 552 return NV_ERR_NOT_SUPPORTED; 553 } 554 #else //__nvoc_kernel_graphics_context_h_disabled 555 #define kgrctxLookupMmuFaultInfo(arg0, arg1, arg2) kgrctxLookupMmuFaultInfo_IMPL(arg0, arg1, arg2) 556 #endif //__nvoc_kernel_graphics_context_h_disabled 557 558 NV_STATUS kgrctxLookupMmuFault_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NV83DE_MMU_FAULT_INFO *arg2); 559 560 #ifdef __nvoc_kernel_graphics_context_h_disabled 561 static inline NV_STATUS kgrctxLookupMmuFault(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NV83DE_MMU_FAULT_INFO *arg2) { 562 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 563 return NV_ERR_NOT_SUPPORTED; 564 } 565 #else //__nvoc_kernel_graphics_context_h_disabled 566 #define kgrctxLookupMmuFault(arg0, arg1, arg2) kgrctxLookupMmuFault_IMPL(arg0, arg1, arg2) 567 #endif //__nvoc_kernel_graphics_context_h_disabled 568 569 NV_STATUS kgrctxClearMmuFault_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 570 571 #ifdef __nvoc_kernel_graphics_context_h_disabled 572 static inline NV_STATUS kgrctxClearMmuFault(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 573 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 574 return NV_ERR_NOT_SUPPORTED; 575 } 576 #else //__nvoc_kernel_graphics_context_h_disabled 577 #define kgrctxClearMmuFault(arg0, arg1) kgrctxClearMmuFault_IMPL(arg0, arg1) 578 #endif //__nvoc_kernel_graphics_context_h_disabled 579 580 void kgrctxRecordMmuFault_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NvU32 mmuFaultInfo, NvU64 mmuFaultAddress, NvU32 mmuFaultType, NvU32 mmuFaultAccessType); 581 582 #ifdef __nvoc_kernel_graphics_context_h_disabled 583 static inline void kgrctxRecordMmuFault(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, NvU32 mmuFaultInfo, NvU64 mmuFaultAddress, NvU32 mmuFaultType, NvU32 mmuFaultAccessType) { 584 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 585 } 586 #else //__nvoc_kernel_graphics_context_h_disabled 587 #define kgrctxRecordMmuFault(arg0, arg1, mmuFaultInfo, mmuFaultAddress, mmuFaultType, mmuFaultAccessType) kgrctxRecordMmuFault_IMPL(arg0, arg1, mmuFaultInfo, mmuFaultAddress, mmuFaultType, mmuFaultAccessType) 588 #endif //__nvoc_kernel_graphics_context_h_disabled 589 590 NvBool kgrctxIsValid_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelChannel *arg2); 591 592 #ifdef __nvoc_kernel_graphics_context_h_disabled 593 static inline NvBool kgrctxIsValid(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelChannel *arg2) { 594 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 595 return NV_FALSE; 596 } 597 #else //__nvoc_kernel_graphics_context_h_disabled 598 #define kgrctxIsValid(arg0, arg1, arg2) kgrctxIsValid_IMPL(arg0, arg1, arg2) 599 #endif //__nvoc_kernel_graphics_context_h_disabled 600 601 NvBool kgrctxIsMainContextAllocated_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 602 603 #ifdef __nvoc_kernel_graphics_context_h_disabled 604 static inline NvBool kgrctxIsMainContextAllocated(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 605 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 606 return NV_FALSE; 607 } 608 #else //__nvoc_kernel_graphics_context_h_disabled 609 #define kgrctxIsMainContextAllocated(arg0, arg1) kgrctxIsMainContextAllocated_IMPL(arg0, arg1) 610 #endif //__nvoc_kernel_graphics_context_h_disabled 611 612 NV_STATUS kgrctxGetMainContextBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct MEMORY_DESCRIPTOR **arg2); 613 614 #ifdef __nvoc_kernel_graphics_context_h_disabled 615 static inline NV_STATUS kgrctxGetMainContextBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct MEMORY_DESCRIPTOR **arg2) { 616 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 617 return NV_ERR_NOT_SUPPORTED; 618 } 619 #else //__nvoc_kernel_graphics_context_h_disabled 620 #define kgrctxGetMainContextBuffer(arg0, arg1, arg2) kgrctxGetMainContextBuffer_IMPL(arg0, arg1, arg2) 621 #endif //__nvoc_kernel_graphics_context_h_disabled 622 623 NV_STATUS kgrctxGetBufferCount_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 *pBufferCount); 624 625 #ifdef __nvoc_kernel_graphics_context_h_disabled 626 static inline NV_STATUS kgrctxGetBufferCount(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 *pBufferCount) { 627 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 628 return NV_ERR_NOT_SUPPORTED; 629 } 630 #else //__nvoc_kernel_graphics_context_h_disabled 631 #define kgrctxGetBufferCount(arg0, arg1, arg2, pBufferCount) kgrctxGetBufferCount_IMPL(arg0, arg1, arg2, pBufferCount) 632 #endif //__nvoc_kernel_graphics_context_h_disabled 633 634 NV_STATUS kgrctxGetCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 gfid, NvU32 bufferCount, struct MEMORY_DESCRIPTOR **arg3, NvU32 *pCtxBufferType, NvU32 *pBufferCountOut, NvU32 *pFirstGlobalBuffer); 635 636 #ifdef __nvoc_kernel_graphics_context_h_disabled 637 static inline NV_STATUS kgrctxGetCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 gfid, NvU32 bufferCount, struct MEMORY_DESCRIPTOR **arg3, NvU32 *pCtxBufferType, NvU32 *pBufferCountOut, NvU32 *pFirstGlobalBuffer) { 638 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 639 return NV_ERR_NOT_SUPPORTED; 640 } 641 #else //__nvoc_kernel_graphics_context_h_disabled 642 #define kgrctxGetCtxBuffers(arg0, arg1, arg2, gfid, bufferCount, arg3, pCtxBufferType, pBufferCountOut, pFirstGlobalBuffer) kgrctxGetCtxBuffers_IMPL(arg0, arg1, arg2, gfid, bufferCount, arg3, pCtxBufferType, pBufferCountOut, pFirstGlobalBuffer) 643 #endif //__nvoc_kernel_graphics_context_h_disabled 644 645 NV_STATUS kgrctxGetCtxBufferInfo_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 gfid, NvU32 bufferMaxCount, NvU32 *pBufferCount, NV2080_CTRL_GR_CTX_BUFFER_INFO *arg3); 646 647 #ifdef __nvoc_kernel_graphics_context_h_disabled 648 static inline NV_STATUS kgrctxGetCtxBufferInfo(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 gfid, NvU32 bufferMaxCount, NvU32 *pBufferCount, NV2080_CTRL_GR_CTX_BUFFER_INFO *arg3) { 649 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 650 return NV_ERR_NOT_SUPPORTED; 651 } 652 #else //__nvoc_kernel_graphics_context_h_disabled 653 #define kgrctxGetCtxBufferInfo(arg0, arg1, arg2, gfid, bufferMaxCount, pBufferCount, arg3) kgrctxGetCtxBufferInfo_IMPL(arg0, arg1, arg2, gfid, bufferMaxCount, pBufferCount, arg3) 654 #endif //__nvoc_kernel_graphics_context_h_disabled 655 656 NV_STATUS kgrctxGetCtxBufferPtes_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 gfid, NvU32 bufferType, NvU32 firstPage, NvU64 *pPhysAddrs, NvU32 addrsSize, NvU32 *pNumPages, NvBool *pbNoMorePages); 657 658 #ifdef __nvoc_kernel_graphics_context_h_disabled 659 static inline NV_STATUS kgrctxGetCtxBufferPtes(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 gfid, NvU32 bufferType, NvU32 firstPage, NvU64 *pPhysAddrs, NvU32 addrsSize, NvU32 *pNumPages, NvBool *pbNoMorePages) { 660 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 661 return NV_ERR_NOT_SUPPORTED; 662 } 663 #else //__nvoc_kernel_graphics_context_h_disabled 664 #define kgrctxGetCtxBufferPtes(arg0, arg1, arg2, gfid, bufferType, firstPage, pPhysAddrs, addrsSize, pNumPages, pbNoMorePages) kgrctxGetCtxBufferPtes_IMPL(arg0, arg1, arg2, gfid, bufferType, firstPage, pPhysAddrs, addrsSize, pNumPages, pbNoMorePages) 665 #endif //__nvoc_kernel_graphics_context_h_disabled 666 667 NV_STATUS kgrctxAllocMainCtxBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3); 668 669 #ifdef __nvoc_kernel_graphics_context_h_disabled 670 static inline NV_STATUS kgrctxAllocMainCtxBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3) { 671 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 672 return NV_ERR_NOT_SUPPORTED; 673 } 674 #else //__nvoc_kernel_graphics_context_h_disabled 675 #define kgrctxAllocMainCtxBuffer(arg0, arg1, arg2, arg3) kgrctxAllocMainCtxBuffer_IMPL(arg0, arg1, arg2, arg3) 676 #endif //__nvoc_kernel_graphics_context_h_disabled 677 678 NV_STATUS kgrctxAllocPatchBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3); 679 680 #ifdef __nvoc_kernel_graphics_context_h_disabled 681 static inline NV_STATUS kgrctxAllocPatchBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3) { 682 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 683 return NV_ERR_NOT_SUPPORTED; 684 } 685 #else //__nvoc_kernel_graphics_context_h_disabled 686 #define kgrctxAllocPatchBuffer(arg0, arg1, arg2, arg3) kgrctxAllocPatchBuffer_IMPL(arg0, arg1, arg2, arg3) 687 #endif //__nvoc_kernel_graphics_context_h_disabled 688 689 NV_STATUS kgrctxAllocPmBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3); 690 691 #ifdef __nvoc_kernel_graphics_context_h_disabled 692 static inline NV_STATUS kgrctxAllocPmBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3) { 693 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 694 return NV_ERR_NOT_SUPPORTED; 695 } 696 #else //__nvoc_kernel_graphics_context_h_disabled 697 #define kgrctxAllocPmBuffer(arg0, arg1, arg2, arg3) kgrctxAllocPmBuffer_IMPL(arg0, arg1, arg2, arg3) 698 #endif //__nvoc_kernel_graphics_context_h_disabled 699 700 NV_STATUS kgrctxAllocCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelGraphicsObject *arg3); 701 702 #ifdef __nvoc_kernel_graphics_context_h_disabled 703 static inline NV_STATUS kgrctxAllocCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelGraphicsObject *arg3) { 704 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 705 return NV_ERR_NOT_SUPPORTED; 706 } 707 #else //__nvoc_kernel_graphics_context_h_disabled 708 #define kgrctxAllocCtxBuffers(arg0, arg1, arg2, arg3) kgrctxAllocCtxBuffers_IMPL(arg0, arg1, arg2, arg3) 709 #endif //__nvoc_kernel_graphics_context_h_disabled 710 711 NV_STATUS kgrctxMapGlobalCtxBuffer_IMPL(struct OBJGPU *pGpu, struct KernelGraphicsContext *arg0, struct KernelGraphics *arg1, NvU32 gfid, struct OBJVASPACE *arg2, GR_GLOBALCTX_BUFFER arg3, NvBool bIsReadOnly); 712 713 #ifdef __nvoc_kernel_graphics_context_h_disabled 714 static inline NV_STATUS kgrctxMapGlobalCtxBuffer(struct OBJGPU *pGpu, struct KernelGraphicsContext *arg0, struct KernelGraphics *arg1, NvU32 gfid, struct OBJVASPACE *arg2, GR_GLOBALCTX_BUFFER arg3, NvBool bIsReadOnly) { 715 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 716 return NV_ERR_NOT_SUPPORTED; 717 } 718 #else //__nvoc_kernel_graphics_context_h_disabled 719 #define kgrctxMapGlobalCtxBuffer(pGpu, arg0, arg1, gfid, arg2, arg3, bIsReadOnly) kgrctxMapGlobalCtxBuffer_IMPL(pGpu, arg0, arg1, gfid, arg2, arg3, bIsReadOnly) 720 #endif //__nvoc_kernel_graphics_context_h_disabled 721 722 NV_STATUS kgrctxMapGlobalCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 gfid, struct KernelChannel *arg3); 723 724 #ifdef __nvoc_kernel_graphics_context_h_disabled 725 static inline NV_STATUS kgrctxMapGlobalCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, NvU32 gfid, struct KernelChannel *arg3) { 726 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 727 return NV_ERR_NOT_SUPPORTED; 728 } 729 #else //__nvoc_kernel_graphics_context_h_disabled 730 #define kgrctxMapGlobalCtxBuffers(arg0, arg1, arg2, gfid, arg3) kgrctxMapGlobalCtxBuffers_IMPL(arg0, arg1, arg2, gfid, arg3) 731 #endif //__nvoc_kernel_graphics_context_h_disabled 732 733 NV_STATUS kgrctxMapCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelGraphicsObject *arg3); 734 735 #ifdef __nvoc_kernel_graphics_context_h_disabled 736 static inline NV_STATUS kgrctxMapCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelGraphicsObject *arg3) { 737 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 738 return NV_ERR_NOT_SUPPORTED; 739 } 740 #else //__nvoc_kernel_graphics_context_h_disabled 741 #define kgrctxMapCtxBuffers(arg0, arg1, arg2, arg3) kgrctxMapCtxBuffers_IMPL(arg0, arg1, arg2, arg3) 742 #endif //__nvoc_kernel_graphics_context_h_disabled 743 744 NV_STATUS kgrctxPrepareInitializeCtxBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3, NvU32 externalId, NV2080_CTRL_GPU_PROMOTE_CTX_BUFFER_ENTRY *arg4, NvBool *pbAddEntry); 745 746 #ifdef __nvoc_kernel_graphics_context_h_disabled 747 static inline NV_STATUS kgrctxPrepareInitializeCtxBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3, NvU32 externalId, NV2080_CTRL_GPU_PROMOTE_CTX_BUFFER_ENTRY *arg4, NvBool *pbAddEntry) { 748 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 749 return NV_ERR_NOT_SUPPORTED; 750 } 751 #else //__nvoc_kernel_graphics_context_h_disabled 752 #define kgrctxPrepareInitializeCtxBuffer(arg0, arg1, arg2, arg3, externalId, arg4, pbAddEntry) kgrctxPrepareInitializeCtxBuffer_IMPL(arg0, arg1, arg2, arg3, externalId, arg4, pbAddEntry) 753 #endif //__nvoc_kernel_graphics_context_h_disabled 754 755 NV_STATUS kgrctxPreparePromoteCtxBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelChannel *arg2, NvU32 externalId, NV2080_CTRL_GPU_PROMOTE_CTX_BUFFER_ENTRY *arg3, NvBool *pbAddEntry); 756 757 #ifdef __nvoc_kernel_graphics_context_h_disabled 758 static inline NV_STATUS kgrctxPreparePromoteCtxBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelChannel *arg2, NvU32 externalId, NV2080_CTRL_GPU_PROMOTE_CTX_BUFFER_ENTRY *arg3, NvBool *pbAddEntry) { 759 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 760 return NV_ERR_NOT_SUPPORTED; 761 } 762 #else //__nvoc_kernel_graphics_context_h_disabled 763 #define kgrctxPreparePromoteCtxBuffer(arg0, arg1, arg2, externalId, arg3, pbAddEntry) kgrctxPreparePromoteCtxBuffer_IMPL(arg0, arg1, arg2, externalId, arg3, pbAddEntry) 764 #endif //__nvoc_kernel_graphics_context_h_disabled 765 766 void kgrctxMarkCtxBufferInitialized_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3, NvU32 externalId); 767 768 #ifdef __nvoc_kernel_graphics_context_h_disabled 769 static inline void kgrctxMarkCtxBufferInitialized(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3, NvU32 externalId) { 770 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 771 } 772 #else //__nvoc_kernel_graphics_context_h_disabled 773 #define kgrctxMarkCtxBufferInitialized(arg0, arg1, arg2, arg3, externalId) kgrctxMarkCtxBufferInitialized_IMPL(arg0, arg1, arg2, arg3, externalId) 774 #endif //__nvoc_kernel_graphics_context_h_disabled 775 776 NV_STATUS kgrctxSetupDeferredPmBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3); 777 778 #ifdef __nvoc_kernel_graphics_context_h_disabled 779 static inline NV_STATUS kgrctxSetupDeferredPmBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3) { 780 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 781 return NV_ERR_NOT_SUPPORTED; 782 } 783 #else //__nvoc_kernel_graphics_context_h_disabled 784 #define kgrctxSetupDeferredPmBuffer(arg0, arg1, arg2, arg3) kgrctxSetupDeferredPmBuffer_IMPL(arg0, arg1, arg2, arg3) 785 #endif //__nvoc_kernel_graphics_context_h_disabled 786 787 void kgrctxUnmapGlobalCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3, NvU32 gfid); 788 789 #ifdef __nvoc_kernel_graphics_context_h_disabled 790 static inline void kgrctxUnmapGlobalCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3, NvU32 gfid) { 791 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 792 } 793 #else //__nvoc_kernel_graphics_context_h_disabled 794 #define kgrctxUnmapGlobalCtxBuffers(arg0, arg1, arg2, arg3, gfid) kgrctxUnmapGlobalCtxBuffers_IMPL(arg0, arg1, arg2, arg3, gfid) 795 #endif //__nvoc_kernel_graphics_context_h_disabled 796 797 void kgrctxUnmapGlobalCtxBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3, GR_GLOBALCTX_BUFFER arg4); 798 799 #ifdef __nvoc_kernel_graphics_context_h_disabled 800 static inline void kgrctxUnmapGlobalCtxBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3, GR_GLOBALCTX_BUFFER arg4) { 801 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 802 } 803 #else //__nvoc_kernel_graphics_context_h_disabled 804 #define kgrctxUnmapGlobalCtxBuffer(arg0, arg1, arg2, arg3, arg4) kgrctxUnmapGlobalCtxBuffer_IMPL(arg0, arg1, arg2, arg3, arg4) 805 #endif //__nvoc_kernel_graphics_context_h_disabled 806 807 void kgrctxUnmapMainCtxBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3); 808 809 #ifdef __nvoc_kernel_graphics_context_h_disabled 810 static inline void kgrctxUnmapMainCtxBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3) { 811 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 812 } 813 #else //__nvoc_kernel_graphics_context_h_disabled 814 #define kgrctxUnmapMainCtxBuffer(arg0, arg1, arg2, arg3) kgrctxUnmapMainCtxBuffer_IMPL(arg0, arg1, arg2, arg3) 815 #endif //__nvoc_kernel_graphics_context_h_disabled 816 817 void kgrctxUnmapCtxPmBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3); 818 819 #ifdef __nvoc_kernel_graphics_context_h_disabled 820 static inline void kgrctxUnmapCtxPmBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3) { 821 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 822 } 823 #else //__nvoc_kernel_graphics_context_h_disabled 824 #define kgrctxUnmapCtxPmBuffer(arg0, arg1, arg2, arg3) kgrctxUnmapCtxPmBuffer_IMPL(arg0, arg1, arg2, arg3) 825 #endif //__nvoc_kernel_graphics_context_h_disabled 826 827 void kgrctxUnmapCtxZcullBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3); 828 829 #ifdef __nvoc_kernel_graphics_context_h_disabled 830 static inline void kgrctxUnmapCtxZcullBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3) { 831 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 832 } 833 #else //__nvoc_kernel_graphics_context_h_disabled 834 #define kgrctxUnmapCtxZcullBuffer(arg0, arg1, arg2, arg3) kgrctxUnmapCtxZcullBuffer_IMPL(arg0, arg1, arg2, arg3) 835 #endif //__nvoc_kernel_graphics_context_h_disabled 836 837 void kgrctxUnmapCtxPreemptionBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3); 838 839 #ifdef __nvoc_kernel_graphics_context_h_disabled 840 static inline void kgrctxUnmapCtxPreemptionBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct OBJVASPACE *arg3) { 841 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 842 } 843 #else //__nvoc_kernel_graphics_context_h_disabled 844 #define kgrctxUnmapCtxPreemptionBuffers(arg0, arg1, arg2, arg3) kgrctxUnmapCtxPreemptionBuffers_IMPL(arg0, arg1, arg2, arg3) 845 #endif //__nvoc_kernel_graphics_context_h_disabled 846 847 void kgrctxUnmapAssociatedCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3); 848 849 #ifdef __nvoc_kernel_graphics_context_h_disabled 850 static inline void kgrctxUnmapAssociatedCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1, struct KernelGraphics *arg2, struct KernelChannel *arg3) { 851 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 852 } 853 #else //__nvoc_kernel_graphics_context_h_disabled 854 #define kgrctxUnmapAssociatedCtxBuffers(arg0, arg1, arg2, arg3) kgrctxUnmapAssociatedCtxBuffers_IMPL(arg0, arg1, arg2, arg3) 855 #endif //__nvoc_kernel_graphics_context_h_disabled 856 857 void kgrctxFreeMainCtxBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 858 859 #ifdef __nvoc_kernel_graphics_context_h_disabled 860 static inline void kgrctxFreeMainCtxBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 861 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 862 } 863 #else //__nvoc_kernel_graphics_context_h_disabled 864 #define kgrctxFreeMainCtxBuffer(arg0, arg1) kgrctxFreeMainCtxBuffer_IMPL(arg0, arg1) 865 #endif //__nvoc_kernel_graphics_context_h_disabled 866 867 void kgrctxFreeZcullBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 868 869 #ifdef __nvoc_kernel_graphics_context_h_disabled 870 static inline void kgrctxFreeZcullBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 871 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 872 } 873 #else //__nvoc_kernel_graphics_context_h_disabled 874 #define kgrctxFreeZcullBuffer(arg0, arg1) kgrctxFreeZcullBuffer_IMPL(arg0, arg1) 875 #endif //__nvoc_kernel_graphics_context_h_disabled 876 877 void kgrctxFreeCtxPreemptionBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 878 879 #ifdef __nvoc_kernel_graphics_context_h_disabled 880 static inline void kgrctxFreeCtxPreemptionBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 881 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 882 } 883 #else //__nvoc_kernel_graphics_context_h_disabled 884 #define kgrctxFreeCtxPreemptionBuffers(arg0, arg1) kgrctxFreeCtxPreemptionBuffers_IMPL(arg0, arg1) 885 #endif //__nvoc_kernel_graphics_context_h_disabled 886 887 void kgrctxFreePatchBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 888 889 #ifdef __nvoc_kernel_graphics_context_h_disabled 890 static inline void kgrctxFreePatchBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 891 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 892 } 893 #else //__nvoc_kernel_graphics_context_h_disabled 894 #define kgrctxFreePatchBuffer(arg0, arg1) kgrctxFreePatchBuffer_IMPL(arg0, arg1) 895 #endif //__nvoc_kernel_graphics_context_h_disabled 896 897 void kgrctxFreePmBuffer_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 898 899 #ifdef __nvoc_kernel_graphics_context_h_disabled 900 static inline void kgrctxFreePmBuffer(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 901 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 902 } 903 #else //__nvoc_kernel_graphics_context_h_disabled 904 #define kgrctxFreePmBuffer(arg0, arg1) kgrctxFreePmBuffer_IMPL(arg0, arg1) 905 #endif //__nvoc_kernel_graphics_context_h_disabled 906 907 void kgrctxFreeLocalGlobalCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 908 909 #ifdef __nvoc_kernel_graphics_context_h_disabled 910 static inline void kgrctxFreeLocalGlobalCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 911 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 912 } 913 #else //__nvoc_kernel_graphics_context_h_disabled 914 #define kgrctxFreeLocalGlobalCtxBuffers(arg0, arg1) kgrctxFreeLocalGlobalCtxBuffers_IMPL(arg0, arg1) 915 #endif //__nvoc_kernel_graphics_context_h_disabled 916 917 void kgrctxFreeAssociatedCtxBuffers_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1); 918 919 #ifdef __nvoc_kernel_graphics_context_h_disabled 920 static inline void kgrctxFreeAssociatedCtxBuffers(struct OBJGPU *arg0, struct KernelGraphicsContext *arg1) { 921 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContext was disabled!"); 922 } 923 #else //__nvoc_kernel_graphics_context_h_disabled 924 #define kgrctxFreeAssociatedCtxBuffers(arg0, arg1) kgrctxFreeAssociatedCtxBuffers_IMPL(arg0, arg1) 925 #endif //__nvoc_kernel_graphics_context_h_disabled 926 927 #undef PRIVATE_FIELD 928 929 930 /** 931 * This refcounted class encapsulates the context data that is shared when a 932 * context is duped. 933 */ 934 #ifdef NVOC_KERNEL_GRAPHICS_CONTEXT_H_PRIVATE_ACCESS_ALLOWED 935 #define PRIVATE_FIELD(x) x 936 #else 937 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x) 938 #endif 939 struct KernelGraphicsContextUnicast { 940 NvU32 channelObjects; 941 NvU32 objectCounts[4]; 942 NV_CONTEXT_BUFFER ctxPatchBuffer; 943 NV_CONTEXT_BUFFER zcullCtxswBuffer; 944 NV_CONTEXT_BUFFER pmCtxswBuffer; 945 struct MEMORY_DESCRIPTOR *pMainCtxBuffer; 946 GR_GLOBALCTX_BUFFERS localCtxBuffer; 947 VA_LIST globalCtxBufferVaList[10]; 948 NvBool bKGrMainCtxBufferInitialized; 949 NvBool bKGrPatchCtxBufferInitialized; 950 NvBool bKGrPmCtxBufferInitialized; 951 NV_CONTEXT_BUFFER preemptCtxswBuffer; 952 NV_CONTEXT_BUFFER spillCtxswBuffer; 953 NV_CONTEXT_BUFFER betaCBCtxswBuffer; 954 NV_CONTEXT_BUFFER pagepoolCtxswBuffer; 955 NV_CONTEXT_BUFFER rtvCbCtxswBuffer; 956 NvBool bVprChannel; 957 NvBool bSupportsPerSubctxHeader; 958 struct MMU_FAULT_INFO { 959 NV83DE_MMU_FAULT_INFO mmuFaultInfo; 960 NV83DE_CTRL_DEBUG_READ_MMU_FAULT_INFO_ENTRY mmuFaultInfoList[4]; 961 NvU32 head; 962 NvU32 tail; 963 } mmuFault; 964 }; 965 966 967 struct KernelGraphicsContextShared { 968 const struct NVOC_RTTI *__nvoc_rtti; 969 struct RsShared __nvoc_base_RsShared; 970 struct Object *__nvoc_pbase_Object; 971 struct RsShared *__nvoc_pbase_RsShared; 972 struct KernelGraphicsContextShared *__nvoc_pbase_KernelGraphicsContextShared; 973 struct KernelGraphicsContextUnicast PRIVATE_FIELD(kernelGraphicsContextUnicast); 974 }; 975 976 #ifndef __NVOC_CLASS_KernelGraphicsContextShared_TYPEDEF__ 977 #define __NVOC_CLASS_KernelGraphicsContextShared_TYPEDEF__ 978 typedef struct KernelGraphicsContextShared KernelGraphicsContextShared; 979 #endif /* __NVOC_CLASS_KernelGraphicsContextShared_TYPEDEF__ */ 980 981 #ifndef __nvoc_class_id_KernelGraphicsContextShared 982 #define __nvoc_class_id_KernelGraphicsContextShared 0xe7abeb 983 #endif /* __nvoc_class_id_KernelGraphicsContextShared */ 984 985 extern const struct NVOC_CLASS_DEF __nvoc_class_def_KernelGraphicsContextShared; 986 987 #define __staticCast_KernelGraphicsContextShared(pThis) \ 988 ((pThis)->__nvoc_pbase_KernelGraphicsContextShared) 989 990 #ifdef __nvoc_kernel_graphics_context_h_disabled 991 #define __dynamicCast_KernelGraphicsContextShared(pThis) ((KernelGraphicsContextShared*)NULL) 992 #else //__nvoc_kernel_graphics_context_h_disabled 993 #define __dynamicCast_KernelGraphicsContextShared(pThis) \ 994 ((KernelGraphicsContextShared*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(KernelGraphicsContextShared))) 995 #endif //__nvoc_kernel_graphics_context_h_disabled 996 997 998 NV_STATUS __nvoc_objCreateDynamic_KernelGraphicsContextShared(KernelGraphicsContextShared**, Dynamic*, NvU32, va_list); 999 1000 NV_STATUS __nvoc_objCreate_KernelGraphicsContextShared(KernelGraphicsContextShared**, Dynamic*, NvU32); 1001 #define __objCreate_KernelGraphicsContextShared(ppNewObj, pParent, createFlags) \ 1002 __nvoc_objCreate_KernelGraphicsContextShared((ppNewObj), staticCast((pParent), Dynamic), (createFlags)) 1003 1004 NV_STATUS shrkgrctxConstruct_IMPL(struct KernelGraphicsContextShared *arg_); 1005 1006 #define __nvoc_shrkgrctxConstruct(arg_) shrkgrctxConstruct_IMPL(arg_) 1007 NV_STATUS shrkgrctxInit_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2); 1008 1009 #ifdef __nvoc_kernel_graphics_context_h_disabled 1010 static inline NV_STATUS shrkgrctxInit(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2) { 1011 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContextShared was disabled!"); 1012 return NV_ERR_NOT_SUPPORTED; 1013 } 1014 #else //__nvoc_kernel_graphics_context_h_disabled 1015 #define shrkgrctxInit(arg0, arg1, arg2) shrkgrctxInit_IMPL(arg0, arg1, arg2) 1016 #endif //__nvoc_kernel_graphics_context_h_disabled 1017 1018 NV_STATUS shrkgrctxConstructUnicast_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2, struct KernelGraphics *arg3, KernelGraphicsContextUnicast *arg4); 1019 1020 #ifdef __nvoc_kernel_graphics_context_h_disabled 1021 static inline NV_STATUS shrkgrctxConstructUnicast(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2, struct KernelGraphics *arg3, KernelGraphicsContextUnicast *arg4) { 1022 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContextShared was disabled!"); 1023 return NV_ERR_NOT_SUPPORTED; 1024 } 1025 #else //__nvoc_kernel_graphics_context_h_disabled 1026 #define shrkgrctxConstructUnicast(arg0, arg1, arg2, arg3, arg4) shrkgrctxConstructUnicast_IMPL(arg0, arg1, arg2, arg3, arg4) 1027 #endif //__nvoc_kernel_graphics_context_h_disabled 1028 1029 void shrkgrctxDestruct_IMPL(struct KernelGraphicsContextShared *arg0); 1030 1031 #define __nvoc_shrkgrctxDestruct(arg0) shrkgrctxDestruct_IMPL(arg0) 1032 void shrkgrctxTeardown_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2); 1033 1034 #ifdef __nvoc_kernel_graphics_context_h_disabled 1035 static inline void shrkgrctxTeardown(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2) { 1036 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContextShared was disabled!"); 1037 } 1038 #else //__nvoc_kernel_graphics_context_h_disabled 1039 #define shrkgrctxTeardown(arg0, arg1, arg2) shrkgrctxTeardown_IMPL(arg0, arg1, arg2) 1040 #endif //__nvoc_kernel_graphics_context_h_disabled 1041 1042 void shrkgrctxDestructUnicast_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2, KernelGraphicsContextUnicast *arg3); 1043 1044 #ifdef __nvoc_kernel_graphics_context_h_disabled 1045 static inline void shrkgrctxDestructUnicast(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2, KernelGraphicsContextUnicast *arg3) { 1046 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContextShared was disabled!"); 1047 } 1048 #else //__nvoc_kernel_graphics_context_h_disabled 1049 #define shrkgrctxDestructUnicast(arg0, arg1, arg2, arg3) shrkgrctxDestructUnicast_IMPL(arg0, arg1, arg2, arg3) 1050 #endif //__nvoc_kernel_graphics_context_h_disabled 1051 1052 void shrkgrctxDetach_IMPL(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2, struct KernelChannel *arg3); 1053 1054 #ifdef __nvoc_kernel_graphics_context_h_disabled 1055 static inline void shrkgrctxDetach(struct OBJGPU *arg0, struct KernelGraphicsContextShared *arg1, struct KernelGraphicsContext *arg2, struct KernelChannel *arg3) { 1056 NV_ASSERT_FAILED_PRECOMP("KernelGraphicsContextShared was disabled!"); 1057 } 1058 #else //__nvoc_kernel_graphics_context_h_disabled 1059 #define shrkgrctxDetach(arg0, arg1, arg2, arg3) shrkgrctxDetach_IMPL(arg0, arg1, arg2, arg3) 1060 #endif //__nvoc_kernel_graphics_context_h_disabled 1061 1062 #undef PRIVATE_FIELD 1063 1064 1065 /*! Handle NV0090 ctrl call forwarding */ 1066 NV_STATUS kgrctxCtrlHandle 1067 ( 1068 CALL_CONTEXT *, 1069 NvHandle hKernelGraphicsContext 1070 ); 1071 1072 #endif // _KERNEL_GRAPHICS_CONTEXT_H_ 1073 1074 #ifdef __cplusplus 1075 } // extern "C" 1076 #endif 1077 #endif // _G_KERNEL_GRAPHICS_CONTEXT_NVOC_H_ 1078