xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/nvrm/event.h (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
1 /* SPDX-License-Identifier: MIT */
2 
3 /* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. */
4 
5 #ifndef __NVRM_EVENT_H__
6 #define __NVRM_EVENT_H__
7 #include <nvrm/nvtypes.h>
8 
9 /* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.113.01 */
10 
11 #define NV01_EVENT_KERNEL_CALLBACK_EX            (0x0000007e)
12 
13 typedef struct NV0005_ALLOC_PARAMETERS {
14     NvHandle hParentClient;
15     NvHandle hSrcResource;
16 
17     NvV32    hClass;
18     NvV32    notifyIndex;
19     NV_DECLARE_ALIGNED(NvP64 data, 8);
20 } NV0005_ALLOC_PARAMETERS;
21 
22 #define NV01_EVENT_CLIENT_RM                                       (0x04000000)
23 
24 #define NV2080_CTRL_CMD_EVENT_SET_NOTIFICATION (0x20800301) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_EVENT_INTERFACE_ID << 8) | NV2080_CTRL_EVENT_SET_NOTIFICATION_PARAMS_MESSAGE_ID" */
25 typedef struct NV2080_CTRL_EVENT_SET_NOTIFICATION_PARAMS {
26     NvU32  event;
27     NvU32  action;
28     NvBool bNotifyState;
29     NvU32  info32;
30     NvU16  info16;
31 } NV2080_CTRL_EVENT_SET_NOTIFICATION_PARAMS;
32 
33 #define NV2080_CTRL_EVENT_SET_NOTIFICATION_ACTION_REPEAT  (0x00000002)
34 
35 typedef struct rpc_post_event_v17_00
36 {
37     NvHandle   hClient;
38     NvHandle   hEvent;
39     NvU32      notifyIndex;
40     NvU32      data;
41     NvU16      info16;
42     NvU32      status;
43     NvU32      eventDataSize;
44     NvBool     bNotifyList;
45     NvU8       eventData[];
46 } rpc_post_event_v17_00;
47 #endif
48