Ejemplo n.º 1
0
static int
nouveau_fifo_chid(struct nouveau_fifo *priv, struct nouveau_object *object)
{
	int engidx = nv_hclass(priv) & 0xff;

	while (object && object->parent) {
		if ( nv_iclass(object->parent, NV_ENGCTX_CLASS) &&
		    (nv_hclass(object->parent) & 0xff) == engidx)
			return nouveau_fifo_chan(object)->chid;
		object = object->parent;
	}

	return -1;
}
Ejemplo n.º 2
0
static int
nv25_graph_context_ctor(struct nouveau_object *parent,
			struct nouveau_object *engine,
			struct nouveau_oclass *oclass, void *data, u32 size,
			struct nouveau_object **pobject)
{
	struct nv20_graph_chan *chan;
	int ret, i;

	ret = nouveau_graph_context_create(parent, engine, oclass, NULL, 0x3724,
					   16, NVOBJ_FLAG_ZERO_ALLOC, &chan);
	*pobject = nv_object(chan);
	if (ret)
		return ret;

	chan->chid = nouveau_fifo_chan(parent)->chid;

	nv_wo32(chan, 0x0028, 0x00000001 | (chan->chid << 24));
	nv_wo32(chan, 0x035c, 0xffff0000);
	nv_wo32(chan, 0x03c0, 0x0fff0000);
	nv_wo32(chan, 0x03c4, 0x0fff0000);
	nv_wo32(chan, 0x049c, 0x00000101);
	nv_wo32(chan, 0x04b0, 0x00000111);
	nv_wo32(chan, 0x04c8, 0x00000080);
	nv_wo32(chan, 0x04cc, 0xffff0000);
	nv_wo32(chan, 0x04d0, 0x00000001);
	nv_wo32(chan, 0x04e4, 0x44400000);
	nv_wo32(chan, 0x04fc, 0x4b800000);
	for (i = 0x0510; i <= 0x051c; i += 4)
		nv_wo32(chan, i, 0x00030303);
	for (i = 0x0530; i <= 0x053c; i += 4)
		nv_wo32(chan, i, 0x00080000);
	for (i = 0x0548; i <= 0x0554; i += 4)
		nv_wo32(chan, i, 0x01012000);
	for (i = 0x0558; i <= 0x0564; i += 4)
		nv_wo32(chan, i, 0x000105b8);
	for (i = 0x0568; i <= 0x0574; i += 4)
		nv_wo32(chan, i, 0x00080008);
	for (i = 0x0598; i <= 0x05d4; i += 4)
		nv_wo32(chan, i, 0x07ff0000);
	nv_wo32(chan, 0x05e0, 0x4b7fffff);
	nv_wo32(chan, 0x0620, 0x00000080);
	nv_wo32(chan, 0x0624, 0x30201000);
	nv_wo32(chan, 0x0628, 0x70605040);
	nv_wo32(chan, 0x062c, 0xb0a09080);
	nv_wo32(chan, 0x0630, 0xf0e0d0c0);
	nv_wo32(chan, 0x0664, 0x00000001);
	nv_wo32(chan, 0x066c, 0x00004000);
	nv_wo32(chan, 0x0678, 0x00000001);
	nv_wo32(chan, 0x0680, 0x00040000);
	nv_wo32(chan, 0x0684, 0x00010000);
	for (i = 0x1b04; i <= 0x2374; i += 16) {
		nv_wo32(chan, (i + 0), 0x10700ff9);
		nv_wo32(chan, (i + 4), 0x0436086c);
		nv_wo32(chan, (i + 8), 0x000c001b);
	}
	nv_wo32(chan, 0x2704, 0x3f800000);
	nv_wo32(chan, 0x2718, 0x3f800000);
	nv_wo32(chan, 0x2744, 0x40000000);
	nv_wo32(chan, 0x2748, 0x3f800000);
	nv_wo32(chan, 0x274c, 0x3f000000);
	nv_wo32(chan, 0x2754, 0x40000000);
	nv_wo32(chan, 0x2758, 0x3f800000);
	nv_wo32(chan, 0x2760, 0xbf800000);
	nv_wo32(chan, 0x2768, 0xbf800000);
	nv_wo32(chan, 0x308c, 0x000fe000);
	nv_wo32(chan, 0x3108, 0x000003f8);
	nv_wo32(chan, 0x3468, 0x002fe000);
	for (i = 0x3484; i <= 0x34a0; i += 4)
		nv_wo32(chan, i, 0x001c527c);
	return 0;
}
Ejemplo n.º 3
0
static int
nv20_graph_context_ctor(struct nouveau_object *parent,
			struct nouveau_object *engine,
			struct nouveau_oclass *oclass, void *data, u32 size,
			struct nouveau_object **pobject)
{
	struct nv20_graph_chan *chan;
	int ret, i;

