summaryrefslogtreecommitdiff
path: root/shared-core/nv40_fifo.c
blob: ce3f8fdda009e4970b18770e48450efd4fdab40a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/*
 * Copyright (C) 2007 Ben Skeggs.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial
 * portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

#include "drmP.h"
#include "nouveau_drv.h"
#include "nouveau_drm.h"


#define RAMFC_WR(offset,val) INSTANCE_WR(chan->ramfc->gpuobj, \
					 NV40_RAMFC_##offset/4, (val))
#define RAMFC_RD(offset)     INSTANCE_RD(chan->ramfc->gpuobj, \
					 NV40_RAMFC_##offset/4)
#define NV40_RAMFC(c) (dev_priv->ramfc_offset + ((c)*NV40_RAMFC__SIZE))
#define NV40_RAMFC__SIZE 128

int
nv40_fifo_create_context(struct nouveau_channel *chan)
{
	struct drm_device *dev = chan->dev;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	int ret;

	if ((ret = nouveau_gpuobj_new_fake(dev, NV40_RAMFC(chan->id), ~0,
						NV40_RAMFC__SIZE,
						NVOBJ_FLAG_ZERO_ALLOC |
						NVOBJ_FLAG_ZERO_FREE,
						NULL, &chan->ramfc)))
		return ret;

	/* Fill entries that are seen filled in dumps of nvidia driver just
	 * after channel's is put into DMA mode
	 */
	RAMFC_WR(DMA_PUT       , chan->pushbuf_base);
	RAMFC_WR(DMA_GET       , chan->pushbuf_base);
	RAMFC_WR(DMA_INSTANCE  , chan->pushbuf->instance >> 4);
	RAMFC_WR(DMA_FETCH     , NV_PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES |
				 NV_PFIFO_CACHE1_DMA_FETCH_SIZE_128_BYTES |
				 NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_8 |
#ifdef __BIG_ENDIAN
				 NV_PFIFO_CACHE1_BIG_ENDIAN |
#endif
				 0x30000000 /* no idea.. */);
	RAMFC_WR(DMA_SUBROUTINE, 0);
	RAMFC_WR(GRCTX_INSTANCE, chan->ramin_grctx->instance >> 4);
	RAMFC_WR(DMA_TIMESLICE , 0x0001FFFF);

	/* enable the fifo dma operation */
	NV_WRITE(NV04_PFIFO_MODE,NV_READ(NV04_PFIFO_MODE)|(1<<chan->id));
	return 0;
}

void
nv40_fifo_destroy_context(struct nouveau_channel *chan)
{
	struct drm_device *dev = chan->dev;
	struct drm_nouveau_private *dev_priv = dev->dev_private;

	NV_WRITE(NV04_PFIFO_MODE, NV_READ(NV04_PFIFO_MODE)&~(1<<chan->id));

	if (chan->ramfc)
		nouveau_gpuobj_ref_del(dev, &chan->ramfc);
}

