summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv30
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2012-07-12 13:59:52 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2012-07-13 17:28:00 +0200
commit9ed65301e044711de0db51b4986085fca170d764 (patch)
treee83ec0d3f359713913086a38742d2f6300b169c3 /src/gallium/drivers/nv30
parent426a23af147720ae3b89995ffee792a29e8ae2db (diff)
downloadexternal_mesa3d-9ed65301e044711de0db51b4986085fca170d764.zip
external_mesa3d-9ed65301e044711de0db51b4986085fca170d764.tar.gz
external_mesa3d-9ed65301e044711de0db51b4986085fca170d764.tar.bz2
nouveau: implement missing timer query functionality
Diffstat (limited to 'src/gallium/drivers/nv30')
-rw-r--r--src/gallium/drivers/nv30/nv30_query.c10
-rw-r--r--src/gallium/drivers/nv30/nv30_screen.c2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv30/nv30_query.c b/src/gallium/drivers/nv30/nv30_query.c
index fb4be31..001aba1 100644
--- a/src/gallium/drivers/nv30/nv30_query.c
+++ b/src/gallium/drivers/nv30/nv30_query.c
@@ -114,6 +114,7 @@ nv30_query_create(struct pipe_context *pipe, unsigned type)
q->type = type;
switch (q->type) {
+ case PIPE_QUERY_TIMESTAMP:
case PIPE_QUERY_TIME_ELAPSED:
q->enable = 0x0000;
q->report = 1;
@@ -158,6 +159,8 @@ nv30_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
PUSH_DATA (push, (q->report << 24) | q->qo[0]->hw->start);
}
break;
+ case PIPE_QUERY_TIMESTAMP:
+ return;
default:
BEGIN_NV04(push, NV30_3D(QUERY_RESET), 1);
PUSH_DATA (push, q->report);
@@ -193,13 +196,13 @@ nv30_query_end(struct pipe_context *pipe, struct pipe_query *pq)
static boolean
nv30_query_result(struct pipe_context *pipe, struct pipe_query *pq,
- boolean wait, void *result)
+ boolean wait, union pipe_query_result *result)
{
struct nv30_screen *screen = nv30_screen(pipe->screen);
struct nv30_query *q = nv30_query(pq);
volatile uint32_t *ntfy0 = nv30_ntfy(screen, q->qo[0]);
volatile uint32_t *ntfy1 = nv30_ntfy(screen, q->qo[1]);
- uint64_t *res64 = result;
+ uint64_t *res64 = &result->u64;
if (ntfy1) {
while (ntfy1[3] & 0xff000000) {
@@ -208,6 +211,9 @@ nv30_query_result(struct pipe_context *pipe, struct pipe_query *pq,
}
switch (q->type) {
+ case PIPE_QUERY_TIMESTAMP:
+ q->result = *(uint64_t *)&ntfy1[0];
+ break;
case PIPE_QUERY_TIME_ELAPSED:
q->result = *(uint64_t *)&ntfy1[0] - *(uint64_t *)&ntfy0[0];
break;
diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c
index 88e428b..1752d10 100644
--- a/src/gallium/drivers/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nv30/nv30_screen.c
@@ -70,6 +70,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SCALED_RESOLVE:
case PIPE_CAP_OCCLUSION_QUERY:
case PIPE_CAP_TIMER_QUERY:
+ case PIPE_CAP_QUERY_TIMESTAMP:
case PIPE_CAP_TEXTURE_SHADOW_MAP:
case PIPE_CAP_TEXTURE_SWIZZLE:
case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
@@ -116,7 +117,6 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
case PIPE_CAP_START_INSTANCE:
- case PIPE_CAP_QUERY_TIMESTAMP:
return 0;
case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: