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