From 34efaafc93ca5c28c96396333eeba0f492ce6b94 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Sat, 14 Sep 2019 13:24:47 +0200 Subject: [PATCH] panfrost: s/PAN_ALLOCATE_/PAN_BO_/ Change the prefix for BO allocation flags to make it consistent with the rest of the BO API. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_assemble.c | 2 +- src/gallium/drivers/panfrost/pan_blend_cso.c | 2 +- src/gallium/drivers/panfrost/pan_bo.c | 12 ++++++------ src/gallium/drivers/panfrost/pan_context.c | 6 +++--- src/gallium/drivers/panfrost/pan_job.c | 2 +- src/gallium/drivers/panfrost/pan_resource.c | 4 ++-- src/gallium/drivers/panfrost/pan_screen.h | 10 +++++----- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index de73cf8..cc4822a 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -82,7 +82,7 @@ panfrost_shader_compile( * I bet someone just thought that would be a cute pun. At least, * that's how I'd do it. */ - state->bo = panfrost_bo_create(screen, size, PAN_ALLOCATE_EXECUTE); + state->bo = panfrost_bo_create(screen, size, PAN_BO_EXECUTE); memcpy(state->bo->cpu, dst, size); meta->shader = state->bo->gpu | program.first_tag; diff --git a/src/gallium/drivers/panfrost/pan_blend_cso.c b/src/gallium/drivers/panfrost/pan_blend_cso.c index 82527a5..c61ffe2 100644 --- a/src/gallium/drivers/panfrost/pan_blend_cso.c +++ b/src/gallium/drivers/panfrost/pan_blend_cso.c @@ -272,7 +272,7 @@ panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti) final.shader.first_tag = shader->first_tag; /* Upload the shader */ - final.shader.bo = panfrost_bo_create(screen, shader->size, PAN_ALLOCATE_EXECUTE); + final.shader.bo = panfrost_bo_create(screen, shader->size, PAN_BO_EXECUTE); memcpy(final.shader.bo->cpu, shader->buffer, shader->size); /* Pass BO ownership to job */ diff --git a/src/gallium/drivers/panfrost/pan_bo.c b/src/gallium/drivers/panfrost/pan_bo.c index 9b0e8d9..7f14b3e 100644 --- a/src/gallium/drivers/panfrost/pan_bo.c +++ b/src/gallium/drivers/panfrost/pan_bo.c @@ -228,16 +228,16 @@ panfrost_bo_create(struct panfrost_screen *screen, size_t size, size = MAX2(size, 4096); /* GROWABLE BOs cannot be mmapped */ - if (flags & PAN_ALLOCATE_GROWABLE) - assert(flags & PAN_ALLOCATE_INVISIBLE); + if (flags & PAN_BO_GROWABLE) + assert(flags & PAN_BO_INVISIBLE); unsigned translated_flags = 0; if (screen->kernel_version->version_major > 1 || screen->kernel_version->version_minor >= 1) { - if (flags & PAN_ALLOCATE_GROWABLE) + if (flags & PAN_BO_GROWABLE) translated_flags |= PANFROST_BO_HEAP; - if (!(flags & PAN_ALLOCATE_EXECUTE)) + if (!(flags & PAN_BO_EXECUTE)) translated_flags |= PANFROST_BO_NOEXEC; } @@ -276,9 +276,9 @@ panfrost_bo_create(struct panfrost_screen *screen, size_t size, * never map since we don't care about their contents; they're purely * for GPU-internal use. But we do trace them anyway. */ - if (!(flags & (PAN_ALLOCATE_INVISIBLE | PAN_ALLOCATE_DELAY_MMAP))) + if (!(flags & (PAN_BO_INVISIBLE | PAN_BO_DELAY_MMAP))) panfrost_bo_mmap(screen, bo); - else if (flags & PAN_ALLOCATE_INVISIBLE) { + else if (flags & PAN_BO_INVISIBLE) { if (pan_debug & PAN_DBG_TRACE) pandecode_inject_mmap(bo->gpu, NULL, bo->size, NULL); } diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index cadb462..f01ddf1 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -2613,10 +2613,10 @@ panfrost_setup_hardware(struct panfrost_context *ctx) ctx->scratchpad = panfrost_bo_create(screen, 64 * 4 * 4096, 0); ctx->tiler_heap = panfrost_bo_create(screen, 4096 * 4096, - PAN_ALLOCATE_INVISIBLE | - PAN_ALLOCATE_GROWABLE); + PAN_BO_INVISIBLE | + PAN_BO_GROWABLE); ctx->tiler_dummy = panfrost_bo_create(screen, 4096, - PAN_ALLOCATE_INVISIBLE); + PAN_BO_INVISIBLE); assert(ctx->scratchpad && ctx->tiler_heap && ctx->tiler_dummy); } diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 7bd0629..839e19c 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -158,7 +158,7 @@ panfrost_batch_get_polygon_list(struct panfrost_batch *batch, unsigned size) /* Create the BO as invisible, as there's no reason to map */ batch->polygon_list = panfrost_bo_create(screen, size, - PAN_ALLOCATE_INVISIBLE); + PAN_BO_INVISIBLE); panfrost_batch_add_bo(batch, batch->polygon_list); /* A BO reference has been retained by panfrost_batch_add_bo(), diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 766edee..91f3045 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -412,7 +412,7 @@ panfrost_resource_create_bo(struct panfrost_screen *screen, struct panfrost_reso /* We create a BO immediately but don't bother mapping, since we don't * care to map e.g. FBOs which the CPU probably won't touch */ - pres->bo = panfrost_bo_create(screen, bo_size, PAN_ALLOCATE_DELAY_MMAP); + pres->bo = panfrost_bo_create(screen, bo_size, PAN_BO_DELAY_MMAP); } void @@ -843,7 +843,7 @@ panfrost_resource_hint_layout( /* If we grew in size, reallocate the BO */ if (new_size > rsrc->bo->size) { panfrost_bo_release(screen, rsrc->bo, true); - rsrc->bo = panfrost_bo_create(screen, new_size, PAN_ALLOCATE_DELAY_MMAP); + rsrc->bo = panfrost_bo_create(screen, new_size, PAN_BO_DELAY_MMAP); } } diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h index 2f0ebd4..c93064a 100644 --- a/src/gallium/drivers/panfrost/pan_screen.h +++ b/src/gallium/drivers/panfrost/pan_screen.h @@ -50,22 +50,22 @@ struct panfrost_screen; /* Flags for allocated memory */ /* This memory region is executable */ -#define PAN_ALLOCATE_EXECUTE (1 << 0) +#define PAN_BO_EXECUTE (1 << 0) /* This memory region should be lazily allocated and grow-on-page-fault. Must * be used in conjunction with INVISIBLE */ -#define PAN_ALLOCATE_GROWABLE (1 << 1) +#define PAN_BO_GROWABLE (1 << 1) /* This memory region should not be mapped to the CPU */ -#define PAN_ALLOCATE_INVISIBLE (1 << 2) +#define PAN_BO_INVISIBLE (1 << 2) /* This memory region will be used for varyings and needs to have the cache * bits twiddled accordingly */ -#define PAN_ALLOCATE_COHERENT_LOCAL (1 << 3) +#define PAN_BO_COHERENT_LOCAL (1 << 3) /* This region may not be used immediately and will not mmap on allocate * (semantically distinct from INVISIBLE, which cannot never be mmaped) */ -#define PAN_ALLOCATE_DELAY_MMAP (1 << 4) +#define PAN_BO_DELAY_MMAP (1 << 4) /* Transient slab size. This is a balance between fragmentation against cache * locality and ease of bookkeeping */ -- 2.7.4