search for: ctxprog_max

Displaying 4 results from an estimated 4 matches for "ctxprog_max".

2011 Dec 28
0
[PATCH] drm/nouveau: move definition of nouveau_grctx to separate file
...s/gpu/drm/nouveau/nouveau_grctx.h +++ b/drivers/gpu/drm/nouveau/nouveau_grctx.h @@ -1,24 +1,8 @@ #ifndef __NOUVEAU_GRCTX_H__ #define __NOUVEAU_GRCTX_H__ -struct nouveau_grctx { - struct drm_device *dev; - - enum { - NOUVEAU_GRCTX_PROG, - NOUVEAU_GRCTX_VALS - } mode; - void *data; - - uint32_t ctxprog_max; - uint32_t ctxprog_len; - uint32_t ctxprog_reg; - int ctxprog_label[32]; - uint32_t ctxvals_pos; - uint32_t ctxvals_base; -}; - -#ifdef CP_CTX +#include "nouveau_grctx_def.h" + static inline void cp_out(struct nouveau_grctx *ctx, uint32_t inst) { @@ -128,6 +112,5 @@ gr_def(struct...
2012 Nov 11
0
[PATCH] drm/nv40: allocate ctxprog with kmalloc
...e, 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); + retur...
2012 Apr 15
0
[PATCH resend] drm/nouveau: move definition of nouveau_grctx to separate file
...s/gpu/drm/nouveau/nouveau_grctx.h +++ b/drivers/gpu/drm/nouveau/nouveau_grctx.h @@ -1,24 +1,8 @@ #ifndef __NOUVEAU_GRCTX_H__ #define __NOUVEAU_GRCTX_H__ -struct nouveau_grctx { - struct drm_device *dev; - - enum { - NOUVEAU_GRCTX_PROG, - NOUVEAU_GRCTX_VALS - } mode; - void *data; - - uint32_t ctxprog_max; - uint32_t ctxprog_len; - uint32_t ctxprog_reg; - int ctxprog_label[32]; - uint32_t ctxvals_pos; - uint32_t ctxvals_base; -}; - -#ifdef CP_CTX +#include "nouveau_grctx_def.h" + static inline void cp_out(struct nouveau_grctx *ctx, uint32_t inst) { @@ -128,6 +112,5 @@ gr_def(struct...
2010 Feb 25
3
[PATCH 1/3] drm/nv50: Implement ctxprog/state generation.
...t32_t *cp = kmalloc(512 * 4, GFP_KERNEL); + int i; + if (!cp) { + NV_ERROR(dev, "Couldn't alloc ctxprog! Disabling acceleration.\n"); + dev_priv->engine.graph.accel_blocked = true; + return 0; + } + ctx.dev = dev; + ctx.mode = NOUVEAU_GRCTX_PROG; + ctx.data = cp; + ctx.ctxprog_max = 512; + if (!nv50_grctx_init(&ctx)) { + dev_priv->engine.graph.grctx_size = ctx.ctxvals_pos * 4; + + nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0); + for (i = 0; i < ctx.ctxprog_len; i++) + nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]); + } else { + dev_priv->engin...