int
nv40_fifo_load_context(struct nouveau_channel *chan)
{
	struct drm_device *dev = chan->dev;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	uint32_t tmp, tmp2;

	NV_WRITE(NV04_PFIFO_CACHE1_DMA_GET          , RAMFC_RD(DMA_GET));
	NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUT          , RAMFC_RD(DMA_PUT));
	NV_WRITE(NV10_PFIFO_CACHE1_REF_CNT          , RAMFC_RD(REF_CNT));
	NV_WRITE(NV04_PFIFO_CACHE1_DMA_INSTANCE     , RAMFC_RD(DMA_INSTANCE));
	NV_WRITE(NV04_PFIFO_CACHE1_DMA_DCOUNT       , RAMFC_RD(DMA_DCOUNT));
	NV_WRITE(NV04_PFIFO_CACHE1_DMA_STATE        , RAMFC_RD(DMA_STATE));

	/* No idea what 0x2058 is.. */
	tmp   = RAMFC_RD(DMA_FETCH);
	tmp2  = NV_READ(0x2058) & 0xFFF;
	tmp2 |= (tmp & 0x30000000);
	NV_WRITE(0x2058, tmp2);
	tmp  &= ~0x30000000;
	NV_WRITE(NV04_PFIFO_CACHE1_DMA_FETCH        , tmp);

	NV_WRITE(NV04_PFIFO_CACHE1_ENGINE           , RAMFC_RD(ENGINE));
	NV_WRITE(NV04_PFIFO_CACHE1_PULL1            , RAMFC_RD(PULL1_ENGINE));
	NV_WRITE(NV10_PFIFO_CACHE1_ACQUIRE_VALUE    , RAMFC_RD(ACQUIRE_VALUE));
	NV_WRITE(NV10_PFIFO_CACHE1_ACQUIRE_TIMESTAMP, RAMFC_RD(ACQUIRE_TIMESTAMP));
	NV_WRITE(NV10_PFIFO_CACHE1_ACQUIRE_TIMEOUT  , RAMFC_RD(ACQUIRE_TIMEOUT));
	NV_WRITE(NV10_PFIFO_CACHE1_SEMAPHORE        , RAMFC_RD(SEMAPHORE));
	NV_WRITE(NV10_PFIFO_CACHE1_DMA_SUBROUTINE   , RAMFC_RD(DMA_SUBROUTINE));
	NV_WRITE(NV40_PFIFO_GRCTX_INSTANCE          , RAMFC_RD(GRCTX_INSTANCE));
	NV_WRITE(0x32e4, RAMFC_RD(UNK_40));
	/* NVIDIA does this next line twice... */
	NV_WRITE(0x32e8, RAMFC_RD(UNK_44));
	NV_WRITE(0x2088, RAMFC_RD(UNK_4C));
	NV_WRITE(0x3300, RAMFC_RD(UNK_50));

	/* not sure what part is PUT, and which is GET.. never seen a non-zero
	 * value appear in a mmio-trace yet..
	 */
#if 0
	tmp = NV_READ(UNK_84);
	NV_WRITE(NV_PFIFO_CACHE1_GET, tmp ???);
	NV_WRITE(NV_PFIFO_CACHE1_PUT, tmp ???);
#endif

	/* Don't clobber the TIMEOUT_ENABLED flag when restoring from RAMFC */
	tmp  = NV_READ(NV04_PFIFO_DMA_TIMESLICE) & ~0x1FFFF;
	tmp |= RAMFC_RD(DMA_TIMESLICE) & 0x1FFFF;
	NV_WRITE(NV04_PFIFO_DMA_TIMESLICE, tmp);

	/* Set channel active, and in DMA mode */
	NV_WRITE(NV03_PFIFO_CACHE1_PUSH1  , 0x00010000 | chan->id);
	/* Reset DMA_CTL_AT_INFO to INVALID */
	tmp = NV_READ(NV04_PFIFO_CACHE1_DMA_CTL) & ~(1<<31);
	NV_WRITE(NV04_PFIFO_CACHE1_DMA_CTL, tmp);

	return 0;
}

