Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 335879
b: refs/heads/master
c: 1f150b3
h: refs/heads/master
i:
  335877: 31b8f0d
  335875: 72f76e2
  335871: 3e43c2f
v: v3
  • Loading branch information
Marcin Slusarz authored and Ben Skeggs committed Nov 18, 2012
1 parent 562fa25 commit ff1a410
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4113014f2d7bef992ed373c30b6b4ba4be6969ea
refs/heads/master: 1f150b3e7a722ebfc68eec5d83a9fe1ee8d75d71
12 changes: 9 additions & 3 deletions trunk/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,21 +669,27 @@ nv40_grctx_fill(struct nouveau_device *device, struct nouveau_gpuobj *mem)
});
}

void
int
nv40_grctx_init(struct nouveau_device *device, u32 *size)
{
u32 ctxprog[256], i;
u32 *ctxprog = kmalloc(256 * 4, GFP_KERNEL), i;
struct nouveau_grctx ctx = {
.device = device,
.mode = NOUVEAU_GRCTX_PROG,
.data = ctxprog,
.ctxprog_max = ARRAY_SIZE(ctxprog)
.ctxprog_max = 256,
};

if (!ctxprog)
return -ENOMEM;

nv40_grctx_generate(&ctx);

nv_wr32(device, 0x400324, 0);
for (i = 0; i < ctx.ctxprog_len; i++)
nv_wr32(device, 0x400328, ctxprog[i]);
*size = ctx.ctxvals_pos * 4;

kfree(ctxprog);
return 0;
}
4 changes: 3 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/core/engine/graph/nv40.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ nv40_graph_init(struct nouveau_object *object)
return ret;

/* generate and upload context program */
nv40_grctx_init(nv_device(priv), &priv->size);
ret = nv40_grctx_init(nv_device(priv), &priv->size);
if (ret)
return ret;

/* No context present currently */
nv_wr32(priv, NV40_PGRAPH_CTXCTL_CUR, 0x00000000);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nv44_graph_class(void *priv)
return !(0x0baf & (1 << (device->chipset & 0x0f)));
}

void nv40_grctx_init(struct nouveau_device *, u32 *size);
int nv40_grctx_init(struct nouveau_device *, u32 *size);
void nv40_grctx_fill(struct nouveau_device *, struct nouveau_gpuobj *);

#endif

0 comments on commit ff1a410

Please sign in to comment.