{
assert(target != NULL);
+ unsigned int index = add_exec_bo(batch, target);
+ struct drm_i915_gem_exec_object2 *entry = &batch->validation_list[index];
+
+ if (target->kflags & EXEC_OBJECT_PINNED) {
+ assert(entry->offset == target->gtt_offset);
+ return entry->offset + target_offset;
+ }
+
if (rlist->reloc_count == rlist->reloc_array_size) {
rlist->reloc_array_size *= 2;
rlist->relocs = realloc(rlist->relocs,
sizeof(struct drm_i915_gem_relocation_entry));
}
- unsigned int index = add_exec_bo(batch, target);
- struct drm_i915_gem_exec_object2 *entry = &batch->validation_list[index];
-
rlist->relocs[rlist->reloc_count++] =
(struct drm_i915_gem_relocation_entry) {
.offset = offset,
void *old_map = cache->map;
cache->bo = iris_bo_alloc(screen->bufmgr, "program cache", size, 64);
- cache->bo->kflags = EXEC_OBJECT_CAPTURE;
+ cache->bo->kflags = EXEC_OBJECT_CAPTURE | EXEC_OBJECT_PINNED;
cache->map = iris_bo_map(&ice->dbg, cache->bo,
MAP_READ | MAP_WRITE | MAP_ASYNC | MAP_PERSISTENT);
(unsigned) old_bo->size / 1024,
(unsigned) cache->bo->size / 1024);
+ /* Put the new BO just past the old one */
+ cache->bo->gtt_offset = ALIGN(old_bo->gtt_offset + old_bo->size, 4096);
+
memcpy(cache->map, old_map, cache->next_offset);
iris_bo_unreference(old_bo);
iris_bo_unmap(old_bo);
+ } else {
+ /* Put the initial cache BO...somewhere. */
+ cache->bo->gtt_offset = 4096 * 10;
}
ice->state.dirty |= IRIS_DIRTY_STATE_BASE_ADDRESS;