75,7 → 75,7 |
#define DEBUG_SYNC 0 |
#endif |
|
#define SHOW_BATCH 0 |
#define SHOW_BATCH 1 |
|
#if 0 |
#define ASSERT_IDLE(kgem__, handle__) assert(!__kgem_busy(kgem__, handle__)) |
136,7 → 136,7 |
uint32_t cacheing; |
}; |
|
#define LOCAL_IOCTL_I915_GEM_SET_CACHEING SRV_I915_GEM_SET_CACHEING |
#define LOCAL_IOCTL_I915_GEM_SET_CACHEING SRV_I915_GEM_SET_CACHING |
|
struct local_fbinfo { |
int width; |
3913,7 → 3913,49 |
} |
} |
|
void *kgem_bo_map__async(struct kgem *kgem, struct kgem_bo *bo) |
{ |
void *ptr; |
|
DBG(("%s: handle=%d, offset=%d, tiling=%d, map=%p, domain=%d\n", __FUNCTION__, |
bo->handle, bo->presumed_offset, bo->tiling, bo->map, bo->domain)); |
|
assert(!bo->purged); |
assert(bo->proxy == NULL); |
assert(list_is_empty(&bo->list)); |
|
if (bo->tiling == I915_TILING_NONE && !bo->scanout && kgem->has_llc) { |
DBG(("%s: converting request for GTT map into CPU map\n", |
__FUNCTION__)); |
return kgem_bo_map__cpu(kgem, bo); |
} |
|
if (IS_CPU_MAP(bo->map)) |
kgem_bo_release_map(kgem, bo); |
|
ptr = bo->map; |
if (ptr == NULL) { |
assert(kgem_bo_size(bo) <= kgem->aperture_mappable / 2); |
|
kgem_trim_vma_cache(kgem, MAP_GTT, bucket(bo)); |
|
ptr = __kgem_bo_map__gtt(kgem, bo); |
if (ptr == NULL) |
return NULL; |
|
/* Cache this mapping to avoid the overhead of an |
* excruciatingly slow GTT pagefault. This is more an |
* issue with compositing managers which need to frequently |
* flush CPU damage to their GPU bo. |
*/ |
bo->map = ptr; |
DBG(("%s: caching GTT vma for %d\n", __FUNCTION__, bo->handle)); |
} |
|
return ptr; |
} |
|
|
void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo) |
{ |
void *ptr; |
4015,6 → 4057,10 |
return ptr; |
} |
|
void *kgem_bo_map__debug(struct kgem *kgem, struct kgem_bo *bo) |
{ |
return kgem_bo_map__async(kgem, bo); |
} |
|
void *kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo) |
{ |