summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/trace/tr_rbug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/trace/tr_rbug.c')
-rw-r--r--src/gallium/drivers/trace/tr_rbug.c59
1 files changed, 56 insertions, 3 deletions
diff --git a/src/gallium/drivers/trace/tr_rbug.c b/src/gallium/drivers/trace/tr_rbug.c
index e2de108009..e85ac15edc 100644
--- a/src/gallium/drivers/trace/tr_rbug.c
+++ b/src/gallium/drivers/trace/tr_rbug.c
@@ -296,6 +296,7 @@ trace_rbug_context_info(struct trace_rbug *tr_rbug, struct rbug_header *header,
struct trace_screen *tr_scr = tr_rbug->tr_scr;
struct trace_context *tr_ctx = NULL;
rbug_texture_t cbufs[PIPE_MAX_COLOR_BUFS];
+ rbug_texture_t texs[PIPE_MAX_SAMPLERS];
int i;
pipe_mutex_lock(tr_scr->list_mutex);
@@ -313,9 +314,14 @@ trace_rbug_context_info(struct trace_rbug *tr_rbug, struct rbug_header *header,
for (i = 0; i < tr_ctx->curr.nr_cbufs; i++)
cbufs[i] = VOID2U64(tr_ctx->curr.cbufs[i]);
+ for (i = 0; i < tr_ctx->curr.num_texs; i++)
+ texs[i] = VOID2U64(tr_ctx->curr.tex[i]);
+
rbug_send_context_info_reply(tr_rbug->con, serial,
VOID2U64(tr_ctx->curr.vs), VOID2U64(tr_ctx->curr.fs),
- cbufs, tr_ctx->curr.nr_cbufs, VOID2U64(tr_ctx->curr.zsbuf),
+ texs, tr_ctx->curr.num_texs,
+ cbufs, tr_ctx->curr.nr_cbufs,
+ VOID2U64(tr_ctx->curr.zsbuf),
tr_ctx->draw_blocker, tr_ctx->draw_blocked, NULL);
trace_dump_call_unlock();
@@ -368,7 +374,12 @@ trace_rbug_context_draw_step(struct trace_rbug *tr_rbug, struct rbug_header *hea
}
pipe_mutex_lock(tr_ctx->draw_mutex);
- tr_ctx->draw_blocked &= ~step->step;
+ if (tr_ctx->draw_blocked & RBUG_BLOCK_RULE) {
+ if (step->step & RBUG_BLOCK_RULE)
+ tr_ctx->draw_blocked &= ~RBUG_BLOCK_MASK;
+ } else {
+ tr_ctx->draw_blocked &= ~step->step;
+ }
pipe_mutex_unlock(tr_ctx->draw_mutex);
#ifdef PIPE_THREAD_HAVE_CONDVAR
@@ -397,7 +408,12 @@ trace_rbug_context_draw_unblock(struct trace_rbug *tr_rbug, struct rbug_header *
}
pipe_mutex_lock(tr_ctx->draw_mutex);
- tr_ctx->draw_blocked &= ~unblock->unblock;
+ if (tr_ctx->draw_blocked & RBUG_BLOCK_RULE) {
+ if (unblock->unblock & RBUG_BLOCK_RULE)
+ tr_ctx->draw_blocked &= ~RBUG_BLOCK_MASK;
+ } else {
+ tr_ctx->draw_blocked &= ~unblock->unblock;
+ }
tr_ctx->draw_blocker &= ~unblock->unblock;
pipe_mutex_unlock(tr_ctx->draw_mutex);
@@ -411,6 +427,40 @@ trace_rbug_context_draw_unblock(struct trace_rbug *tr_rbug, struct rbug_header *
}
static int
+trace_rbug_context_draw_rule(struct trace_rbug *tr_rbug, struct rbug_header *header, uint32_t serial)
+{
+ struct rbug_proto_context_draw_rule *rule = (struct rbug_proto_context_draw_rule *)header;
+
+ struct trace_screen *tr_scr = tr_rbug->tr_scr;
+ struct trace_context *tr_ctx = NULL;
+
+ pipe_mutex_lock(tr_scr->list_mutex);
+ tr_ctx = trace_rbug_get_context_locked(tr_scr, rule->context);
+
+ if (!tr_ctx) {
+ pipe_mutex_unlock(tr_scr->list_mutex);
+ return -ESRCH;
+ }
+
+ pipe_mutex_lock(tr_ctx->draw_mutex);
+ tr_ctx->draw_rule.vs = U642VOID(rule->vertex);
+ tr_ctx->draw_rule.fs = U642VOID(rule->fragment);
+ tr_ctx->draw_rule.tex = U642VOID(rule->texture);
+ tr_ctx->draw_rule.surf = U642VOID(rule->surface);
+ tr_ctx->draw_rule.blocker = rule->block;
+ tr_ctx->draw_blocker |= RBUG_BLOCK_RULE;
+ pipe_mutex_unlock(tr_ctx->draw_mutex);
+
+#ifdef PIPE_THREAD_HAVE_CONDVAR
+ pipe_condvar_broadcast(tr_ctx->draw_cond);
+#endif
+
+ pipe_mutex_unlock(tr_scr->list_mutex);
+
+ return 0;
+}
+
+static int
trace_rbug_context_flush(struct trace_rbug *tr_rbug, struct rbug_header *header, uint32_t serial)
{
struct rbug_proto_context_flush *flush = (struct rbug_proto_context_flush *)header;
@@ -673,6 +723,9 @@ trace_rbug_header(struct trace_rbug *tr_rbug, struct rbug_header *header, uint32
case RBUG_OP_CONTEXT_DRAW_UNBLOCK:
ret = trace_rbug_context_draw_unblock(tr_rbug, header, serial);
break;
+ case RBUG_OP_CONTEXT_DRAW_RULE:
+ ret = trace_rbug_context_draw_rule(tr_rbug, header, serial);
+ break;
case RBUG_OP_CONTEXT_FLUSH:
ret = trace_rbug_context_flush(tr_rbug, header, serial);
break;