91d64fff695130ca955b8c9e73b5eb5285df055b
5 #include "nv50/nv50_defs.xml.h"
6 #include "nve4_compute.xml.h"
8 /* Input space is implemented as c0[], to which we bind the screen->parm bo.
10 #define NVE4_CP_INPUT_USER 0x0000
11 #define NVE4_CP_INPUT_USER_LIMIT 0x1000
12 #define NVE4_CP_INPUT_GRID_INFO(i) (0x1000 + (i) * 4)
13 #define NVE4_CP_INPUT_NTID(i) (0x1000 + (i) * 4)
14 #define NVE4_CP_INPUT_NCTAID(i) (0x100c + (i) * 4)
15 #define NVE4_CP_INPUT_GRIDID 0x1018
16 #define NVE4_CP_INPUT_TEX(i) (0x1040 + (i) * 4)
17 #define NVE4_CP_INPUT_TEX_STRIDE 4
18 #define NVE4_CP_INPUT_TEX_MAX 32
19 #define NVE4_CP_INPUT_MS_OFFSETS 0x10c0
20 #define NVE4_CP_INPUT_SUF_STRIDE 64
21 #define NVE4_CP_INPUT_SUF(i) (0x1100 + (i) * NVE4_CP_INPUT_SUF_STRIDE)
22 #define NVE4_CP_INPUT_SUF_MAX 32
23 #define NVE4_CP_INPUT_TRAP_INFO_PTR 0x1900
24 #define NVE4_CP_INPUT_TEMP_PTR 0x1908
25 #define NVE4_CP_INPUT_MP_TEMP_SIZE 0x1910
26 #define NVE4_CP_INPUT_WARP_TEMP_SIZE 0x1914
27 #define NVE4_CP_INPUT_CSTACK_SIZE 0x1918
28 #define NVE4_CP_INPUT_SIZE 0x1a00
29 #define NVE4_CP_PARAM_TRAP_INFO 0x2000
30 #define NVE4_CP_PARAM_TRAP_INFO_SZ (1 << 16)
31 #define NVE4_CP_PARAM_SIZE (NVE4_CP_PARAM_TRAP_INFO + (1 << 16))
33 struct nve4_cp_launch_desc
43 u16 shared_size
; /* must be aligned to 0x100 */
60 u32 local_size_p
: 20;
63 u32 local_size_n
: 20;
71 #define NVE4_COMPUTE_UPLOAD_EXEC_UNKVAL_DATA 0x41
72 #define NVE4_COMPUTE_UPLOAD_EXEC_UNKVAL_DESC 0x11
73 #define NVE4_COMPUTE_UPLOAD_UNK0184_UNKVAL 0x1
76 nve4_cp_launch_desc_init_default(struct nve4_cp_launch_desc
*desc
)
78 memset(desc
, 0, sizeof(*desc
));
80 desc
->unk0
[7] = 0xbc000000;
81 desc
->unk9
[2] = 0x44014000;
82 desc
->unk47_20
= 0x300;
86 nve4_cp_launch_desc_set_cb(struct nve4_cp_launch_desc
*desc
,
88 struct nouveau_bo
*bo
,
89 uint32_t base
, uint16_t size
)
91 uint64_t address
= bo
->offset
+ base
;
94 assert(!(base
& 0xff));
95 assert(size
<= 65536);
97 desc
->cb
[index
].address_l
= address
;
98 desc
->cb
[index
].address_h
= address
>> 32;
99 desc
->cb
[index
].size
= size
;
101 desc
->cb_mask
|= 1 << index
;
105 nve4_cp_launch_desc_set_ctx_cb(struct nve4_cp_launch_desc
*desc
,
107 const struct nvc0_constbuf
*cb
)
112 desc
->cb_mask
&= ~(1 << index
);
114 const struct nv04_resource
*buf
= nv04_resource(cb
->u
.buf
);
116 nve4_cp_launch_desc_set_cb(desc
, index
,
117 buf
->bo
, buf
->offset
+ cb
->offset
, cb
->size
);
121 struct nve4_mp_trap_info
{
135 #endif /* NVE4_COMPUTE_H */