int
nv40_fifo_save_context(struct nouveau_channel *chan)
{
	struct drm_device *dev = chan->dev;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	uint32_t tmp;

	RAMFC_WR(DMA_PUT          , NV_READ(NV04_PFIFO_CACHE1_DMA_PUT));
	RAMFC_WR(DMA_GET          , NV_READ(NV04_PFIFO_CACHE1_DMA_GET));
	RAMFC_WR(REF_CNT          , NV_READ(NV10_PFIFO_CACHE1_REF_CNT));
	RAMFC_WR(DMA_INSTANCE     , NV_READ(NV04_PFIFO_CACHE1_DMA_INSTANCE));
	RAMFC_WR(DMA_DCOUNT       , NV_READ(NV04_PFIFO_CACHE1_DMA_DCOUNT));
	RAMFC_WR(DMA_STATE        , NV_READ(NV04_PFIFO_CACHE1_DMA_STATE));

	tmp  = NV_READ(NV04_PFIFO_CACHE1_DMA_FETCH);
	tmp |= NV_READ(0x2058) & 0x30000000;
	RAMFC_WR(DMA_FETCH	  , tmp);

	RAMFC_WR(ENGINE           , NV_READ(NV04_PFIFO_CACHE1_ENGINE));
	RAMFC_WR(PULL1_ENGINE     , NV_READ(NV04_PFIFO_CACHE1_PULL1));
	RAMFC_WR(ACQUIRE_VALUE    , NV_READ(NV10_PFIFO_CACHE1_ACQUIRE_VALUE));
	tmp = NV_READ(NV10_PFIFO_CACHE1_ACQUIRE_TIMESTAMP);
	RAMFC_WR(ACQUIRE_TIMESTAMP, tmp);
	RAMFC_WR(ACQUIRE_TIMEOUT  , NV_READ(NV10_PFIFO_CACHE1_ACQUIRE_TIMEOUT));
	RAMFC_WR(SEMAPHORE        , NV_READ(NV10_PFIFO_CACHE1_SEMAPHORE));

	/* NVIDIA read 0x3228 first, then write DMA_GET here.. maybe something
	 * more involved depending on the value of 0x3228?
	 */
	RAMFC_WR(DMA_SUBROUTINE   , NV_READ(NV04_PFIFO_CACHE1_DMA_GET));

	RAMFC_WR(GRCTX_INSTANCE   , NV_READ(NV40_PFIFO_GRCTX_INSTANCE));

	/* No idea what the below is for exactly, ripped from a mmio-trace */
	RAMFC_WR(UNK_40           , NV_READ(NV40_PFIFO_UNK32E4));

	/* NVIDIA do this next line twice.. bug? */
	RAMFC_WR(UNK_44           , NV_READ(0x32e8));
	RAMFC_WR(UNK_4C           , NV_READ(0x2088));
	RAMFC_WR(UNK_50           , NV_READ(0x3300));

#if 0 /* no real idea which is PUT/GET in UNK_48.. */
	tmp  = NV_READ(NV04_PFIFO_CACHE1_GET);
	tmp |= (NV_READ(NV04_PFIFO_CACHE1_PUT) << 16);
	RAMFC_WR(UNK_48           , tmp);
#endif

	return 0;
}

int
nv40_fifo_init(struct drm_device *dev)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	int ret;

	if ((ret = nouveau_fifo_init(dev)))
		return ret;

	NV_WRITE(NV04_PFIFO_DMA_TIMESLICE, 0x2101ffff);
	return 0;
}

