anv: Add an anv_batch_set_storage helper
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5457>
This commit is contained in:

committed by
Marge Bot

parent
fcdefa7e47
commit
1b693341ac
@@ -409,9 +409,8 @@ static void
|
|||||||
anv_batch_bo_start(struct anv_batch_bo *bbo, struct anv_batch *batch,
|
anv_batch_bo_start(struct anv_batch_bo *bbo, struct anv_batch *batch,
|
||||||
size_t batch_padding)
|
size_t batch_padding)
|
||||||
{
|
{
|
||||||
batch->start_addr = (struct anv_address) { .bo = bbo->bo, };
|
anv_batch_set_storage(batch, (struct anv_address) { .bo = bbo->bo, },
|
||||||
batch->next = batch->start = bbo->bo->map;
|
bbo->bo->map, bbo->bo->size - batch_padding);
|
||||||
batch->end = bbo->bo->map + bbo->bo->size - batch_padding;
|
|
||||||
batch->relocs = &bbo->relocs;
|
batch->relocs = &bbo->relocs;
|
||||||
anv_reloc_list_clear(&bbo->relocs);
|
anv_reloc_list_clear(&bbo->relocs);
|
||||||
}
|
}
|
||||||
|
@@ -2001,10 +2001,10 @@ anv_pipeline_init(struct anv_graphics_pipeline *pipeline,
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
pipeline->base.batch.alloc = alloc;
|
pipeline->base.batch.alloc = alloc;
|
||||||
pipeline->base.batch.next = pipeline->base.batch.start = pipeline->batch_data;
|
|
||||||
pipeline->base.batch.end = pipeline->base.batch.start + sizeof(pipeline->batch_data);
|
|
||||||
pipeline->base.batch.relocs = &pipeline->base.batch_relocs;
|
pipeline->base.batch.relocs = &pipeline->base.batch_relocs;
|
||||||
pipeline->base.batch.status = VK_SUCCESS;
|
pipeline->base.batch.status = VK_SUCCESS;
|
||||||
|
anv_batch_set_storage(&pipeline->base.batch, ANV_NULL_ADDRESS,
|
||||||
|
pipeline->batch_data, sizeof(pipeline->batch_data));
|
||||||
|
|
||||||
pipeline->base.mem_ctx = ralloc_context(NULL);
|
pipeline->base.mem_ctx = ralloc_context(NULL);
|
||||||
pipeline->base.flags = pCreateInfo->flags;
|
pipeline->base.flags = pCreateInfo->flags;
|
||||||
|
@@ -1648,6 +1648,15 @@ uint64_t anv_batch_emit_reloc(struct anv_batch *batch,
|
|||||||
void *location, struct anv_bo *bo, uint32_t offset);
|
void *location, struct anv_bo *bo, uint32_t offset);
|
||||||
struct anv_address anv_batch_address(struct anv_batch *batch, void *batch_location);
|
struct anv_address anv_batch_address(struct anv_batch *batch, void *batch_location);
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
anv_batch_set_storage(struct anv_batch *batch, struct anv_address addr,
|
||||||
|
void *map, size_t size)
|
||||||
|
{
|
||||||
|
batch->start_addr = addr;
|
||||||
|
batch->next = batch->start = map;
|
||||||
|
batch->end = map + size;
|
||||||
|
}
|
||||||
|
|
||||||
static inline VkResult
|
static inline VkResult
|
||||||
anv_batch_set_error(struct anv_batch *batch, VkResult error)
|
anv_batch_set_error(struct anv_batch *batch, VkResult error)
|
||||||
{
|
{
|
||||||
|
@@ -2299,10 +2299,10 @@ compute_pipeline_create(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
pipeline->base.batch.alloc = alloc;
|
pipeline->base.batch.alloc = alloc;
|
||||||
pipeline->base.batch.next = pipeline->base.batch.start = pipeline->batch_data;
|
|
||||||
pipeline->base.batch.end = pipeline->base.batch.start + sizeof(pipeline->batch_data);
|
|
||||||
pipeline->base.batch.relocs = &pipeline->base.batch_relocs;
|
pipeline->base.batch.relocs = &pipeline->base.batch_relocs;
|
||||||
pipeline->base.batch.status = VK_SUCCESS;
|
pipeline->base.batch.status = VK_SUCCESS;
|
||||||
|
anv_batch_set_storage(&pipeline->base.batch, ANV_NULL_ADDRESS,
|
||||||
|
pipeline->batch_data, sizeof(pipeline->batch_data));
|
||||||
|
|
||||||
pipeline->base.mem_ctx = ralloc_context(NULL);
|
pipeline->base.mem_ctx = ralloc_context(NULL);
|
||||||
pipeline->base.flags = pCreateInfo->flags;
|
pipeline->base.flags = pCreateInfo->flags;
|
||||||
|
Reference in New Issue
Block a user