Commit
1a170980a09 started writing to q->data[4]/[5] but kept the
per-query space at 16, which meant that in some cases we would write
past the end of the buffer. Rotate by 32, like nvc0 does. This ensures
that we always have 32 bytes in front of us, and the data writes will go
within the allocated space.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89679
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Nick Tenney <nick.tenney@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
uint32_t sequence;
struct nouveau_bo *bo;
uint32_t base;
- uint32_t offset; /* base + i * 16 */
+ uint32_t offset; /* base + i * 32 */
boolean ready;
boolean flushed;
boolean is64bit;
q->type = type;
if (q->type == PIPE_QUERY_OCCLUSION_COUNTER) {
- q->offset -= 16;
- q->data -= 16 / sizeof(*q->data); /* we advance before query_begin ! */
+ q->offset -= 32;
+ q->data -= 32 / sizeof(*q->data); /* we advance before query_begin ! */
}
return (struct pipe_query *)q;
* initialized it to TRUE.
*/
if (q->type == PIPE_QUERY_OCCLUSION_COUNTER) {
- q->offset += 16;
- q->data += 16 / sizeof(*q->data);
+ q->offset += 32;
+ q->data += 32 / sizeof(*q->data);
if (q->offset - q->base == NV50_QUERY_ALLOC_SPACE)
nv50_query_allocate(nv50, q, NV50_QUERY_ALLOC_SPACE);