summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-04-22 00:01:56 -0400
committerIlia Mirkin <[email protected]>2016-04-22 00:06:49 -0400
commit88ca4a43a2dffe132c9a2fa29d490d6644ecd7f8 (patch)
treeb123334e63ff9f4230dc4cb1db2ab1a440310850 /src/gallium
parent541e6c05000b87cee02d5f8e1adc7973c2a2deea (diff)
nvc0: fix retrieving query results into buffer for timestamps
The timestamps are stored in a funny place, and even though they are a 64-bit result, are not stored with is64bit. Account for that when retrieving the query result into a resource. Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.2" <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
index 62385884137..4c34593ef9c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
@@ -370,7 +370,7 @@ nvc0_hw_get_query_result_resource(struct nvc0_context *nvc0,
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
struct nvc0_hw_query *hq = nvc0_hw_query(q);
struct nv04_resource *buf = nv04_resource(resource);
- unsigned stride;
+ unsigned qoffset = 0, stride;
assert(!hq->funcs || !hq->funcs->get_query_result);
@@ -426,17 +426,27 @@ nvc0_hw_get_query_result_resource(struct nvc0_context *nvc0,
case PIPE_QUERY_PIPELINE_STATISTICS:
stride = 12;
break;
+ case PIPE_QUERY_TIME_ELAPSED:
+ case PIPE_QUERY_TIMESTAMP:
+ qoffset = 8;
+ /* fallthrough */
default:
assert(index == 0);
stride = 1;
break;
}
- if (hq->is64bit) {
- nouveau_pushbuf_data(push, hq->bo, hq->offset + 16 * index,
- 8 | NVC0_IB_ENTRY_1_NO_PREFETCH);
- nouveau_pushbuf_data(push, hq->bo, hq->offset + 16 * (index + stride),
+ if (hq->is64bit || qoffset) {
+ nouveau_pushbuf_data(push, hq->bo, hq->offset + qoffset + 16 * index,
8 | NVC0_IB_ENTRY_1_NO_PREFETCH);
+ if (q->type == PIPE_QUERY_TIMESTAMP) {
+ PUSH_DATA(push, 0);
+ PUSH_DATA(push, 0);
+ } else {
+ nouveau_pushbuf_data(push, hq->bo, hq->offset + qoffset +
+ 16 * (index + stride),
+ 8 | NVC0_IB_ENTRY_1_NO_PREFETCH);
+ }
} else {
nouveau_pushbuf_data(push, hq->bo, hq->offset + 4,
4 | NVC0_IB_ENTRY_1_NO_PREFETCH);