/* This is the only way buffers get added to the validate list.
*/
void
-iris_use_pinned_bo(struct iris_batch *batch, struct iris_bo *bo)
+iris_use_pinned_bo(struct iris_batch *batch,
+ struct iris_bo *bo,
+ bool writable)
{
assert(bo->kflags & EXEC_OBJECT_PINNED);
- add_exec_bo(batch, bo);
+ unsigned index = add_exec_bo(batch, bo);
+ if (writable)
+ batch->validation_list[index].flags |= EXEC_OBJECT_WRITE;
}
static void
__gen_combine_address(struct iris_batch *batch, void *location,
struct iris_address addr, uint32_t delta)
{
- // XXX: reloc flags?
if (addr.bo)
- iris_use_pinned_bo(batch, addr.bo);
+ iris_use_pinned_bo(batch, addr.bo, addr.write);
return addr.offset + delta;
}
void *ptr = NULL;
u_upload_alloc(uploader, 0, size, alignment, out_offset, &res, &ptr);
- iris_use_pinned_bo(batch, ((struct iris_resource *) res)->bo);
+ iris_use_pinned_bo(batch, ((struct iris_resource *) res)->bo, false);
pipe_resource_reference(&res, NULL);
return ptr;
for (unsigned i = 0; i < cso_fb->nr_cbufs; i++) {
struct iris_surface *surf = (void *) cso_fb->cbufs[i];
struct iris_resource *res = (void *) surf->pipe.texture;
+ iris_use_pinned_bo(batch, res->bo, true);
*bt_map++ =
emit_state(batch, ice->state.surface_uploader,
surf->surface_state,
if (shader) {
struct iris_resource *cache = (void *) shader->buffer;
- iris_use_pinned_bo(batch, cache->bo);
+ iris_use_pinned_bo(batch, cache->bo, false);
iris_batch_emit(batch, shader->derived_data,
iris_derived_program_state_size(stage));
} else {
sizeof(uint32_t) * (1 + 4 * cso->num_buffers));
for (unsigned i = 0; i < cso->num_buffers; i++) {
- iris_use_pinned_bo(batch, cso->bos[i].bo);
+ iris_use_pinned_bo(batch, cso->bos[i].bo, false);
*addr = cso->bos[i].offset + *delta;
addr = (void *) addr + 16;
delta = (void *) delta + 16;