	ret = nouveau_graph_context_create(parent, engine, oclass, NULL,
					   0x37f0, 16, NVOBJ_FLAG_ZERO_ALLOC,
					   &chan);
	*pobject = nv_object(chan);
	if (ret)
		return ret;

	chan->chid = nouveau_fifo_chan(parent)->chid;

	nv_wo32(chan, 0x0000, 0x00000001 | (chan->chid << 24));
	nv_wo32(chan, 0x033c, 0xffff0000);
	nv_wo32(chan, 0x03a0, 0x0fff0000);
	nv_wo32(chan, 0x03a4, 0x0fff0000);
	nv_wo32(chan, 0x047c, 0x00000101);
	nv_wo32(chan, 0x0490, 0x00000111);
	nv_wo32(chan, 0x04a8, 0x44400000);
	for (i = 0x04d4; i <= 0x04e0; i += 4)
		nv_wo32(chan, i, 0x00030303);
	for (i = 0x04f4; i <= 0x0500; i += 4)
		nv_wo32(chan, i, 0x00080000);
	for (i = 0x050c; i <= 0x0518; i += 4)
		nv_wo32(chan, i, 0x01012000);
	for (i = 0x051c; i <= 0x0528; i += 4)
		nv_wo32(chan, i, 0x000105b8);
	for (i = 0x052c; i <= 0x0538; i += 4)
		nv_wo32(chan, i, 0x00080008);
	for (i = 0x055c; i <= 0x0598; i += 4)
		nv_wo32(chan, i, 0x07ff0000);
	nv_wo32(chan, 0x05a4, 0x4b7fffff);
	nv_wo32(chan, 0x05fc, 0x00000001);
	nv_wo32(chan, 0x0604, 0x00004000);
	nv_wo32(chan, 0x0610, 0x00000001);
	nv_wo32(chan, 0x0618, 0x00040000);
	nv_wo32(chan, 0x061c, 0x00010000);
	for (i = 0x1c1c; i <= 0x248c; i += 16) {
		nv_wo32(chan, (i + 0), 0x10700ff9);
		nv_wo32(chan, (i + 4), 0x0436086c);
		nv_wo32(chan, (i + 8), 0x000c001b);
	}
	nv_wo32(chan, 0x281c, 0x3f800000);
	nv_wo32(chan, 0x2830, 0x3f800000);
	nv_wo32(chan, 0x285c, 0x40000000);
	nv_wo32(chan, 0x2860, 0x3f800000);
	nv_wo32(chan, 0x2864, 0x3f000000);
	nv_wo32(chan, 0x286c, 0x40000000);
	nv_wo32(chan, 0x2870, 0x3f800000);
	nv_wo32(chan, 0x2878, 0xbf800000);
	nv_wo32(chan, 0x2880, 0xbf800000);
	nv_wo32(chan, 0x34a4, 0x000fe000);
	nv_wo32(chan, 0x3530, 0x000003f8);
	nv_wo32(chan, 0x3540, 0x002fe000);
	for (i = 0x355c; i <= 0x3578; i += 4)
		nv_wo32(chan, i, 0x001c527c);
	return 0;
}
Ejemplo n.º 4
0
static int
nv30_graph_context_ctor(struct nouveau_object *parent,
                        struct nouveau_object *engine,
                        struct nouveau_oclass *oclass, void *data, u32 size,
                        struct nouveau_object **pobject)
{
    struct nv20_graph_chan *chan;
    int ret, i;

