ctxnvc0.h 7.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#ifndef __NVKM_GRCTX_NVC0_H__
#define __NVKM_GRCTX_NVC0_H__

#include "nvc0.h"

struct nvc0_grctx {
	struct nvc0_graph_priv *priv;
	struct nvc0_graph_data *data;
	struct nvc0_graph_mmio *mmio;
	int buffer_nr;
	u64 buffer[4];
	u64 addr;
};

15 16 17 18 19 20 21 22 23 24 25
int  nvc0_grctx_mmio_data(struct nvc0_grctx *, u32 size, u32 align, u32 access);
void nvc0_grctx_mmio_item(struct nvc0_grctx *, u32 addr, u32 data, int s, int);

#define mmio_data(a,b,c) nvc0_grctx_mmio_data(info, (a), (b), (c))
#define mmio_list(a,b,c,d) nvc0_grctx_mmio_item(info, (a), (b), (c), (d))

#define mmio_vram(a,b,c,d) nvc0_grctx_mmio_data((a), (b), (c), (d))
#define mmio_refn(a,b,c,d,e) nvc0_grctx_mmio_item((a), (b), (c), (d), (e))
#define mmio_skip(a,b,c) mmio_refn((a), (b), (c), -1, -1)
#define mmio_wr32(a,b,c) mmio_refn((a), (b), (c),  0, -1)

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
struct nvc0_grctx_oclass {
	struct nouveau_oclass base;
	/* main context generation function */
	void  (*main)(struct nvc0_graph_priv *, struct nvc0_grctx *);
	/* context-specific modify-on-first-load list generation function */
	void  (*mods)(struct nvc0_graph_priv *, struct nvc0_grctx *);
	void  (*unkn)(struct nvc0_graph_priv *);
	/* mmio context data */
	const struct nvc0_graph_pack *hub;
	const struct nvc0_graph_pack *gpc;
	const struct nvc0_graph_pack *zcull;
	const struct nvc0_graph_pack *tpc;
	const struct nvc0_graph_pack *ppc;
	/* indirect context data, generated with icmds/mthds */
	const struct nvc0_graph_pack *icmd;
	const struct nvc0_graph_pack *mthd;
};

extern struct nouveau_oclass *nvc0_grctx_oclass;
int  nvc0_grctx_generate(struct nvc0_graph_priv *);
void nvc0_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *);
void nvc0_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *);
void nvc0_grctx_generate_unkn(struct nvc0_graph_priv *);
void nvc0_grctx_generate_tpcid(struct nvc0_graph_priv *);
void nvc0_grctx_generate_r406028(struct nvc0_graph_priv *);
void nvc0_grctx_generate_r4060a8(struct nvc0_graph_priv *);
void nvc0_grctx_generate_r418bb8(struct nvc0_graph_priv *);
void nvc0_grctx_generate_r406800(struct nvc0_graph_priv *);

extern struct nouveau_oclass *nvc1_grctx_oclass;
void nvc1_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *);
void nvc1_grctx_generate_unkn(struct nvc0_graph_priv *);

extern struct nouveau_oclass *nvc4_grctx_oclass;
extern struct nouveau_oclass *nvc8_grctx_oclass;
extern struct nouveau_oclass *nvd7_grctx_oclass;
extern struct nouveau_oclass *nvd9_grctx_oclass;

extern struct nouveau_oclass *nve4_grctx_oclass;
65
extern struct nouveau_oclass *gk20a_grctx_oclass;
66
void nve4_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *);
67
void nve4_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *);
68 69 70
void nve4_grctx_generate_unkn(struct nvc0_graph_priv *);
void nve4_grctx_generate_r418bb8(struct nvc0_graph_priv *);

71 72
void nvf0_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *);

73
extern struct nouveau_oclass *nvf0_grctx_oclass;
74
extern struct nouveau_oclass *gk110b_grctx_oclass;
75
extern struct nouveau_oclass *nv108_grctx_oclass;
B
Ben Skeggs 已提交
76
extern struct nouveau_oclass *gm107_grctx_oclass;
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95

/* context init value lists */

extern const struct nvc0_graph_pack nvc0_grctx_pack_icmd[];

extern const struct nvc0_graph_pack nvc0_grctx_pack_mthd[];
extern const struct nvc0_graph_init nvc0_grctx_init_902d_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_9039_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_90c0_0[];

extern const struct nvc0_graph_pack nvc0_grctx_pack_hub[];
extern const struct nvc0_graph_init nvc0_grctx_init_main_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_fe_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_pri_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_memfmt_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_rstr2d_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_scc_0[];

