sna: Update flush/retirement lists after a implicit flush for mmap

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-07-04 13:45:06 +01:00
parent 3e53b0f3a3
commit d294e41a6a
1 changed files with 12 additions and 1 deletions

View File

@ -1557,7 +1557,18 @@ uint32_t kgem_add_reloc(struct kgem *kgem,
void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo, int prot)
{
return gem_mmap(kgem->fd, bo->handle, bo->size, prot);
void *ptr = gem_mmap(kgem->fd, bo->handle, bo->size, prot);
if (ptr == NULL)
return NULL;
bo->needs_flush = false;
if (prot & PROT_WRITE) {
if (bo->rq)
kgem_retire(kgem);
bo->gpu = false;
}
return ptr;
}
uint32_t kgem_bo_flink(struct kgem *kgem, struct kgem_bo *bo)