iris: set EXEC_OBJECT_WRITE
This commit is contained in:
@@ -571,10 +571,14 @@ iris_batch_references(struct iris_batch *batch, struct iris_bo *bo)
|
|||||||
/* This is the only way buffers get added to the validate list.
|
/* This is the only way buffers get added to the validate list.
|
||||||
*/
|
*/
|
||||||
void
|
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);
|
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
|
static void
|
||||||
|
@@ -38,8 +38,8 @@
|
|||||||
|
|
||||||
struct iris_address {
|
struct iris_address {
|
||||||
struct iris_bo *bo;
|
struct iris_bo *bo;
|
||||||
unsigned reloc_flags;
|
|
||||||
uint64_t offset;
|
uint64_t offset;
|
||||||
|
bool write;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iris_batch_buffer {
|
struct iris_batch_buffer {
|
||||||
@@ -106,6 +106,7 @@ bool iris_batch_references(struct iris_batch *batch, struct iris_bo *bo);
|
|||||||
|
|
||||||
#define RELOC_WRITE EXEC_OBJECT_WRITE
|
#define RELOC_WRITE EXEC_OBJECT_WRITE
|
||||||
|
|
||||||
void iris_use_pinned_bo(struct iris_batch *batch, struct iris_bo *bo);
|
void iris_use_pinned_bo(struct iris_batch *batch, struct iris_bo *bo,
|
||||||
|
bool writable);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -57,9 +57,8 @@ static uint64_t
|
|||||||
__gen_combine_address(struct iris_batch *batch, void *location,
|
__gen_combine_address(struct iris_batch *batch, void *location,
|
||||||
struct iris_address addr, uint32_t delta)
|
struct iris_address addr, uint32_t delta)
|
||||||
{
|
{
|
||||||
// XXX: reloc flags?
|
|
||||||
if (addr.bo)
|
if (addr.bo)
|
||||||
iris_use_pinned_bo(batch, addr.bo);
|
iris_use_pinned_bo(batch, addr.bo, addr.write);
|
||||||
|
|
||||||
return addr.offset + delta;
|
return addr.offset + delta;
|
||||||
}
|
}
|
||||||
@@ -286,7 +285,7 @@ stream_state(struct iris_batch *batch,
|
|||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
|
|
||||||
u_upload_alloc(uploader, 0, size, alignment, out_offset, &res, &ptr);
|
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);
|
pipe_resource_reference(&res, NULL);
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
@@ -1973,6 +1972,7 @@ iris_upload_render_state(struct iris_context *ice,
|
|||||||
for (unsigned i = 0; i < cso_fb->nr_cbufs; i++) {
|
for (unsigned i = 0; i < cso_fb->nr_cbufs; i++) {
|
||||||
struct iris_surface *surf = (void *) cso_fb->cbufs[i];
|
struct iris_surface *surf = (void *) cso_fb->cbufs[i];
|
||||||
struct iris_resource *res = (void *) surf->pipe.texture;
|
struct iris_resource *res = (void *) surf->pipe.texture;
|
||||||
|
iris_use_pinned_bo(batch, res->bo, true);
|
||||||
*bt_map++ =
|
*bt_map++ =
|
||||||
emit_state(batch, ice->state.surface_uploader,
|
emit_state(batch, ice->state.surface_uploader,
|
||||||
surf->surface_state,
|
surf->surface_state,
|
||||||
@@ -2051,7 +2051,7 @@ iris_upload_render_state(struct iris_context *ice,
|
|||||||
|
|
||||||
if (shader) {
|
if (shader) {
|
||||||
struct iris_resource *cache = (void *) shader->buffer;
|
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_batch_emit(batch, shader->derived_data,
|
||||||
iris_derived_program_state_size(stage));
|
iris_derived_program_state_size(stage));
|
||||||
} else {
|
} else {
|
||||||
@@ -2221,7 +2221,7 @@ iris_upload_render_state(struct iris_context *ice,
|
|||||||
sizeof(uint32_t) * (1 + 4 * cso->num_buffers));
|
sizeof(uint32_t) * (1 + 4 * cso->num_buffers));
|
||||||
|
|
||||||
for (unsigned i = 0; i < cso->num_buffers; i++) {
|
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 = cso->bos[i].offset + *delta;
|
||||||
addr = (void *) addr + 16;
|
addr = (void *) addr + 16;
|
||||||
delta = (void *) delta + 16;
|
delta = (void *) delta + 16;
|
||||||
|
Reference in New Issue
Block a user