struct list_head link;
struct gen_batch_decode_bo bo;
bool unmap_after_use;
+ bool ppgtt;
};
struct ggtt_entry {
};
static void
-add_gtt_bo_map(struct aub_mem *mem, struct gen_batch_decode_bo bo, bool unmap_after_use)
+add_gtt_bo_map(struct aub_mem *mem, struct gen_batch_decode_bo bo, bool ppgtt, bool unmap_after_use)
{
struct bo_map *m = calloc(1, sizeof(*m));
+ m->ppgtt = ppgtt;
m->bo = bo;
m->unmap_after_use = unmap_after_use;
list_add(&m->link, &mem->maps);
.addr = address,
.size = size,
};
- add_gtt_bo_map(mem, bo, false);
+ add_gtt_bo_map(mem, bo, false, false);
}
void
struct gen_batch_decode_bo bo = {0};
list_for_each_entry(struct bo_map, i, &mem->maps, link)
- if (i->bo.addr <= address && i->bo.addr + i->bo.size > address)
+ if (!i->ppgtt && i->bo.addr <= address && i->bo.addr + i->bo.size > address)
return i->bo;
address &= ~0xfff;
assert(res != MAP_FAILED);
}
- add_gtt_bo_map(mem, bo, true);
+ add_gtt_bo_map(mem, bo, false, true);
return bo;
}
struct aub_mem *mem = _mem;
struct gen_batch_decode_bo bo = {0};
+ list_for_each_entry(struct bo_map, i, &mem->maps, link)
+ if (i->ppgtt && i->bo.addr <= address && i->bo.addr + i->bo.size > address)
+ return i->bo;
+
address &= ~0xfff;
if (!ppgtt_mapped(mem, mem->pml4, address))
assert(res != MAP_FAILED);
}
- add_gtt_bo_map(mem, bo, true);
+ add_gtt_bo_map(mem, bo, true, true);
return bo;
}