{
struct nv30_render *r = nv30_render(render);
struct nv30_context *nv30 = r->nv30;
- struct nouveau_pushbuf *push = nv30->screen->base.pushbuf;
+ struct nouveau_pushbuf *push = nv30->base.pushbuf;
unsigned i;
BEGIN_NV04(push, NV30_3D(VTXBUF(0)), r->vertex_info.num_attribs);
struct nv30_render *r = nv30_render(nv30->draw->render);
struct nv30_rasterizer_stateobj *rast = nv30->rast;
struct pipe_screen *pscreen = &nv30->screen->base.base;
- struct nouveau_pushbuf *push = nv30->screen->base.pushbuf;
+ struct nouveau_pushbuf *push = nv30->base.pushbuf;
struct nouveau_object *eng3d = nv30->screen->eng3d;
struct nv30_vertprog *vp = nv30->vertprog.program;
struct vertex_info *vinfo = &r->vertex_info;
nv50_compute_upload_input(struct nv50_context *nv50, const uint32_t *input)
{
struct nv50_screen *screen = nv50->screen;
- struct nouveau_pushbuf *push = screen->base.pushbuf;
+ struct nouveau_pushbuf *push = nv50->base.pushbuf;
unsigned size = align(nv50->compprog->parm_size, 0x4);
BEGIN_NV04(push, NV50_CP(USER_PARAM_COUNT), 1);
mm = nouveau_mm_allocate(screen->base.mm_GART, size, &bo, &offset);
assert(mm);
- nouveau_bo_map(bo, 0, screen->base.client);
+ nouveau_bo_map(bo, 0, nv50->base.client);
memcpy(bo->map + offset, input, size);
nouveau_bufctx_refn(nv50->bufctx, 0, bo, NOUVEAU_BO_GART | NOUVEAU_BO_RD);
struct pipe_fence_handle **fence,
unsigned flags)
{
- struct nouveau_screen *screen = nouveau_screen(pipe->screen);
+ struct nouveau_context *context = nouveau_context(pipe);
+ struct nouveau_screen *screen = context->screen;
if (fence)
nouveau_fence_ref(screen->fence.current, (struct nouveau_fence **)fence);
- PUSH_KICK(screen->pushbuf);
+ PUSH_KICK(context->pushbuf);
nouveau_context_update_frame_stats(nouveau_context(pipe));
}
nv50->base.pushbuf = screen->base.pushbuf;
nv50->base.client = screen->base.client;
- ret = nouveau_bufctx_new(screen->base.client, 2, &nv50->bufctx);
+ ret = nouveau_bufctx_new(nv50->base.client, 2, &nv50->bufctx);
if (!ret)
- ret = nouveau_bufctx_new(screen->base.client, NV50_BIND_3D_COUNT,
+ ret = nouveau_bufctx_new(nv50->base.client, NV50_BIND_3D_COUNT,
&nv50->bufctx_3d);
if (!ret)
- ret = nouveau_bufctx_new(screen->base.client, NV50_BIND_CP_COUNT,
+ ret = nouveau_bufctx_new(nv50->base.client, NV50_BIND_CP_COUNT,
&nv50->bufctx_cp);
if (ret)
goto out_err;
return false;
hq->offset = hq->base_offset;
- ret = nouveau_bo_map(hq->bo, 0, screen->base.client);
+ ret = nouveau_bo_map(hq->bo, 0, nv50->base.client);
if (ret) {
nv50_hw_query_allocate(nv50, q, 0);
return false;
}
return false;
}
- if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nv50->screen->base.client))
+ if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nv50->base.client))
return false;
}
hq->state = NV50_HW_QUERY_STATE_READY;
const struct pipe_box *box,
struct pipe_transfer **ptransfer)
{
- struct nv50_screen *screen = nv50_screen(pctx->screen);
struct nv50_context *nv50 = nv50_context(pctx);
struct nouveau_device *dev = nv50->screen->base.device;
const struct nv50_miptree *mt = nv50_miptree(res);
if (usage & PIPE_MAP_WRITE)
flags |= NOUVEAU_BO_WR;
- ret = nouveau_bo_map(tx->rect[1].bo, flags, screen->base.client);
+ ret = nouveau_bo_map(tx->rect[1].bo, flags, nv50->base.client);
if (ret) {
nouveau_bo_ref(NULL, &tx->rect[1].bo);
FREE(tx);
surf.offset = dec->vpring->size - 0x1000;
context->clear_render_target(context, &surf.base, &color, 0, 0, 1024, 1, false);
- PUSH_SPACE(screen->pushbuf, 5);
- PUSH_REFN(screen->pushbuf, dec->fence, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
+ PUSH_SPACE(nv50->base.pushbuf, 5);
+ PUSH_REFN(nv50->base.pushbuf, dec->fence, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
/* The clear_render_target is done via 3D engine, so use it to write to a
* sempahore to indicate that it's done.
*/
- BEGIN_NV04(screen->pushbuf, NV50_3D(QUERY_ADDRESS_HIGH), 4);
- PUSH_DATAh(screen->pushbuf, dec->fence->offset);
- PUSH_DATA (screen->pushbuf, dec->fence->offset);
- PUSH_DATA (screen->pushbuf, 1);
- PUSH_DATA (screen->pushbuf, 0xf010);
- PUSH_KICK (screen->pushbuf);
+ BEGIN_NV04(nv50->base.pushbuf, NV50_3D(QUERY_ADDRESS_HIGH), 4);
+ PUSH_DATAh(nv50->base.pushbuf, dec->fence->offset);
+ PUSH_DATA (nv50->base.pushbuf, dec->fence->offset);
+ PUSH_DATA (nv50->base.pushbuf, 1);
+ PUSH_DATA (nv50->base.pushbuf, 0xf010);
+ PUSH_KICK (nv50->base.pushbuf);
PUSH_SPACE(bsp_push, 2 + 12 + 2 + 4 + 3);
nv98_create_decoder(struct pipe_context *context,
const struct pipe_video_codec *templ)
{
- struct nouveau_screen *screen = &((struct nv50_context *)context)->screen->base;
+ struct nv50_context *nv50 = nv50_context(context);
+ struct nouveau_screen *screen = &nv50->screen->base;
struct nouveau_vp3_decoder *dec;
struct nouveau_pushbuf **push;
struct nv04_fifo nv04_data = {.vram = 0xbeef0201, .gart = 0xbeef0202};
dec = CALLOC_STRUCT(nouveau_vp3_decoder);
if (!dec)
return NULL;
- dec->client = screen->client;
+ dec->client = nv50->base.client;
dec->base = *templ;
nouveau_vp3_decoder_init_common(&dec->base);
&nv04_data, sizeof(nv04_data), &dec->channel[0]);
if (!ret)
- ret = nouveau_pushbuf_new(screen->client, dec->channel[0], 4,
+ ret = nouveau_pushbuf_new(nv50->base.client, dec->channel[0], 4,
32 * 1024, true, &dec->pushbuf[0]);
for (i = 1; i < 3; ++i) {
nvc0->base.pushbuf = screen->base.pushbuf;
nvc0->base.client = screen->base.client;
- ret = nouveau_bufctx_new(screen->base.client, 2, &nvc0->bufctx);
+ ret = nouveau_bufctx_new(nvc0->base.client, 2, &nvc0->bufctx);
if (!ret)
- ret = nouveau_bufctx_new(screen->base.client, NVC0_BIND_3D_COUNT,
+ ret = nouveau_bufctx_new(nvc0->base.client, NVC0_BIND_3D_COUNT,
&nvc0->bufctx_3d);
if (!ret)
- ret = nouveau_bufctx_new(screen->base.client, NVC0_BIND_CP_COUNT,
+ ret = nouveau_bufctx_new(nvc0->base.client, NVC0_BIND_CP_COUNT,
&nvc0->bufctx_cp);
if (ret)
goto out_err;
return false;
hq->offset = hq->base_offset;
- ret = nouveau_bo_map(hq->bo, 0, screen->base.client);
+ ret = nouveau_bo_map(hq->bo, 0, nvc0->base.client);
if (ret) {
nvc0_hw_query_allocate(nvc0, q, 0);
return false;
return hq->funcs->get_query_result(nvc0, hq, wait, result);
if (hq->state != NVC0_HW_QUERY_STATE_READY)
- nvc0_hw_query_update(nvc0->screen->base.client, q);
+ nvc0_hw_query_update(nvc0->base.client, q);
if (hq->state != NVC0_HW_QUERY_STATE_READY) {
if (!wait) {
}
return false;
}
- if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nvc0->screen->base.client))
+ if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nvc0->base.client))
return false;
NOUVEAU_DRV_STAT(&nvc0->screen->base, query_sync_count, 1);
}
if (index == -1) {
/* TODO: Use a macro to write the availability of the query */
if (hq->state != NVC0_HW_QUERY_STATE_READY)
- nvc0_hw_query_update(nvc0->screen->base.client, q);
+ nvc0_hw_query_update(nvc0->base.client, q);
uint32_t ready[2] = {hq->state == NVC0_HW_QUERY_STATE_READY};
nvc0->base.push_cb(&nvc0->base, buf, offset,
result_type >= PIPE_QUERY_TYPE_I64 ? 2 : 1,
* outputs the difference (no need to worry about 64-bit clamping).
*/
if (hq->state != NVC0_HW_QUERY_STATE_READY)
- nvc0_hw_query_update(nvc0->screen->base.client, q);
+ nvc0_hw_query_update(nvc0->base.client, q);
if ((flags & PIPE_QUERY_WAIT) && hq->state != NVC0_HW_QUERY_STATE_READY)
nvc0_hw_query_fifo_wait(nvc0, q);
if (usage & PIPE_MAP_WRITE)
flags |= NOUVEAU_BO_WR;
- ret = nouveau_bo_map(tx->rect[1].bo, flags, nvc0->screen->base.client);
+ ret = nouveau_bo_map(tx->rect[1].bo, flags, nvc0->base.client);
if (ret) {
pipe_resource_reference(&tx->base.resource, NULL);
nouveau_bo_ref(NULL, &tx->rect[1].bo);
nvc0_create_decoder(struct pipe_context *context,
const struct pipe_video_codec *templ)
{
- struct nouveau_screen *screen = &((struct nvc0_context *)context)->screen->base;
+ struct nvc0_context *nvc0 = nvc0_context(context);
+ struct nouveau_screen *screen = &nvc0->screen->base;
struct nouveau_vp3_decoder *dec;
struct nouveau_pushbuf **push;
union nouveau_bo_config cfg;
dec = CALLOC_STRUCT(nouveau_vp3_decoder);
if (!dec)
return NULL;
- dec->client = screen->client;
+ dec->client = nvc0->base.client;
dec->base = *templ;
nouveau_vp3_decoder_init_common(&dec->base);
data, size, &dec->channel[i]);
if (!ret)
- ret = nouveau_pushbuf_new(screen->client, dec->channel[i], 4,
+ ret = nouveau_pushbuf_new(nvc0->base.client, dec->channel[i], 4,
32 * 1024, true, &dec->pushbuf[i]);
if (ret)
break;