    ret = nouveau_graph_context_create(parent, engine, oclass, NULL, 0x5f48,
                                       16, NVOBJ_FLAG_ZERO_ALLOC, &chan);
    *pobject = nv_object(chan);
    if (ret)
        return ret;

    chan->chid = nouveau_fifo_chan(parent)->chid;

    nv_wo32(chan, 0x0028, 0x00000001 | (chan->chid << 24));
    nv_wo32(chan, 0x0410, 0x00000101);
    nv_wo32(chan, 0x0424, 0x00000111);
    nv_wo32(chan, 0x0428, 0x00000060);
    nv_wo32(chan, 0x0444, 0x00000080);
    nv_wo32(chan, 0x0448, 0xffff0000);
    nv_wo32(chan, 0x044c, 0x00000001);
    nv_wo32(chan, 0x0460, 0x44400000);
    nv_wo32(chan, 0x048c, 0xffff0000);
    for (i = 0x04e0; i < 0x04e8; i += 4)
        nv_wo32(chan, i, 0x0fff0000);
    nv_wo32(chan, 0x04ec, 0x00011100);
    for (i = 0x0508; i < 0x0548; i += 4)
        nv_wo32(chan, i, 0x07ff0000);
    nv_wo32(chan, 0x0550, 0x4b7fffff);
    nv_wo32(chan, 0x058c, 0x00000080);
    nv_wo32(chan, 0x0590, 0x30201000);
    nv_wo32(chan, 0x0594, 0x70605040);
    nv_wo32(chan, 0x0598, 0xb8a89888);
    nv_wo32(chan, 0x059c, 0xf8e8d8c8);
    nv_wo32(chan, 0x05b0, 0xb0000000);
    for (i = 0x0600; i < 0x0640; i += 4)
        nv_wo32(chan, i, 0x00010588);
    for (i = 0x0640; i < 0x0680; i += 4)
        nv_wo32(chan, i, 0x00030303);
    for (i = 0x06c0; i < 0x0700; i += 4)
        nv_wo32(chan, i, 0x0008aae4);
    for (i = 0x0700; i < 0x0740; i += 4)
        nv_wo32(chan, i, 0x01012000);
    for (i = 0x0740; i < 0x0780; i += 4)
        nv_wo32(chan, i, 0x00080008);
    nv_wo32(chan, 0x085c, 0x00040000);
    nv_wo32(chan, 0x0860, 0x00010000);
    for (i = 0x0864; i < 0x0874; i += 4)
        nv_wo32(chan, i, 0x00040004);
    for (i = 0x1f18; i <= 0x3088 ; i += 16) {
        nv_wo32(chan, i + 0, 0x10700ff9);
        nv_wo32(chan, i + 1, 0x0436086c);
        nv_wo32(chan, i + 2, 0x000c001b);
    }
    for (i = 0x30b8; i < 0x30c8; i += 4)
        nv_wo32(chan, i, 0x0000ffff);
    nv_wo32(chan, 0x344c, 0x3f800000);
    nv_wo32(chan, 0x3808, 0x3f800000);
    nv_wo32(chan, 0x381c, 0x3f800000);
    nv_wo32(chan, 0x3848, 0x40000000);
    nv_wo32(chan, 0x384c, 0x3f800000);
    nv_wo32(chan, 0x3850, 0x3f000000);
    nv_wo32(chan, 0x3858, 0x40000000);
    nv_wo32(chan, 0x385c, 0x3f800000);
    nv_wo32(chan, 0x3864, 0xbf800000);
    nv_wo32(chan, 0x386c, 0xbf800000);
    return 0;
}