sna: Align active upload buffers to the next page for reuse
If we write to the same page as it already active on the GPU then despite the invalidation performed at the beginning of each batch, we do not seem to correctly sample the new data. References: https://bugs.freedesktop.org/show_bug.cgi?id=51422 References: https://bugs.freedesktop.org/show_bug.cgi?id=52299 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
9e0305a392
commit
deaa1cac26
|
|
@ -1910,13 +1910,18 @@ static void kgem_finish_buffers(struct kgem *kgem)
|
|||
}
|
||||
|
||||
if (bo->mmapped) {
|
||||
int used;
|
||||
|
||||
assert(!bo->need_io);
|
||||
|
||||
used = ALIGN(bo->used + PAGE_SIZE-1, PAGE_SIZE);
|
||||
if (!DBG_NO_UPLOAD_ACTIVE &&
|
||||
bo->used + PAGE_SIZE <= bytes(&bo->base) &&
|
||||
used + PAGE_SIZE <= bytes(&bo->base) &&
|
||||
(kgem->has_llc || !IS_CPU_MAP(bo->base.map))) {
|
||||
DBG(("%s: retaining upload buffer (%d/%d)\n",
|
||||
__FUNCTION__, bo->used, bytes(&bo->base)));
|
||||
assert(!bo->base.snoop);
|
||||
bo->used = used;
|
||||
list_move(&bo->base.list,
|
||||
&kgem->active_buffers);
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue