summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2014-05-03 03:00:07 -0400
committerIlia Mirkin <[email protected]>2014-05-11 19:26:31 -0400
commit4467c0c9fbf2c13b6c73a002e8247448ee12d4c4 (patch)
treef3c609329b7b63948d8dd11433ac8ac2b9342440 /src/gallium/drivers/nouveau/nv50
parent64a7ddf40de45ad964502c3b05392b0190464177 (diff)
nv50,nvc0: leave queries on during blit, turn them on for 2d engine
Fixes the new logic of the conditional rendering piglit test. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ben Skeggs <[email protected]> Cc: "10.2" <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_query.c6
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_screen.c2
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_surface.c15
3 files changed, 20 insertions, 3 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query.c b/src/gallium/drivers/nouveau/nv50/nv50_query.c
index 6f25a0822c4..6a17139e1cd 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_query.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_query.c
@@ -332,7 +332,7 @@ nv50_render_condition(struct pipe_context *pipe,
nv50->cond_cond = condition;
nv50->cond_mode = mode;
- PUSH_SPACE(push, 6);
+ PUSH_SPACE(push, 9);
if (!pq) {
BEGIN_NV04(push, NV50_3D(COND_MODE), 1);
@@ -351,6 +351,10 @@ nv50_render_condition(struct pipe_context *pipe,
PUSH_DATAh(push, q->bo->offset + q->offset);
PUSH_DATA (push, q->bo->offset + q->offset);
PUSH_DATA (push, NV50_3D_COND_MODE_RES_NON_ZERO);
+
+ BEGIN_NV04(push, NV50_2D(COND_ADDRESS_HIGH), 2);
+ PUSH_DATAh(push, q->bo->offset + q->offset);
+ PUSH_DATA (push, q->bo->offset + q->offset);
}
void
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index fcac3c1903a..68d30ea2045 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -398,6 +398,8 @@ nv50_screen_init_hwctx(struct nv50_screen *screen)
PUSH_DATA (push, 0);
BEGIN_NV04(push, SUBC_2D(0x0888), 1);
PUSH_DATA (push, 1);
+ BEGIN_NV04(push, NV50_2D(COND_MODE), 1);
+ PUSH_DATA (push, NV50_2D_COND_MODE_ALWAYS);
BEGIN_NV04(push, SUBC_3D(NV01_SUBCHAN_OBJECT), 1);
PUSH_DATA (push, screen->tesla->handle);
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
index 6b4dc4d4949..df3bc86fb48 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
@@ -611,6 +611,7 @@ struct nv50_blitctx
uint8_t mode;
uint16_t color_mask;
uint8_t filter;
+ uint8_t render_condition_enable;
enum pipe_texture_target target;
struct {
struct pipe_framebuffer_state fb;
@@ -933,7 +934,7 @@ nv50_blitctx_prepare_state(struct nv50_blitctx *blit)
{
struct nouveau_pushbuf *push = blit->nv50->base.pushbuf;
- if (blit->nv50->cond_query) {
+ if (blit->nv50->cond_query && !blit->render_condition_enable) {
BEGIN_NV04(push, NV50_3D(COND_MODE), 1);
PUSH_DATA (push, NV50_3D_COND_MODE_ALWAYS);
}
@@ -1071,7 +1072,7 @@ nv50_blitctx_post_blit(struct nv50_blitctx *blit)
nv50->samplers[2][0] = blit->saved.sampler[0];
nv50->samplers[2][1] = blit->saved.sampler[1];
- if (nv50->cond_query)
+ if (nv50->cond_query && !blit->render_condition_enable)
nv50->base.pipe.render_condition(&nv50->base.pipe, nv50->cond_query,
nv50->cond_cond, nv50->cond_mode);
@@ -1105,6 +1106,7 @@ nv50_blit_3d(struct nv50_context *nv50, const struct pipe_blit_info *info)
blit->mode = nv50_blit_select_mode(info);
blit->color_mask = nv50_blit_derive_color_mask(info);
blit->filter = nv50_blit_get_filter(info);
+ blit->render_condition_enable = info->render_condition_enable;
nv50_blit_select_fp(blit, info);
nv50_blitctx_pre_blit(blit);
@@ -1262,6 +1264,11 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info)
PUSH_DATA (push, 1); /* enable */
}
+ if (nv50->cond_query && info->render_condition_enable) {
+ BEGIN_NV04(push, NV50_2D(COND_MODE), 1);
+ PUSH_DATA (push, NV50_2D_COND_MODE_RES_NON_ZERO);
+ }
+
if (mask != 0xffffffff) {
BEGIN_NV04(push, NV50_2D(ROP), 1);
PUSH_DATA (push, 0xca); /* DPSDxax */
@@ -1384,6 +1391,10 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info)
BEGIN_NV04(push, NV50_2D(OPERATION), 1);
PUSH_DATA (push, NV50_2D_OPERATION_SRCCOPY);
}
+ if (nv50->cond_query && info->render_condition_enable) {
+ BEGIN_NV04(push, NV50_2D(COND_MODE), 1);
+ PUSH_DATA (push, NV50_2D_COND_MODE_ALWAYS);
+ }
}
static void