sna: check for failure to change cache level on the bo

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-07-03 22:27:39 +01:00
parent 9e2ac8a413
commit 79309dd55f
1 changed files with 2 additions and 3 deletions

View File

@ -3052,10 +3052,9 @@ struct kgem_bo *kgem_create_cpu_2d(struct kgem *kgem,
if (bo == NULL)
return NULL;
gem_set_cache_level(kgem->fd, bo->handle, I915_CACHE_LLC);
bo->reusable = false;
if (kgem_bo_map__cpu(kgem, bo) == NULL) {
if (!gem_set_cache_level(kgem->fd, bo->handle, I915_CACHE_LLC) ||
kgem_bo_map__cpu(kgem, bo) == NULL) {
kgem_bo_destroy(kgem, bo);
return NULL;
}