Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c33b1e8c authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/gf100-/gr: tidy reg/ctx initval lists, mostly by giving them names



Unit names come from the Android GK20A driver.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 64e4886b
Loading
Loading
Loading
Loading
+74 −894

File changed.

Preview size limit exceeded, changes collapsed.

+113 −115
Original line number Diff line number Diff line
@@ -22,10 +22,14 @@
 * Authors: Ben Skeggs
 */

#include "nvc0.h"
#include "ctxnvc0.h"

struct nvc0_graph_init
nvc0_grctx_init_icmd[] = {
/*******************************************************************************
 * PGRAPH context register lists
 ******************************************************************************/

static const struct nvc0_graph_init
nvc0_grctx_init_icmd_0[] = {
	{ 0x001000,   1, 0x01, 0x00000004 },
	{ 0x0000a9,   1, 0x01, 0x0000ffff },
	{ 0x000038,   1, 0x01, 0x0fac6881 },
@@ -140,8 +144,7 @@ nvc0_grctx_init_icmd[] = {
	{ 0x000586,   1, 0x01, 0x00000040 },
	{ 0x000582,   2, 0x01, 0x00000080 },
	{ 0x0005c2,   1, 0x01, 0x00000001 },
	{ 0x000638,   1, 0x01, 0x00000001 },
	{ 0x000639,   1, 0x01, 0x00000001 },
	{ 0x000638,   2, 0x01, 0x00000001 },
	{ 0x00063a,   1, 0x01, 0x00000002 },
	{ 0x00063b,   2, 0x01, 0x00000001 },
	{ 0x00063d,   1, 0x01, 0x00000002 },
@@ -201,15 +204,13 @@ nvc0_grctx_init_icmd[] = {
	{ 0x000787,   1, 0x01, 0x000000cf },
	{ 0x00078c,   1, 0x01, 0x00000008 },
	{ 0x000792,   1, 0x01, 0x00000001 },
	{ 0x000794,   1, 0x01, 0x00000001 },
	{ 0x000795,   2, 0x01, 0x00000001 },
	{ 0x000794,   3, 0x01, 0x00000001 },
	{ 0x000797,   1, 0x01, 0x000000cf },
	{ 0x000836,   1, 0x01, 0x00000001 },
	{ 0x00079a,   1, 0x01, 0x00000002 },
	{ 0x000833,   1, 0x01, 0x04444480 },
	{ 0x0007a1,   1, 0x01, 0x00000001 },
	{ 0x0007a3,   1, 0x01, 0x00000001 },
	{ 0x0007a4,   2, 0x01, 0x00000001 },
	{ 0x0007a3,   3, 0x01, 0x00000001 },
	{ 0x000831,   1, 0x01, 0x00000004 },
	{ 0x00080c,   1, 0x01, 0x00000002 },
	{ 0x00080d,   2, 0x01, 0x00000100 },
@@ -235,14 +236,12 @@ nvc0_grctx_init_icmd[] = {
	{ 0x0006b1,   1, 0x01, 0x00000011 },
	{ 0x00078c,   1, 0x01, 0x00000008 },
	{ 0x000792,   1, 0x01, 0x00000001 },
	{ 0x000794,   1, 0x01, 0x00000001 },
	{ 0x000795,   2, 0x01, 0x00000001 },
	{ 0x000794,   3, 0x01, 0x00000001 },
	{ 0x000797,   1, 0x01, 0x000000cf },
	{ 0x00079a,   1, 0x01, 0x00000002 },
	{ 0x000833,   1, 0x01, 0x04444480 },
	{ 0x0007a1,   1, 0x01, 0x00000001 },
	{ 0x0007a3,   1, 0x01, 0x00000001 },
	{ 0x0007a4,   2, 0x01, 0x00000001 },
	{ 0x0007a3,   3, 0x01, 0x00000001 },
	{ 0x000831,   1, 0x01, 0x00000004 },
	{ 0x01e100,   1, 0x01, 0x00000001 },
	{ 0x001000,   1, 0x01, 0x00000014 },
@@ -267,8 +266,14 @@ nvc0_grctx_init_icmd[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_9097[] = {
const struct nvc0_graph_pack
nvc0_grctx_pack_icmd[] = {
	{ nvc0_grctx_init_icmd_0 },
	{}
};

static const struct nvc0_graph_init
nvc0_grctx_init_9097_0[] = {
	{ 0x000800,   8, 0x40, 0x00000000 },
	{ 0x000804,   8, 0x40, 0x00000000 },
	{ 0x000808,   8, 0x40, 0x00000400 },
@@ -516,8 +521,7 @@ nvc0_grctx_init_9097[] = {
	{ 0x001350,   1, 0x04, 0x00000002 },
	{ 0x001358,   1, 0x04, 0x00000001 },
	{ 0x0012e4,   1, 0x04, 0x00000000 },
	{ 0x00131c,   1, 0x04, 0x00000000 },
	{ 0x001320,   3, 0x04, 0x00000000 },
	{ 0x00131c,   4, 0x04, 0x00000000 },
	{ 0x0019c0,   1, 0x04, 0x00000000 },
	{ 0x001140,   1, 0x04, 0x00000000 },
	{ 0x0019c4,   1, 0x04, 0x00000000 },
@@ -571,8 +575,8 @@ nvc0_grctx_init_9097[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_902d[] = {
const struct nvc0_graph_init
nvc0_grctx_init_902d_0[] = {
	{ 0x000200,   1, 0x04, 0x000000cf },
	{ 0x000204,   1, 0x04, 0x00000001 },
	{ 0x000208,   1, 0x04, 0x00000020 },
@@ -590,8 +594,8 @@ nvc0_grctx_init_902d[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_9039[] = {
const struct nvc0_graph_init
nvc0_grctx_init_9039_0[] = {
	{ 0x00030c,   3, 0x04, 0x00000000 },
	{ 0x000320,   1, 0x04, 0x00000000 },
	{ 0x000238,   2, 0x04, 0x00000000 },
@@ -599,8 +603,8 @@ nvc0_grctx_init_9039[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_90c0[] = {
const struct nvc0_graph_init
nvc0_grctx_init_90c0_0[] = {
	{ 0x00270c,   8, 0x20, 0x00000000 },
	{ 0x00030c,   1, 0x04, 0x00000001 },
	{ 0x001944,   1, 0x04, 0x00000000 },
@@ -617,38 +621,44 @@ nvc0_grctx_init_90c0[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_base[] = {
const struct nvc0_graph_pack
nvc0_grctx_pack_mthd[] = {
	{ nvc0_grctx_init_9097_0, 0x9097 },
	{ nvc0_grctx_init_902d_0, 0x902d },
	{ nvc0_grctx_init_9039_0, 0x9039 },
	{ nvc0_grctx_init_90c0_0, 0x90c0 },
	{}
};

const struct nvc0_graph_init
nvc0_grctx_init_main_0[] = {
	{ 0x400204,   2, 0x04, 0x00000000 },
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk40xx[] = {
	{ 0x404004,  10, 0x04, 0x00000000 },
const struct nvc0_graph_init
nvc0_grctx_init_fe_0[] = {
	{ 0x404004,  11, 0x04, 0x00000000 },
	{ 0x404044,   1, 0x04, 0x00000000 },
	{ 0x404094,   1, 0x04, 0x00000000 },
	{ 0x404098,  12, 0x04, 0x00000000 },
	{ 0x404094,  13, 0x04, 0x00000000 },
	{ 0x4040c8,   1, 0x04, 0xf0000087 },
	{ 0x4040d0,   6, 0x04, 0x00000000 },
	{ 0x4040e8,   1, 0x04, 0x00001000 },
	{ 0x4040f8,   1, 0x04, 0x00000000 },
	{ 0x404130,   1, 0x04, 0x00000000 },
	{ 0x404134,   1, 0x04, 0x00000000 },
	{ 0x404130,   2, 0x04, 0x00000000 },
	{ 0x404138,   1, 0x04, 0x20000040 },
	{ 0x404150,   1, 0x04, 0x0000002e },
	{ 0x404154,   1, 0x04, 0x00000400 },
	{ 0x404158,   1, 0x04, 0x00000200 },
	{ 0x404164,   1, 0x04, 0x00000055 },
	{ 0x404168,   1, 0x04, 0x00000000 },
	{ 0x404174,   1, 0x04, 0x00000000 },
	{ 0x404178,   2, 0x04, 0x00000000 },
	{ 0x404174,   3, 0x04, 0x00000000 },
	{ 0x404200,   8, 0x04, 0x00000000 },
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk44xx[] = {
const struct nvc0_graph_init
nvc0_grctx_init_pri_0[] = {
	{ 0x404404,  14, 0x04, 0x00000000 },
	{ 0x404460,   2, 0x04, 0x00000000 },
	{ 0x404468,   1, 0x04, 0x00ffffff },
@@ -658,8 +668,8 @@ nvc0_grctx_init_unk44xx[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk46xx[] = {
const struct nvc0_graph_init
nvc0_grctx_init_memfmt_0[] = {
	{ 0x404604,   1, 0x04, 0x00000015 },
	{ 0x404608,   1, 0x04, 0x00000000 },
	{ 0x40460c,   1, 0x04, 0x00002e00 },
@@ -674,19 +684,14 @@ nvc0_grctx_init_unk46xx[] = {
	{ 0x4046a0,   1, 0x04, 0x007f0080 },
	{ 0x4046a4,  18, 0x04, 0x00000000 },
	{ 0x4046f0,   2, 0x04, 0x00000000 },
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk47xx[] = {
	{ 0x404700,  13, 0x04, 0x00000000 },
	{ 0x404734,   1, 0x04, 0x00000100 },
	{ 0x404738,   8, 0x04, 0x00000000 },
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk58xx[] = {
static const struct nvc0_graph_init
nvc0_grctx_init_ds_0[] = {
	{ 0x405800,   1, 0x04, 0x078000bf },
	{ 0x405830,   1, 0x04, 0x02180000 },
	{ 0x405834,   2, 0x04, 0x00000000 },
@@ -697,23 +702,18 @@ nvc0_grctx_init_unk58xx[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk60xx[] = {
static const struct nvc0_graph_init
nvc0_grctx_init_pd_0[] = {
	{ 0x406020,   1, 0x04, 0x000103c1 },
	{ 0x406028,   4, 0x04, 0x00000001 },
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk64xx[] = {
	{ 0x4064a8,   1, 0x04, 0x00000000 },
	{ 0x4064ac,   1, 0x04, 0x00003fff },
	{ 0x4064b4,   2, 0x04, 0x00000000 },
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk78xx[] = {
const struct nvc0_graph_init
nvc0_grctx_init_rstr2d_0[] = {
	{ 0x407804,   1, 0x04, 0x00000023 },
	{ 0x40780c,   1, 0x04, 0x0a418820 },
	{ 0x407810,   1, 0x04, 0x062080e6 },
@@ -725,8 +725,8 @@ nvc0_grctx_init_unk78xx[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_unk80xx[] = {
const struct nvc0_graph_init
nvc0_grctx_init_scc_0[] = {
	{ 0x408000,   2, 0x04, 0x00000000 },
	{ 0x408008,   1, 0x04, 0x00000018 },
	{ 0x40800c,   2, 0x04, 0x00000000 },
@@ -736,8 +736,8 @@ nvc0_grctx_init_unk80xx[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_rop[] = {
static const struct nvc0_graph_init
nvc0_grctx_init_be_0[] = {
	{ 0x408800,   1, 0x04, 0x02802a3c },
	{ 0x408804,   1, 0x04, 0x00000040 },
	{ 0x408808,   1, 0x04, 0x0003e00d },
@@ -748,7 +748,21 @@ nvc0_grctx_init_rop[] = {
	{}
};

struct nvc0_graph_init
const struct nvc0_graph_pack
nvc0_grctx_pack_hub[] = {
	{ nvc0_grctx_init_main_0 },
	{ nvc0_grctx_init_fe_0 },
	{ nvc0_grctx_init_pri_0 },
	{ nvc0_grctx_init_memfmt_0 },
	{ nvc0_grctx_init_ds_0 },
	{ nvc0_grctx_init_pd_0 },
	{ nvc0_grctx_init_rstr2d_0 },
	{ nvc0_grctx_init_scc_0 },
	{ nvc0_grctx_init_be_0 },
	{}
};

static const struct nvc0_graph_init
nvc0_grctx_init_gpc_0[] = {
	{ 0x418380,   1, 0x04, 0x00000016 },
	{ 0x418400,   1, 0x04, 0x38004e00 },
@@ -797,8 +811,14 @@ nvc0_grctx_init_gpc_0[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_gpc_1[] = {
const struct nvc0_graph_pack
nvc0_grctx_pack_gpc[] = {
	{ nvc0_grctx_init_gpc_0 },
	{}
};

static const struct nvc0_graph_init
nvc0_grctx_init_zcullr_0[] = {
	{ 0x418a00,   3, 0x04, 0x00000000 },
	{ 0x418a0c,   1, 0x04, 0x00010000 },
	{ 0x418a10,   3, 0x04, 0x00000000 },
@@ -826,8 +846,14 @@ nvc0_grctx_init_gpc_1[] = {
	{}
};

struct nvc0_graph_init
nvc0_grctx_init_tpc[] = {
const struct nvc0_graph_pack
nvc0_grctx_pack_zcull[] = {
	{ nvc0_grctx_init_zcullr_0 },
	{}
};

static const struct nvc0_graph_init
nvc0_grctx_init_tpc_0[] = {
	{ 0x419818,   1, 0x04, 0x00000000 },
	{ 0x41983c,   1, 0x04, 0x00038bc7 },
	{ 0x419848,   1, 0x04, 0x00000000 },
@@ -868,6 +894,16 @@ nvc0_grctx_init_tpc[] = {
	{}
};

const struct nvc0_graph_pack
nvc0_grctx_pack_tpc[] = {
	{ nvc0_grctx_init_tpc_0 },
	{}
};

/*******************************************************************************
 * PGRAPH context implementation
 ******************************************************************************/

void
nvc0_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info)
{
@@ -1055,14 +1091,14 @@ void
nvc0_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info)
{
	struct nvc0_grctx_oclass *oclass = (void *)nv_engine(priv)->cclass;
	int i;

	nv_mask(priv, 0x000260, 0x00000001, 0x00000000);

	for (i = 0; oclass->hub[i]; i++)
		nvc0_graph_mmio(priv, oclass->hub[i]);
	for (i = 0; oclass->gpc[i]; i++)
		nvc0_graph_mmio(priv, oclass->gpc[i]);
	nvc0_graph_mmio(priv, oclass->hub);
	nvc0_graph_mmio(priv, oclass->gpc);
	nvc0_graph_mmio(priv, oclass->zcull);
	nvc0_graph_mmio(priv, oclass->tpc);
	nvc0_graph_mmio(priv, oclass->ppc);

	nv_wr32(priv, 0x404154, 0x00000000);

@@ -1182,46 +1218,6 @@ nvc0_grctx_generate(struct nvc0_graph_priv *priv)
	return ret;
}

struct nvc0_graph_init *
nvc0_grctx_init_hub[] = {
	nvc0_grctx_init_base,
	nvc0_grctx_init_unk40xx,
	nvc0_grctx_init_unk44xx,
	nvc0_grctx_init_unk46xx,
	nvc0_grctx_init_unk47xx,
	nvc0_grctx_init_unk58xx,
	nvc0_grctx_init_unk60xx,
	nvc0_grctx_init_unk64xx,
	nvc0_grctx_init_unk78xx,
	nvc0_grctx_init_unk80xx,
	nvc0_grctx_init_rop,
	NULL
};

static struct nvc0_graph_init *
nvc0_grctx_init_gpc[] = {
	nvc0_grctx_init_gpc_0,
	nvc0_grctx_init_gpc_1,
	nvc0_grctx_init_tpc,
	NULL
};

struct nvc0_graph_init
nvc0_grctx_init_mthd_magic[] = {
	{ 0x3410, 1, 0x04, 0x00000000 },
	{}
};

struct nvc0_graph_mthd
nvc0_grctx_init_mthd[] = {
	{ 0x9097, nvc0_grctx_init_9097, },
	{ 0x902d, nvc0_grctx_init_902d, },
	{ 0x9039, nvc0_grctx_init_9039, },
	{ 0x90c0, nvc0_grctx_init_90c0, },
	{ 0x902d, nvc0_grctx_init_mthd_magic, },
	{}
};

struct nouveau_oclass *
nvc0_grctx_oclass = &(struct nvc0_grctx_oclass) {
	.base.handle = NV_ENGCTX(GR, 0xc0),
@@ -1236,8 +1232,10 @@ nvc0_grctx_oclass = &(struct nvc0_grctx_oclass) {
	.main  = nvc0_grctx_generate_main,
	.mods  = nvc0_grctx_generate_mods,
	.unkn  = nvc0_grctx_generate_unkn,
	.hub  = nvc0_grctx_init_hub,
	.gpc  = nvc0_grctx_init_gpc,
	.icmd = nvc0_grctx_init_icmd,
	.mthd = nvc0_grctx_init_mthd,
	.hub   = nvc0_grctx_pack_hub,
	.gpc   = nvc0_grctx_pack_gpc,
	.zcull = nvc0_grctx_pack_zcull,
	.tpc   = nvc0_grctx_pack_tpc,
	.icmd  = nvc0_grctx_pack_icmd,
	.mthd  = nvc0_grctx_pack_mthd,
}.base;
+124 −0
Original line number Diff line number Diff line
#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;
};

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;
};

#define mmio_data(s,a,p) do {                                                  \
	info->buffer[info->buffer_nr] = round_up(info->addr, (a));             \
	info->addr = info->buffer[info->buffer_nr++] + (s);                    \
	info->data->size = (s);                                                \
	info->data->align = (a);                                               \
	info->data->access = (p);                                              \
	info->data++;                                                          \
} while(0)

#define mmio_list(r,d,s,b) do {                                                \
	info->mmio->addr = (r);                                                \
	info->mmio->data = (d);                                                \
	info->mmio->shift = (s);                                               \
	info->mmio->buffer = (b);                                              \
	info->mmio++;                                                          \
	nv_wr32(priv, (r), (d) | ((s) ? (info->buffer[(b)] >> (s)) : 0));      \
} while(0)

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;
void nve4_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *);
void nve4_grctx_generate_unkn(struct nvc0_graph_priv *);
void nve4_grctx_generate_r418bb8(struct nvc0_graph_priv *);

extern struct nouveau_oclass *nvf0_grctx_oclass;
extern struct nouveau_oclass *nv108_grctx_oclass;

/* 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[];

extern const struct nvc0_graph_pack nvc0_grctx_pack_zcull[];

extern const struct nvc0_graph_pack nvc0_grctx_pack_tpc[];

extern const struct nvc0_graph_init nvc1_grctx_init_9097_0[];

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[];

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[];

extern const struct nvc0_graph_pack nvf0_grctx_pack_mthd[];

extern const struct nvc0_graph_init nvf0_grctx_init_pri_0[];
extern const struct nvc0_graph_init nvf0_grctx_init_cwd_0[];


#endif
+91 −92
Original line number Diff line number Diff line
@@ -22,10 +22,14 @@
 * Authors: Ben Skeggs <bskeggs@redhat.com>
 */

#include "nvc0.h"
#include "ctxnvc0.h"

static struct nvc0_graph_init
nvc1_grctx_init_icmd[] = {
/*******************************************************************************
 * PGRAPH context register lists
 ******************************************************************************/

static const struct nvc0_graph_init
nvc1_grctx_init_icmd_0[] = {
	{ 0x001000,   1, 0x01, 0x00000004 },
	{ 0x0000a9,   1, 0x01, 0x0000ffff },
	{ 0x000038,   1, 0x01, 0x0fac6881 },
@@ -141,8 +145,7 @@ nvc1_grctx_init_icmd[] = {
	{ 0x000586,   1, 0x01, 0x00000040 },
	{ 0x000582,   2, 0x01, 0x00000080 },
	{ 0x0005c2,   1, 0x01, 0x00000001 },
	{ 0x000638,   1, 0x01, 0x00000001 },
	{ 0x000639,   1, 0x01, 0x00000001 },
	{ 0x000638,   2, 0x01, 0x00000001 },
	{ 0x00063a,   1, 0x01, 0x00000002 },
	{ 0x00063b,   2, 0x01, 0x00000001 },
	{ 0x00063d,   1, 0x01, 0x00000002 },
@@ -202,15 +205,13 @@ nvc1_grctx_init_icmd[] = {
	{ 0x000787,   1, 0x01, 0x000000cf },
	{ 0x00078c,   1, 0x01, 0x00000008 },
	{ 0x000792,   1, 0x01, 0x00000001 },
	{ 0x000794,   1, 0x01, 0x00000001 },
	{ 0x000795,   2, 0x01, 0x00000001 },
	{ 0x000794,   3, 0x01, 0x00000001 },
	{ 0x000797,   1, 0x01, 0x000000cf },
	{ 0x000836,   1, 0x01, 0x00000001 },
	{ 0x00079a,   1, 0x01, 0x00000002 },
	{ 0x000833,   1, 0x01, 0x04444480 },
	{ 0x0007a1,   1, 0x01, 0x00000001 },
	{ 0x0007a3,   1, 0x01, 0x00000001 },
	{ 0x0007a4,   2, 0x01, 0x00000001 },
	{ 0x0007a3,   3, 0x01, 0x00000001 },
	{ 0x000831,   1, 0x01, 0x00000004 },
	{ 0x00080c,   1, 0x01, 0x00000002 },
	{ 0x00080d,   2, 0x01, 0x00000100 },
@@ -236,14 +237,12 @@ nvc1_grctx_init_icmd[] = {
	{ 0x0006b1,   1, 0x01, 0x00000011 },
	{ 0x00078c,   1, 0x01, 0x00000008 },
	{ 0x000792,   1, 0x01, 0x00000001 },
	{ 0x000794,   1, 0x01, 0x00000001 },
	{ 0x000795,   2, 0x01, 0x00000001 },
	{ 0x000794,   3, 0x01, 0x00000001 },
	{ 0x000797,   1, 0x01, 0x000000cf },
	{ 0x00079a,   1, 0x01, 0x00000002 },
	{ 0x000833,   1, 0x01, 0x04444480 },
	{ 0x0007a1,   1, 0x01, 0x00000001 },
	{ 0x0007a3,   1, 0x01, 0x00000001 },
	{ 0x0007a4,   2, 0x01, 0x00000001 },
	{ 0x0007a3,   3, 0x01, 0x00000001 },
	{ 0x000831,   1, 0x01, 0x00000004 },
	{ 0x01e100,   1, 0x01, 0x00000001 },
	{ 0x001000,   1, 0x01, 0x00000014 },
@@ -268,8 +267,14 @@ nvc1_grctx_init_icmd[] = {
	{}
};

struct nvc0_graph_init
nvc1_grctx_init_9097[] = {
static const struct nvc0_graph_pack
nvc1_grctx_pack_icmd[] = {
	{ nvc1_grctx_init_icmd_0 },
	{}
};

const struct nvc0_graph_init
nvc1_grctx_init_9097_0[] = {
	{ 0x000800,   8, 0x40, 0x00000000 },
	{ 0x000804,   8, 0x40, 0x00000000 },
	{ 0x000808,   8, 0x40, 0x00000400 },
@@ -516,8 +521,7 @@ nvc1_grctx_init_9097[] = {
	{ 0x001350,   1, 0x04, 0x00000002 },
	{ 0x001358,   1, 0x04, 0x00000001 },
	{ 0x0012e4,   1, 0x04, 0x00000000 },
	{ 0x00131c,   1, 0x04, 0x00000000 },
	{ 0x001320,   3, 0x04, 0x00000000 },
	{ 0x00131c,   4, 0x04, 0x00000000 },
	{ 0x0019c0,   1, 0x04, 0x00000000 },
	{ 0x001140,   1, 0x04, 0x00000000 },
	{ 0x0019c4,   1, 0x04, 0x00000000 },
@@ -571,15 +575,25 @@ nvc1_grctx_init_9097[] = {
	{}
};

static struct nvc0_graph_init
nvc1_grctx_init_9197[] = {
static const struct nvc0_graph_init
nvc1_grctx_init_9197_0[] = {
	{ 0x003400, 128, 0x04, 0x00000000 },
	{ 0x0002e4,   1, 0x04, 0x0000b001 },
	{}
};

static struct nvc0_graph_init
nvc1_grctx_init_unk58xx[] = {
static const struct nvc0_graph_pack
nvc1_grctx_pack_mthd[] = {
	{ nvc1_grctx_init_9097_0, 0x9097 },
	{ nvc1_grctx_init_9197_0, 0x9197 },
	{ nvc0_grctx_init_902d_0, 0x902d },
	{ nvc0_grctx_init_9039_0, 0x9039 },
	{ nvc0_grctx_init_90c0_0, 0x90c0 },
	{}
};

static const struct nvc0_graph_init
nvc1_grctx_init_ds_0[] = {
	{ 0x405800,   1, 0x04, 0x0f8000bf },
	{ 0x405830,   1, 0x04, 0x02180218 },
	{ 0x405834,   2, 0x04, 0x00000000 },
@@ -590,8 +604,20 @@ nvc1_grctx_init_unk58xx[] = {
	{}
};

static struct nvc0_graph_init
nvc1_grctx_init_rop[] = {
static const struct nvc0_graph_init
nvc1_grctx_init_pd_0[] = {
	{ 0x406020,   1, 0x04, 0x000103c1 },
	{ 0x406028,   4, 0x04, 0x00000001 },
	{ 0x4064a8,   1, 0x04, 0x00000000 },
	{ 0x4064ac,   1, 0x04, 0x00003fff },
	{ 0x4064b4,   2, 0x04, 0x00000000 },
	{ 0x4064c0,   1, 0x04, 0x80140078 },
	{ 0x4064c4,   1, 0x04, 0x0086ffff },
	{}
};

static const struct nvc0_graph_init
nvc1_grctx_init_be_0[] = {
	{ 0x408800,   1, 0x04, 0x02802a3c },
	{ 0x408804,   1, 0x04, 0x00000040 },
	{ 0x408808,   1, 0x04, 0x1003e005 },
@@ -602,7 +628,21 @@ nvc1_grctx_init_rop[] = {
	{}
};

static struct nvc0_graph_init
static const struct nvc0_graph_pack
nvc1_grctx_pack_hub[] = {
	{ nvc0_grctx_init_main_0 },
	{ nvc0_grctx_init_fe_0 },
	{ nvc0_grctx_init_pri_0 },
	{ nvc0_grctx_init_memfmt_0 },
	{ nvc1_grctx_init_ds_0 },
	{ nvc1_grctx_init_pd_0 },
	{ nvc0_grctx_init_rstr2d_0 },
	{ nvc0_grctx_init_scc_0 },
	{ nvc1_grctx_init_be_0 },
	{}
};

static const struct nvc0_graph_init
nvc1_grctx_init_gpc_0[] = {
	{ 0x418380,   1, 0x04, 0x00000016 },
	{ 0x418400,   1, 0x04, 0x38004e00 },
@@ -633,30 +673,6 @@ nvc1_grctx_init_gpc_0[] = {
	{ 0x418924,   1, 0x04, 0x00000000 },
	{ 0x418928,   1, 0x04, 0x00ffff00 },
	{ 0x41892c,   1, 0x04, 0x0000ff00 },
	{ 0x418a00,   3, 0x04, 0x00000000 },
	{ 0x418a0c,   1, 0x04, 0x00010000 },
	{ 0x418a10,   3, 0x04, 0x00000000 },
	{ 0x418a20,   3, 0x04, 0x00000000 },
	{ 0x418a2c,   1, 0x04, 0x00010000 },
	{ 0x418a30,   3, 0x04, 0x00000000 },
	{ 0x418a40,   3, 0x04, 0x00000000 },
	{ 0x418a4c,   1, 0x04, 0x00010000 },
	{ 0x418a50,   3, 0x04, 0x00000000 },
	{ 0x418a60,   3, 0x04, 0x00000000 },
	{ 0x418a6c,   1, 0x04, 0x00010000 },
	{ 0x418a70,   3, 0x04, 0x00000000 },
	{ 0x418a80,   3, 0x04, 0x00000000 },
	{ 0x418a8c,   1, 0x04, 0x00010000 },
	{ 0x418a90,   3, 0x04, 0x00000000 },
	{ 0x418aa0,   3, 0x04, 0x00000000 },
	{ 0x418aac,   1, 0x04, 0x00010000 },
	{ 0x418ab0,   3, 0x04, 0x00000000 },
	{ 0x418ac0,   3, 0x04, 0x00000000 },
	{ 0x418acc,   1, 0x04, 0x00010000 },
	{ 0x418ad0,   3, 0x04, 0x00000000 },
	{ 0x418ae0,   3, 0x04, 0x00000000 },
	{ 0x418aec,   1, 0x04, 0x00010000 },
	{ 0x418af0,   3, 0x04, 0x00000000 },
	{ 0x418b00,   1, 0x04, 0x00000000 },
	{ 0x418b08,   1, 0x04, 0x0a418820 },
	{ 0x418b0c,   1, 0x04, 0x062080e6 },
@@ -676,8 +692,14 @@ nvc1_grctx_init_gpc_0[] = {
	{}
};

static struct nvc0_graph_init
nvc1_grctx_init_tpc[] = {
static const struct nvc0_graph_pack
nvc1_grctx_pack_gpc[] = {
	{ nvc1_grctx_init_gpc_0 },
	{}
};

static const struct nvc0_graph_init
nvc1_grctx_init_tpc_0[] = {
	{ 0x419818,   1, 0x04, 0x00000000 },
	{ 0x41983c,   1, 0x04, 0x00038bc7 },
	{ 0x419848,   1, 0x04, 0x00000000 },
@@ -723,6 +745,16 @@ nvc1_grctx_init_tpc[] = {
	{}
};

static const struct nvc0_graph_pack
nvc1_grctx_pack_tpc[] = {
	{ nvc1_grctx_init_tpc_0 },
	{}
};

/*******************************************************************************
 * PGRAPH context implementation
 ******************************************************************************/

void
nvc1_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info)
{
@@ -771,41 +803,6 @@ nvc1_grctx_generate_unkn(struct nvc0_graph_priv *priv)
	nv_mask(priv, 0x419c00, 0x00000008, 0x00000008);
}

static struct nvc0_graph_init *
nvc1_grctx_init_hub[] = {
	nvc0_grctx_init_base,
	nvc0_grctx_init_unk40xx,
	nvc0_grctx_init_unk44xx,
	nvc0_grctx_init_unk46xx,
	nvc0_grctx_init_unk47xx,
	nvc1_grctx_init_unk58xx,
	nvc0_grctx_init_unk60xx,
	nvc0_grctx_init_unk64xx,
	nvc0_grctx_init_unk78xx,
	nvc0_grctx_init_unk80xx,
	nvc1_grctx_init_rop,
	NULL
};

struct nvc0_graph_init *
nvc1_grctx_init_gpc[] = {
	nvc1_grctx_init_gpc_0,
	nvc0_grctx_init_gpc_1,
	nvc1_grctx_init_tpc,
	NULL
};

static struct nvc0_graph_mthd
nvc1_grctx_init_mthd[] = {
	{ 0x9097, nvc1_grctx_init_9097, },
	{ 0x9197, nvc1_grctx_init_9197, },
	{ 0x902d, nvc0_grctx_init_902d, },
	{ 0x9039, nvc0_grctx_init_9039, },
	{ 0x90c0, nvc0_grctx_init_90c0, },
	{ 0x902d, nvc0_grctx_init_mthd_magic, },
	{}
};

struct nouveau_oclass *
nvc1_grctx_oclass = &(struct nvc0_grctx_oclass) {
	.base.handle = NV_ENGCTX(GR, 0xc1),
@@ -820,8 +817,10 @@ nvc1_grctx_oclass = &(struct nvc0_grctx_oclass) {
	.main  = nvc0_grctx_generate_main,
	.mods  = nvc1_grctx_generate_mods,
	.unkn  = nvc1_grctx_generate_unkn,
	.hub  = nvc1_grctx_init_hub,
	.gpc  = nvc1_grctx_init_gpc,
	.icmd = nvc1_grctx_init_icmd,
	.mthd = nvc1_grctx_init_mthd,
	.hub   = nvc1_grctx_pack_hub,
	.gpc   = nvc1_grctx_pack_gpc,
	.zcull = nvc0_grctx_pack_zcull,
	.tpc   = nvc1_grctx_pack_tpc,
	.icmd  = nvc1_grctx_pack_icmd,
	.mthd  = nvc1_grctx_pack_mthd,
}.base;
+24 −16
Original line number Diff line number Diff line
@@ -22,10 +22,14 @@
 * Authors: Ben Skeggs <bskeggs@redhat.com>
 */

#include "nvc0.h"
#include "ctxnvc0.h"

static struct nvc0_graph_init
nvc4_grctx_init_tpc[] = {
/*******************************************************************************
 * PGRAPH context register lists
 ******************************************************************************/

static const struct nvc0_graph_init
nvc4_grctx_init_tpc_0[] = {
	{ 0x419818,   1, 0x04, 0x00000000 },
	{ 0x41983c,   1, 0x04, 0x00038bc7 },
	{ 0x419848,   1, 0x04, 0x00000000 },
@@ -70,14 +74,16 @@ nvc4_grctx_init_tpc[] = {
	{}
};

struct nvc0_graph_init *
nvc4_grctx_init_gpc[] = {
	nvc0_grctx_init_gpc_0,
	nvc0_grctx_init_gpc_1,
	nvc4_grctx_init_tpc,
	NULL
static const struct nvc0_graph_pack
nvc4_grctx_pack_tpc[] = {
	{ nvc4_grctx_init_tpc_0 },
	{}
};

/*******************************************************************************
 * PGRAPH context implementation
 ******************************************************************************/

struct nouveau_oclass *
nvc4_grctx_oclass = &(struct nvc0_grctx_oclass) {
	.base.handle = NV_ENGCTX(GR, 0xc3),
@@ -92,8 +98,10 @@ nvc4_grctx_oclass = &(struct nvc0_grctx_oclass) {
	.main  = nvc0_grctx_generate_main,
	.mods  = nvc0_grctx_generate_mods,
	.unkn  = nvc0_grctx_generate_unkn,
	.hub  = nvc0_grctx_init_hub,
	.gpc  = nvc4_grctx_init_gpc,
	.icmd = nvc0_grctx_init_icmd,
	.mthd = nvc0_grctx_init_mthd,
	.hub   = nvc0_grctx_pack_hub,
	.gpc   = nvc0_grctx_pack_gpc,
	.zcull = nvc0_grctx_pack_zcull,
	.tpc   = nvc4_grctx_pack_tpc,
	.icmd  = nvc0_grctx_pack_icmd,
	.mthd  = nvc0_grctx_pack_mthd,
}.base;
Loading