diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-07-07 21:53:19 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-07-12 20:13:43 -0400 |
commit | ec91db269e6a3c7f45b96169ccf5dbd1fde8fce8 (patch) | |
tree | 83c1dd7a6d24533c04578884d0f66d17ad948976 /drivers/gpu/drm/nouveau/nv40_graph.c | |
parent | 631872155f35b907ae3950016d9e72a308449d69 (diff) |
drm/nouveau: remove ability to use external firmware
This was always really a developer option, and if it's really necessary we
can hack this in ourselves.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv40_graph.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv40_graph.c | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c b/drivers/gpu/drm/nouveau/nv40_graph.c index 2608c34eca82..fd7d2b501316 100644 --- a/drivers/gpu/drm/nouveau/nv40_graph.c +++ b/drivers/gpu/drm/nouveau/nv40_graph.c | |||
@@ -58,6 +58,7 @@ nv40_graph_create_context(struct nouveau_channel *chan) | |||
58 | struct drm_device *dev = chan->dev; | 58 | struct drm_device *dev = chan->dev; |
59 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 59 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
60 | struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; | 60 | struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; |
61 | struct nouveau_grctx ctx = {}; | ||
61 | int ret; | 62 | int ret; |
62 | 63 | ||
63 | ret = nouveau_gpuobj_new_ref(dev, chan, NULL, 0, pgraph->grctx_size, | 64 | ret = nouveau_gpuobj_new_ref(dev, chan, NULL, 0, pgraph->grctx_size, |
@@ -67,16 +68,11 @@ nv40_graph_create_context(struct nouveau_channel *chan) | |||
67 | return ret; | 68 | return ret; |
68 | 69 | ||
69 | /* Initialise default context values */ | 70 | /* Initialise default context values */ |
70 | if (!pgraph->ctxprog) { | 71 | ctx.dev = chan->dev; |
71 | struct nouveau_grctx ctx = {}; | 72 | ctx.mode = NOUVEAU_GRCTX_VALS; |
73 | ctx.data = chan->ramin_grctx->gpuobj; | ||
74 | nv40_grctx_init(&ctx); | ||
72 | 75 | ||
73 | ctx.dev = chan->dev; | ||
74 | ctx.mode = NOUVEAU_GRCTX_VALS; | ||
75 | ctx.data = chan->ramin_grctx->gpuobj; | ||
76 | nv40_grctx_init(&ctx); | ||
77 | } else { | ||
78 | nouveau_grctx_vals_load(dev, chan->ramin_grctx->gpuobj); | ||
79 | } | ||
80 | nv_wo32(dev, chan->ramin_grctx->gpuobj, 0, | 76 | nv_wo32(dev, chan->ramin_grctx->gpuobj, 0, |
81 | chan->ramin_grctx->gpuobj->im_pramin->start); | 77 | chan->ramin_grctx->gpuobj->im_pramin->start); |
82 | return 0; | 78 | return 0; |
@@ -236,7 +232,8 @@ nv40_graph_init(struct drm_device *dev) | |||
236 | struct drm_nouveau_private *dev_priv = | 232 | struct drm_nouveau_private *dev_priv = |
237 | (struct drm_nouveau_private *)dev->dev_private; | 233 | (struct drm_nouveau_private *)dev->dev_private; |
238 | struct nouveau_fb_engine *pfb = &dev_priv->engine.fb; | 234 | struct nouveau_fb_engine *pfb = &dev_priv->engine.fb; |
239 | uint32_t vramsz; | 235 | struct nouveau_grctx ctx = {}; |
236 | uint32_t vramsz, *cp; | ||
240 | int i, j; | 237 | int i, j; |
241 | 238 | ||
242 | nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) & | 239 | nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) & |
@@ -244,32 +241,22 @@ nv40_graph_init(struct drm_device *dev) | |||
244 | nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) | | 241 | nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) | |
245 | NV_PMC_ENABLE_PGRAPH); | 242 | NV_PMC_ENABLE_PGRAPH); |
246 | 243 | ||
247 | if (nouveau_ctxfw) { | 244 | cp = kmalloc(sizeof(*cp) * 256, GFP_KERNEL); |
248 | nouveau_grctx_prog_load(dev); | 245 | if (!cp) |
249 | dev_priv->engine.graph.grctx_size = 175 * 1024; | 246 | return -ENOMEM; |
250 | } | ||
251 | |||
252 | if (!dev_priv->engine.graph.ctxprog) { | ||
253 | struct nouveau_grctx ctx = {}; | ||
254 | uint32_t *cp; | ||
255 | |||
256 | cp = kmalloc(sizeof(*cp) * 256, GFP_KERNEL); | ||
257 | if (!cp) | ||
258 | return -ENOMEM; | ||
259 | 247 | ||
260 | ctx.dev = dev; | 248 | ctx.dev = dev; |
261 | ctx.mode = NOUVEAU_GRCTX_PROG; | 249 | ctx.mode = NOUVEAU_GRCTX_PROG; |
262 | ctx.data = cp; | 250 | ctx.data = cp; |
263 | ctx.ctxprog_max = 256; | 251 | ctx.ctxprog_max = 256; |
264 | nv40_grctx_init(&ctx); | 252 | nv40_grctx_init(&ctx); |
265 | dev_priv->engine.graph.grctx_size = ctx.ctxvals_pos * 4; | 253 | dev_priv->engine.graph.grctx_size = ctx.ctxvals_pos * 4; |
266 | 254 | ||
267 | nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0); | 255 | nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0); |
268 | for (i = 0; i < ctx.ctxprog_len; i++) | 256 | for (i = 0; i < ctx.ctxprog_len; i++) |
269 | nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]); | 257 | nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]); |
270 | 258 | ||
271 | kfree(cp); | 259 | kfree(cp); |
272 | } | ||
273 | 260 | ||
274 | /* No context present currently */ | 261 | /* No context present currently */ |
275 | nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0x00000000); | 262 | nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0x00000000); |
@@ -405,7 +392,6 @@ nv40_graph_init(struct drm_device *dev) | |||
405 | 392 | ||
406 | void nv40_graph_takedown(struct drm_device *dev) | 393 | void nv40_graph_takedown(struct drm_device *dev) |
407 | { | 394 | { |
408 | nouveau_grctx_fini(dev); | ||
409 | } | 395 | } |
410 | 396 | ||
411 | struct nouveau_pgraph_object_class nv40_graph_grclass[] = { | 397 | struct nouveau_pgraph_object_class nv40_graph_grclass[] = { |