[Mesa-dev] [PATCH 09/11] nvc0: make begin_query return false when all MP counters are used
Samuel Pitoiset
samuel.pitoiset at gmail.com
Sat Jul 5 11:49:13 PDT 2014
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index e38744a..258b755 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -56,7 +56,8 @@ struct nvc0_query {
#define NVC0_QUERY_ALLOC_SPACE 256
-static void nvc0_mp_pm_query_begin(struct nvc0_context *, struct nvc0_query *);
+static boolean nvc0_mp_pm_query_begin(struct nvc0_context *,
+ struct nvc0_query *);
static void nvc0_mp_pm_query_end(struct nvc0_context *, struct nvc0_query *);
static boolean nvc0_mp_pm_query_result(struct nvc0_context *,
struct nvc0_query *, void *, boolean);
@@ -327,7 +328,7 @@ nvc0_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
#endif
if ((q->type >= NVE4_PM_QUERY(0) && q->type <= NVE4_PM_QUERY_LAST) ||
(q->type >= NVC0_PM_QUERY(0) && q->type <= NVC0_PM_QUERY_LAST)) {
- nvc0_mp_pm_query_begin(nvc0, q);
+ return nvc0_mp_pm_query_begin(nvc0, q);
}
break;
}
@@ -1063,7 +1064,7 @@ nvc0_mp_pm_query_get_cfg(struct nvc0_context *nvc0, struct nvc0_query *q)
return &nvc0_mp_pm_queries[q->type - NVC0_PM_QUERY(0)];
}
-void
+boolean
nvc0_mp_pm_query_begin(struct nvc0_context *nvc0, struct nvc0_query *q)
{
struct nvc0_screen *screen = nvc0->screen;
@@ -1082,7 +1083,7 @@ nvc0_mp_pm_query_begin(struct nvc0_context *nvc0, struct nvc0_query *q)
if (screen->pm.num_mp_pm_active[0] + num_ab[0] > 4 ||
screen->pm.num_mp_pm_active[1] + num_ab[1] > 4) {
NOUVEAU_ERR("Not enough free MP counter slots !\n");
- return;
+ return false;
}
assert(cfg->num_counters <= 4);
@@ -1147,6 +1148,7 @@ nvc0_mp_pm_query_begin(struct nvc0_context *nvc0, struct nvc0_query *q)
}
}
}
+ return true;
}
static void
--
2.0.0
More information about the mesa-dev
mailing list