extern const struct nvc0_graph_pack nvc0_grctx_pack_gpc[];
96 97 98 99 100 101 102
extern const struct nvc0_graph_init nvc0_grctx_init_gpc_unk_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_prop_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_gpc_unk_1[];
extern const struct nvc0_graph_init nvc0_grctx_init_zcull_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_crstr_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_gpm_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_gcc_0[];
103 104 105 106

extern const struct nvc0_graph_pack nvc0_grctx_pack_zcull[];

extern const struct nvc0_graph_pack nvc0_grctx_pack_tpc[];
107 108 109 110 111 112 113 114
extern const struct nvc0_graph_init nvc0_grctx_init_pe_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_wwdx_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_mpc_0[];
extern const struct nvc0_graph_init nvc0_grctx_init_tpccs_0[];

extern const struct nvc0_graph_init nvc4_grctx_init_tex_0[];
extern const struct nvc0_graph_init nvc4_grctx_init_l1c_0[];
extern const struct nvc0_graph_init nvc4_grctx_init_sm_0[];
115 116 117

extern const struct nvc0_graph_init nvc1_grctx_init_9097_0[];

118 119
extern const struct nvc0_graph_init nvc1_grctx_init_gpm_0[];

120 121 122 123
extern const struct nvc0_graph_init nvc1_grctx_init_pe_0[];
extern const struct nvc0_graph_init nvc1_grctx_init_wwdx_0[];
extern const struct nvc0_graph_init nvc1_grctx_init_tpccs_0[];

124 125 126 127 128 129 130 131 132 133
extern const struct nvc0_graph_init nvc8_grctx_init_9197_0[];
extern const struct nvc0_graph_init nvc8_grctx_init_9297_0[];

extern const struct nvc0_graph_pack nvd9_grctx_pack_icmd[];

extern const struct nvc0_graph_pack nvd9_grctx_pack_mthd[];

extern const struct nvc0_graph_init nvd9_grctx_init_fe_0[];
extern const struct nvc0_graph_init nvd9_grctx_init_be_0[];

134 135 136 137
extern const struct nvc0_graph_init nvd9_grctx_init_prop_0[];
extern const struct nvc0_graph_init nvd9_grctx_init_gpc_unk_1[];
extern const struct nvc0_graph_init nvd9_grctx_init_crstr_0[];

138 139 140 141
extern const struct nvc0_graph_init nvd9_grctx_init_sm_0[];

extern const struct nvc0_graph_init nvd7_grctx_init_pe_0[];

142 143
extern const struct nvc0_graph_init nvd7_grctx_init_wwdx_0[];

144 145 146 147
extern const struct nvc0_graph_init nve4_grctx_init_memfmt_0[];
extern const struct nvc0_graph_init nve4_grctx_init_ds_0[];
extern const struct nvc0_graph_init nve4_grctx_init_scc_0[];

148 149
extern const struct nvc0_graph_init nve4_grctx_init_gpm_0[];

150 151
extern const struct nvc0_graph_init nve4_grctx_init_pes_0[];

152 153 154 155 156 157 158
extern const struct nvc0_graph_pack nve4_grctx_pack_hub[];
extern const struct nvc0_graph_pack nve4_grctx_pack_gpc[];
extern const struct nvc0_graph_pack nve4_grctx_pack_tpc[];
extern const struct nvc0_graph_pack nve4_grctx_pack_ppc[];
extern const struct nvc0_graph_pack nve4_grctx_pack_icmd[];
extern const struct nvc0_graph_init nve4_grctx_init_a097_0[];

159 160
extern const struct nvc0_graph_pack nvf0_grctx_pack_icmd[];

161 162
extern const struct nvc0_graph_pack nvf0_grctx_pack_mthd[];

163
extern const struct nvc0_graph_pack nvf0_grctx_pack_hub[];
164 165 166
extern const struct nvc0_graph_init nvf0_grctx_init_pri_0[];
extern const struct nvc0_graph_init nvf0_grctx_init_cwd_0[];

167
extern const struct nvc0_graph_pack nvf0_grctx_pack_gpc[];
168 169
extern const struct nvc0_graph_init nvf0_grctx_init_gpc_unk_2[];

170
extern const struct nvc0_graph_init nvf0_grctx_init_tex_0[];
171 172 173
extern const struct nvc0_graph_init nvf0_grctx_init_mpc_0[];
extern const struct nvc0_graph_init nvf0_grctx_init_l1c_0[];

174 175
extern const struct nvc0_graph_pack nvf0_grctx_pack_ppc[];

B
Ben Skeggs 已提交
176 177 178 179 180
extern const struct nvc0_graph_init nv108_grctx_init_rstr2d_0[];

extern const struct nvc0_graph_init nv108_grctx_init_prop_0[];
extern const struct nvc0_graph_init nv108_grctx_init_crstr_0[];

181 182

#endif