Lines Matching refs:ctx

23 cp_out(struct nouveau_grctx *ctx, uint32_t inst)
25 uint32_t *ctxprog = ctx->data;
27 if (ctx->mode != NOUVEAU_GRCTX_PROG)
30 BUG_ON(ctx->ctxprog_len == ctx->ctxprog_max);
31 ctxprog[ctx->ctxprog_len++] = inst;
35 cp_lsr(struct nouveau_grctx *ctx, uint32_t val)
37 cp_out(ctx, CP_LOAD_SR | val);
41 cp_ctx(struct nouveau_grctx *ctx, uint32_t reg, uint32_t length)
43 ctx->ctxprog_reg = (reg - 0x00400000) >> 2;
45 ctx->ctxvals_base = ctx->ctxvals_pos;
46 ctx->ctxvals_pos = ctx->ctxvals_base + length;
49 cp_lsr(ctx, length);
53 cp_out(ctx, CP_CTX | (length << CP_CTX_COUNT_SHIFT) | ctx->ctxprog_reg);
57 cp_name(struct nouveau_grctx *ctx, int name)
59 uint32_t *ctxprog = ctx->data;
62 if (ctx->mode != NOUVEAU_GRCTX_PROG)
65 ctx->ctxprog_label[name] = ctx->ctxprog_len;
66 for (i = 0; i < ctx->ctxprog_len; i++) {
72 (ctx->ctxprog_len << CP_BRA_IP_SHIFT);
77 _cp_bra(struct nouveau_grctx *ctx, u32 mod, int flag, int state, int name)
82 ip = ctx->ctxprog_label[name] << CP_BRA_IP_SHIFT;
87 cp_out(ctx, CP_BRA | (mod << 18) | ip | flag |
97 _cp_wait(struct nouveau_grctx *ctx, int flag, int state)
99 cp_out(ctx, CP_WAIT | flag | (state ? CP_WAIT_SET : 0));
104 _cp_set(struct nouveau_grctx *ctx, int flag, int state)
106 cp_out(ctx, CP_SET | flag | (state ? CP_SET_1 : 0));
111 cp_pos(struct nouveau_grctx *ctx, int offset)
113 ctx->ctxvals_pos = offset;
114 ctx->ctxvals_base = ctx->ctxvals_pos;
116 cp_lsr(ctx, ctx->ctxvals_pos);
117 cp_out(ctx, CP_SET_CONTEXT_POINTER);
121 gr_def(struct nouveau_grctx *ctx, uint32_t reg, uint32_t val)
123 if (ctx->mode != NOUVEAU_GRCTX_VALS)
127 reg = (reg - ctx->ctxprog_reg) + ctx->ctxvals_base;
129 nv_wo32(ctx->data, reg * 4, val);