NV34 is 0x10de:0x032* * NV35/36 is 0x10de:0x033* / 0x10de:0x034* * * Not seen in the wild, no dumps (probably NV35) : * NV37 is 0x10de:0x00fc, 0x10de:0x00fd * NV38 is 0x10de:0x0333, 0x10de:0x00fe * */ #define NV20_GRCTX_SIZE (3580*4) #define NV25_GRCTX_SIZE (3529*4) #define NV2A_GRCTX_SIZE (3500*4) #define NV30_31_GRCTX_SIZE (24392) #define NV34_GRCTX_SIZE (18140) #define NV35_36_GRCTX_SIZE (22396) static void nv20_graph_context_init(struct drm_device *dev, struct nouveau_gpuobj *ctx) { struct drm_nouveau_private *dev_priv = dev->dev_private; int i; /* write32 #1 block at +0x00740adc NV_PRAMIN+0x40adc of 3369 (0xd29) elements: +0x00740adc: ffff0000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740afc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b1c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b3c: 00000000 0fff0000 0fff0000 00000000 00000000 00000000 00000000 00000000 +0x00740b5c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b7c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b9c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740bbc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740bdc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740bfc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740c1c: 00000101 00000000 00000000 00000000 00000000 00000111 00000000 00000000 +0x00740c3c: 00000000 00000000 00000000 44400000 00000000 00000000 00000000 00000000 +0x00740c5c: 00000000 00000000 00000000 00000000 00000000 00000000 00030303 00030303 +0x00740c7c: 00030303 00030303 00000000 00000000 00000000 00000000 00080000 00080000 +0x00740c9c: 00080000 00080000 00000000 00000000 01012000 01012000 01012000 01012000 +0x00740cbc: 000105b8 000105b8 000105b8 000105b8 00080008 00080008 00080008 00080008 +0x00740cdc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740cfc: 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 +0x00740d1c: 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 +0x00740d3c: 00000000 00000000 4b7fffff 00000000 00000000 00000000 00000000 00000000 +0x00740d5c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740d7c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740d9c: 00000001 00000000 00004000 00000000 00000000 00000001 00000000 00040000 +0x00740dbc: 00010000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740ddc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ... */ INSTANCE_WR(ctx, (0x33c/4)+0, 0xffff0000); INSTANCE_WR(ctx, (0x33c/4)+25, 0x0fff0000); INSTANCE_WR(ctx, (0x33c/4)+26, 0x0fff0000); INSTANCE_WR(ctx, (0x33c/4)+80, 0x00000101); INSTANCE_WR(ctx, (0x33c/4)+85, 0x00000111); INSTANCE_WR(ctx, (0x33c/4)+91, 0x44400000); for (i = 0; i < 4; ++i) INSTANCE_WR(ctx, (0x33c/4)+102+i, 0x00030303); for (i = 0; i < 4; ++i) INSTANCE_WR(ctx, (0x33c/4)+110+i, 0x00080000); for (i = 0; i < 4; ++i) INSTANCE_WR(ctx, (0x33c/4)+116+i, 0x01012000); for (i = 0; i < 4; ++i) INSTANCE_WR(ctx, (0x33c/4)+120+i, 0x000105b8); for (i = 0; i < 4; ++i) INSTANCE_WR(ctx, (0x33c/4)+124+i, 0x00080008); for (i = 0; i < 16; ++i) INSTANCE_WR(ctx, (0x33c/4)+136+i, 0x07ff0000); INSTANCE_WR(ctx, (0x33c/4)+154, 0x4b7fffff); INSTANCE_WR(ctx, (0x33c/4)+176, 0x00000001); INSTANCE_WR(ctx, (0x33c/4)+178, 0x00004000); INSTANCE_WR(ctx, (0x33c/4)+181, 0x00000001); INSTANCE_WR(ctx, (0x33c/4)+183, 0x00040000); INSTANCE_WR(ctx, (0x33c/4)+184, 0x00010000); /* ... +0x0074239c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x007423bc: 10700ff9 0436086c 000c001b 00000000 10700ff9 0436086c 000c001b 00000000 +0x007423dc: 10700ff9 0436086c 000c001b 00000000 10700ff9 0436086c 000c001b 00000000 +0x007423fc: 10700ff9 0436086c 000c001b 00000000 10700ff9 0436086c 000c001b 00000000 ... +0x00742bdc: 10700ff9 0436086c 000c001b 00000000 10700ff9 0436086c 000c001b 00000000 +0x00742bfc: 10700ff9 0436086c 000c001b 00000000 10700ff9 0436086c 000c001b 00000000 +0x00742c1c: 10700ff9 0436086c 000c001b 00000000 10700ff9 0436086c 000c001b 00000000 +0x00742c3c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ... */ for (i = 0; i < 0x880; i += 0x10) { INSTANCE_WR(ctx, ((0x1c1c + i)/4)+0, 0x10700ff9); INSTANCE_WR(ctx, ((0x1c1c + i)/4)+1, 0x0436086c); INSTANCE_WR(ctx, ((0x1c1c + i)/4)+2, 0x000c001b); } /* write32 #1 block at +0x00742fbc NV_PRAMIN+0x42fbc of 4 (0x4) elements: +0x00742fbc: 3f800000 00000000 00000000 00000000 */ INSTANCE_WR(ctx, (0x281c/4), 0x3f800000); /* write32 #1 block at +0x00742ffc NV_PRAMIN+0x42ffc of 12 (0xc) elements: +0x00742ffc: 40000000 3f800000 3f000000 00000000 40000000 3f800000 00000000 bf800000 +0x0074301c: 00000000 bf800000 00000000 00000000 */ INSTANCE_WR(ctx, (0x285c/4)+0, 0x40000000); INSTANCE_WR(ctx, (0x285c/4)+1, 0x3f800000); INSTANCE_WR(ctx, (0x285c/4)+2, 0x3f000000); INSTANCE_WR(ctx, (0x285c/4)+4, 0x40000000); INSTANCE_WR(ctx, (0x285c/4)+5, 0x3f800000); INSTANCE_WR(ctx, (0x285c/4)+7, 0xbf800000); INSTANCE_WR(ctx, (0x285c/4)+9, 0xbf800000); /* write32 #1 block at +0x00742fcc NV_PRAMIN+0x42fcc of 4 (0x4) elements: +0x00742fcc: 00000000 3f800000 00000000 00000000 */ INSTANCE_WR(ctx, (0x282c/4)+1, 0x3f800000); /* write32 #1 block at +0x0074302c NV_PRAMIN+0x4302c of 4 (0x4) elements: +0x0074302c: 00000000 00000000 00000000 00000000 write32 #1 block at +0x00743c9c NV_PRAMIN+0x43c9c of 4 (0x4) elements: +0x00743c9c: 00000000 00000000 00000000 00000000 write32 #1 block at +0x00743c3c NV_PRAMIN+0x43c3c of 8 (0x8) elements: +0x00743c3c: 00000000 00000000 000fe000 00000000 00000000 00000000 00000000 00000000 */ INSTANCE_WR(ctx, (0x349c/4)+2, 0x000fe000); /* write32 #1 block at +0x00743c6c NV_PRAMIN+0x43c6c of 4 (0x4) elements: +0x00743c6c: 00000000 00000000 00000000 00000000 write32 #1 block at +0x00743ccc NV_PRAMIN+0x43ccc of 4 (0x4) elements: +0x00743ccc: 00000000 000003f8 00000000 00000000 */ INSTANCE_WR(ctx, (0x352c/4)+1, 0x000003f8); /* write32 #1 NV_PRAMIN+0x43ce0 <- 0x002fe000 */ INSTANCE_WR(ctx, 0x3540/4, 0x002fe000); /* write32 #1 block at +0x00743cfc NV_PRAMIN+0x43cfc of 8 (0x8) elements: +0x00743cfc: 001c527c 001c527c 001c527c 001c527c 001c527c 001c527c 001c527c 001c527c */ for (i = 0; i < 8; ++i) INSTANCE_WR(ctx, (0x355c/4)+i, 0x001c527c); } static void nv2a_graph_context_init(struct drm_device *dev, struct nouveau_gpuobj *ctx) { struct drm_nouveau_private *dev_priv = dev->dev_private; int i; INSTANCE_WR(ctx, 0x33c/4, 0xffff0000); for(i = 0x3a0; i< 0x3a8; i += 4) INSTANCE_WR(ctx, i/4, 0x0fff0000); INSTANCE_WR(ctx, 0x47c/4, 0x00000101); INSTANCE_WR(ctx, 0x490/4, 0x00000111); INSTANCE_WR(ctx, 0x4a8/4, 0x44400000); for(i = 0x4d4; i< 0x4e4; i += 4) INSTANCE_WR(ctx, i/4, 0x00030303); for(i = 0x4f4; i< 0x504; i += 4) INSTANCE_WR(ctx, i/4, 0x00080000); for(i = 0x50c; i< 0x51c; i += 4) INSTANCE_WR(ctx, i/4, 0x01012000); for(i = 0x51c; i< 0x52c; i += 4) INSTANCE_WR(ctx, i/4, 0x000105b8); for(i = 0x52c; i< 0x53c; i += 4) INSTANCE_WR(ctx, i/4, 0x00080008); for(i = 0x55c; i< 0x59c; i += 4) INSTANCE_WR(ctx, i/4, 0x07ff0000); INSTANCE_WR(ctx, 0x5a4/4, 0x4b7fffff); INSTANCE_WR(ctx, 0x5fc/4, 0x00000001); INSTANCE_WR(ctx, 0x604/4, 0x00004000); INSTANCE_WR(ctx, 0x610/4, 0x00000001); INSTANCE_WR(ctx, 0x618/4, 0x00040000); INSTANCE_WR(ctx, 0x61c/4, 0x00010000); for (i=0x1a9c; i <= 0x22fc/4; i += 32) { INSTANCE_WR(ctx, i/4 , 0x10700ff9); INSTANCE_WR(ctx, i/4 + 1, 0x0436086c); INSTANCE_WR(ctx, i/4 + 2, 0x000c001b); } INSTANCE_WR(ctx, 0x269c/4, 0x3f800000); INSTANCE_WR(ctx, 0x26b0/4, 0x3f800000); INSTANCE_WR(ctx, 0x26dc/4, 0x40000000); INSTANCE_WR(ctx, 0x26e0/4, 0x3f800000); INSTANCE_WR(ctx, 0x26e4/4, 0x3f000000); INSTANCE_WR(ctx, 0x26ec/4, 0x40000000); INSTANCE_WR(ctx, 0x26f0/4, 0x3f800000); INSTANCE_WR(ctx, 0x26f8/4, 0xbf800000); INSTANCE_WR(ctx, 0x2700/4, 0xbf800000); INSTANCE_WR(ctx, 0x3024/4, 0x000fe000); INSTANCE_WR(ctx, 0x30a0/4, 0x000003f8); INSTANCE_WR(ctx, 0x33fc/4, 0x002fe000); for(i = 0x341c; i< 0x343c; i += 4) INSTANCE_WR(ctx, i/4, 0x001c527c); } static void nv25_graph_context_init(struct drm_device *dev, struct nouveau_gpuobj *ctx) { struct drm_nouveau_private *dev_priv = dev->dev_private; int i; /* write32 #1 block at +0x00740a7c NV_PRAMIN.GRCTX0+0x35c of 173 (0xad) elements: +0x00740a7c: ffff0000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740a9c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740abc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740adc: 00000000 0fff0000 0fff0000 00000000 00000000 00000000 00000000 00000000 +0x00740afc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b1c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b3c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b5c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b7c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740b9c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740bbc: 00000101 00000000 00000000 00000000 00000000 00000111 00000000 00000000 +0x00740bdc: 00000000 00000000 00000000 00000080 ffff0000 00000001 00000000 00000000 +0x00740bfc: 00000000 00000000 44400000 00000000 00000000 00000000 00000000 00000000 +0x00740c1c: 4b800000 00000000 00000000 00000000 00000000 00030303 00030303 00030303 +0x00740c3c: 00030303 00000000 00000000 00000000 00000000 00080000 00080000 00080000 +0x00740c5c: 00080000 00000000 00000000 01012000 01012000 01012000 01012000 000105b8 +0x00740c7c: 000105b8 000105b8 000105b8 00080008 00080008 00080008 00080008 00000000 +0x00740c9c: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 07ff0000 +0x00740cbc: 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 +0x00740cdc: 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 07ff0000 00000000 +0x00740cfc: 00000000 4b7fffff 00000000 00000000 00000000 00000000 00000000 00000000 +0x00740d1c: 00000000 00000000 00000000 00000000 00000000 */ INSTANCE_WR(ctx, (0x35c/4)+0, 0xffff0000); INSTANCE_WR(ctx, (0x35c/4)+25, 0x0fff0000); INSTANCE_WR(ctx, (0x35c/4)+26, 0x0fff0000); INSTANCE_WR(ctx, (0x35c/4)+80, 0x00000101); INSTANCE_WR(ctx, (0x35c/4)+85, 0x00000111); INSTANCE_WR(ctx, (0x35c/4)+91, 0x00000080); INSTANCE_WR(ctx, (0x35c/4)+92, 0xffff0000); INSTANCE_WR(ctx, (0x35c/4)+93, 0x00000001); INSTANCE_WR(ctx, (0x35c/4)+98, 0x44400000); INSTANCE_WR(ctx, (0x35c/4)+104, 0x4b800000); INSTANCE_WR(ctx, (0x35c/4)+109, 0x00030303); INSTANCE_WR(ctx, (0x35c/4)+110, 0x00030303); INSTANCE_WR(ctx, (0x35c/4)+111, 0x00030303); INSTANCE_WR(ctx, (0x35c/4)+112, 0x00030303); INSTANCE_WR(ctx, (0x35c/4)+117, 0x00080000); INSTANCE_WR(ctx, (0x35c/4)+118, 0x00080000); INSTANCE_WR(ctx, (0x35c/4)+119, 0x00080000); INSTANCE_WR(ctx, (0x35c/4)+120, 0x00080000); INSTANCE_WR(ctx, (0x35c/4)+123, 0x01012000); INSTANCE_WR(ctx, (0x35c/4)+124, 0x01012000); INSTANCE_WR(ctx, (0x35c/4)+125, 0x01012000); INSTANCE_WR(ctx, (0x35c/4)+126, 0x01012000); INSTANCE_WR(ctx, (0x35c/4)+127, 0x000105b8); INSTANCE_WR(ctx, (0x35c/4)+128, 0x000105b8); INSTANCE_WR(ctx, (0x35c/4)+129, 0x000105b8); INSTANCE_WR(ctx, (0x35c/4)+130, 0x000105b8); INSTANCE_WR(ctx, (0x35c/4)+131, 0x00080008);