nvc0_resource_fence(res, NOUVEAU_BO_WR);
}
- IMMED_NVC0(push, NVC0_3D(COND_MODE), NVC0_3D_COND_MODE_ALWAYS);
+ if (!render_condition_enabled)
+ IMMED_NVC0(push, NVC0_3D(COND_MODE), NVC0_3D_COND_MODE_ALWAYS);
BEGIN_NIC0(push, NVC0_3D(CLEAR_BUFFERS), sf->depth);
for (z = 0; z < sf->depth; ++z) {
(z << NVC0_3D_CLEAR_BUFFERS_LAYER__SHIFT));
}
- IMMED_NVC0(push, NVC0_3D(COND_MODE), nvc0->cond_condmode);
+ if (!render_condition_enabled)
+ IMMED_NVC0(push, NVC0_3D(COND_MODE), nvc0->cond_condmode);
nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER;
}
size -= nr * 4;
}
- if (buf->mm) {
- nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence);
- nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence_wr);
- }
+ nvc0_resource_validate(buf, NOUVEAU_BO_WR);
nouveau_bufctx_reset(nvc0->bufctx, 0);
}
size -= nr * 4;
}
- if (buf->mm) {
- nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence);
- nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence_wr);
- }
+ nvc0_resource_validate(buf, NOUVEAU_BO_WR);
nouveau_bufctx_reset(nvc0->bufctx, 0);
}
return;
}
+ util_range_add(&buf->valid_buffer_range, offset, offset + size);
+
assert(size % data_size == 0);
if (data_size == 12) {
PUSH_REFN (push, buf->bo, buf->domain | NOUVEAU_BO_WR);
BEGIN_NVC0(push, NVC0_3D(CLEAR_COLOR(0)), 4);
- PUSH_DATAf(push, color.f[0]);
- PUSH_DATAf(push, color.f[1]);
- PUSH_DATAf(push, color.f[2]);
- PUSH_DATAf(push, color.f[3]);
+ PUSH_DATA (push, color.ui[0]);
+ PUSH_DATA (push, color.ui[1]);
+ PUSH_DATA (push, color.ui[2]);
+ PUSH_DATA (push, color.ui[3]);
BEGIN_NVC0(push, NVC0_3D(SCREEN_SCISSOR_HORIZ), 2);
PUSH_DATA (push, width << 16);
PUSH_DATA (push, height << 16);
IMMED_NVC0(push, NVC0_3D(COND_MODE), nvc0->cond_condmode);
- if (buf->mm) {
- nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence);
- nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence_wr);
- }
+ nvc0_resource_validate(buf, NOUVEAU_BO_WR);
if (width * height != elements) {
offset += width * height * data_size;
PUSH_DATA (push, dst->u.tex.first_layer);
IMMED_NVC0(push, NVC0_3D(MULTISAMPLE_MODE), mt->ms_mode);
- IMMED_NVC0(push, NVC0_3D(COND_MODE), NVC0_3D_COND_MODE_ALWAYS);
+ if (!render_condition_enabled)
+ IMMED_NVC0(push, NVC0_3D(COND_MODE), NVC0_3D_COND_MODE_ALWAYS);
BEGIN_NIC0(push, NVC0_3D(CLEAR_BUFFERS), sf->depth);
for (z = 0; z < sf->depth; ++z) {
(z << NVC0_3D_CLEAR_BUFFERS_LAYER__SHIFT));
}
- IMMED_NVC0(push, NVC0_3D(COND_MODE), nvc0->cond_condmode);
+ if (!render_condition_enabled)
+ IMMED_NVC0(push, NVC0_3D(COND_MODE), nvc0->cond_condmode);
nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER;
}
}
}
+static void
+gm200_evaluate_depth_buffer(struct pipe_context *pipe)
+{
+ struct nvc0_context *nvc0 = nvc0_context(pipe);
+ struct nouveau_pushbuf *push = nvc0->base.pushbuf;
+
+ nvc0_state_validate_3d(nvc0, NVC0_NEW_3D_FRAMEBUFFER);
+ IMMED_NVC0(push, SUBC_3D(0x11fc), 1);
+}
+
/* =============================== BLIT CODE ===================================
*/
struct nv50_tsc_entry sampler[2]; /* nearest, bilinear */
- pipe_mutex mutex;
+ mtx_t mutex;
struct nvc0_screen *screen;
};
};
static const uint32_t code_gm107[] =
{
- 0xfc0007e0, 0x001f8000, /* sched 0x7e0 0x7e0 0x7e0 */
- 0x0807ff04, 0xefd8ff80, /* ld b64 $r4 a[0x80] 0x0 */
- 0x0907ff00, 0xefd97f80, /* ld b96 $r0 a[0x90] 0x0 */
- 0x0707ff04, 0xeff0ff80, /* st b64 a[0x70] $r4 0x0 */
- 0xfc0007e0, 0x00000000, /* sched 0x7e0 0x7e0 0x0 */
- 0x0807ff00, 0xeff17f80, /* st b96 a[0x80] $r0 0x0 */
+ 0xe4200701, 0x001d0400, /* sched (st 0x1 wr 0x0) (st 0x1 wr 0x1) (st 0x1 wr 0x2) */
+ 0x0807ff00, 0xefd87f80, /* ld b32 $r0 a[0x80] 0x0 */
+ 0x0847ff01, 0xefd87f80, /* ld b32 $r1 a[0x84] 0x0 */
+ 0x0907ff02, 0xefd87f80, /* ld b32 $r2 a[0x90] 0x0 */
+ 0xf0200761, 0x003f8400, /* sched (st 0x1 wr 0x3) (st 0x1 wr 0x4) (st 0x1 wt 0x1) */
+ 0x0947ff03, 0xefd87f80, /* ld b32 $r3 a[0x94] 0x0 */
+ 0x0987ff04, 0xefd87f80, /* ld b32 $r4 a[0x98] 0x0 */
+ 0x0707ff00, 0xeff07f80, /* st b32 a[0x70] $r0 0x0 */
+ 0xfc2017e1, 0x011f8404, /* sched (st 0x1 wt 0x2) (st 0x1 wt 0x4) (st 0x1 wt 0x8) */
+ 0x0747ff01, 0xeff07f80, /* st b32 a[0x74] $r1 0x0 */
+ 0x0807ff02, 0xeff07f80, /* st b32 a[0x80] $r2 0x0 */
+ 0x0847ff03, 0xeff07f80, /* st b32 a[0x84] $r3 0x0 */
+ 0xfde087e1, 0x001f8000, /* sched (st 0x1 wt 0x10) (st 0xf) (st 0x0) */
+ 0x0887ff04, 0xeff07f80, /* st b32 a[0x88] $r4 0x0 */
0x0007000f, 0xe3000000, /* exit */
};
const unsigned mode = ctx->mode;
if (!blitter->fp[targ][mode]) {
- pipe_mutex_lock(blitter->mutex);
+ mtx_lock(&blitter->mutex);
if (!blitter->fp[targ][mode])
blitter->fp[targ][mode] =
nv50_blitter_make_fp(&ctx->nvc0->base.pipe, mode, ptarg);
- pipe_mutex_unlock(blitter->mutex);
+ mtx_unlock(&blitter->mutex);
}
ctx->fp = blitter->fp[targ][mode];
}
nvc0->cond_cond, nvc0->cond_mode);
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_VTX_TMP);
+ nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TEXT);
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_FB);
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TEX(4, 0));
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TEX(4, 1));
static void
nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
{
+ struct nvc0_screen *screen = nvc0->screen;
struct nvc0_blitctx *blit = nvc0->blit;
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
struct pipe_resource *src = info->src.resource;
BCTX_REFN_bo(nvc0->bufctx_3d, 3D_VTX_TMP,
NOUVEAU_BO_GART | NOUVEAU_BO_RD, vtxbuf_bo);
+ BCTX_REFN_bo(nvc0->bufctx_3d, 3D_TEXT,
+ NV_VRAM_DOMAIN(&screen->base) | NOUVEAU_BO_RD, screen->text);
nouveau_pushbuf_validate(push);
BEGIN_NVC0(push, NVC0_3D(VERTEX_ARRAY_FETCH(0)), 4);
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
bool eng3d = false;
+ if (info->src.box.width == 0 || info->src.box.height == 0 ||
+ info->dst.box.width == 0 || info->dst.box.height == 0) {
+ pipe_debug_message(&nvc0->base.debug, ERROR,
+ "Blit with zero-size src or dst box");
+ return;
+ }
+
if (util_format_is_depth_or_stencil(info->dst.resource->format)) {
if (!(info->mask & PIPE_MASK_ZS))
return;
else
if (util_format_is_alpha(info->src.format))
eng3d = info->src.format != PIPE_FORMAT_A8_UNORM;
+ else
+ if (util_format_is_srgb(info->dst.format) &&
+ util_format_get_nr_components(info->src.format) == 1)
+ eng3d = true;
else
eng3d = !nv50_2d_format_supported(info->src.format);
}
}
screen->blitter->screen = screen;
- pipe_mutex_init(screen->blitter->mutex);
+ (void) mtx_init(&screen->blitter->mutex, mtx_plain);
nvc0_blitter_make_vp(screen->blitter);
nvc0_blitter_make_sampler(screen->blitter);
}
}
- pipe_mutex_destroy(blitter->mutex);
+ mtx_destroy(&blitter->mutex);
FREE(blitter);
}
pipe->clear_depth_stencil = nvc0_clear_depth_stencil;
pipe->clear_texture = nv50_clear_texture;
pipe->clear_buffer = nvc0_clear_buffer;
+ if (nvc0->screen->base.class_3d >= GM200_3D_CLASS)
+ pipe->evaluate_depth_buffer = gm200_evaluate_depth_buffer;
}