summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2019-09-05 21:41:30 +0200
committerBoris Brezillon <[email protected]>2019-09-08 16:22:59 +0200
commit76274bcb5efd85913333b8edb404c0b2809c4944 (patch)
tree9f443393cd198f0ee04a10db3e78e24a526d42b5 /src/gallium/drivers
parenta2bba567aeaad0a0f83f171d5913b54509704e7a (diff)
panfrost: Convert ctx->{scratchpad, tiler_heap, tiler_dummy} to plain BOs
ctx->{scratchpad,tiler_heap,tiler_dummy} are allocated using panfrost_drm_allocate_slab() but they never any of the SLAB-based allocation logic. Let's convert those fields to plain BOs. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c29
-rw-r--r--src/gallium/drivers/panfrost/pan_context.h6
-rw-r--r--src/gallium/drivers/panfrost/pan_drm.c4
3 files changed, 21 insertions, 18 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 292de7fe132..0fb4c2584e4 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -83,16 +83,15 @@ panfrost_emit_midg_tiler(
/* Allow the entire tiler heap */
- t.heap_start = ctx->tiler_heap.bo->gpu;
- t.heap_end =
- ctx->tiler_heap.bo->gpu + ctx->tiler_heap.bo->size;
+ t.heap_start = ctx->tiler_heap->gpu;
+ t.heap_end = ctx->tiler_heap->gpu + ctx->tiler_heap->size;
} else {
/* The tiler is disabled, so don't allow the tiler heap */
- t.heap_start = ctx->tiler_heap.bo->gpu;
+ t.heap_start = ctx->tiler_heap->gpu;
t.heap_end = t.heap_start;
/* Use a dummy polygon list */
- t.polygon_list = ctx->tiler_dummy.bo->gpu;
+ t.polygon_list = ctx->tiler_dummy->gpu;
/* Disable the tiler */
t.hierarchy_mask |= MALI_TILER_DISABLED;
@@ -116,7 +115,7 @@ panfrost_emit_sfbd(struct panfrost_context *ctx, unsigned vertex_count)
.unknown2 = 0x1f,
.format = 0x30000000,
.clear_flags = 0x1000,
- .unknown_address_0 = ctx->scratchpad.bo->gpu,
+ .unknown_address_0 = ctx->scratchpad->gpu,
.tiler = panfrost_emit_midg_tiler(ctx,
width, height, vertex_count),
};
@@ -144,7 +143,7 @@ panfrost_emit_mfbd(struct panfrost_context *ctx, unsigned vertex_count)
.unknown2 = 0x1f,
- .scratchpad = ctx->scratchpad.bo->gpu,
+ .scratchpad = ctx->scratchpad->gpu,
.tiler = panfrost_emit_midg_tiler(ctx,
width, height, vertex_count)
};
@@ -2565,9 +2564,9 @@ panfrost_destroy(struct pipe_context *pipe)
if (panfrost->blitter_wallpaper)
util_blitter_destroy(panfrost->blitter_wallpaper);
- panfrost_drm_free_slab(screen, &panfrost->scratchpad);
- panfrost_drm_free_slab(screen, &panfrost->tiler_heap);
- panfrost_drm_free_slab(screen, &panfrost->tiler_dummy);
+ panfrost_drm_release_bo(screen, panfrost->scratchpad, false);
+ panfrost_drm_release_bo(screen, panfrost->tiler_heap, false);
+ panfrost_drm_release_bo(screen, panfrost->tiler_dummy, false);
ralloc_free(pipe);
}
@@ -2750,9 +2749,13 @@ panfrost_setup_hardware(struct panfrost_context *ctx)
struct pipe_context *gallium = (struct pipe_context *) ctx;
struct panfrost_screen *screen = pan_screen(gallium->screen);
- panfrost_drm_allocate_slab(screen, &ctx->scratchpad, 64*4, false, 0, 0, 0);
- panfrost_drm_allocate_slab(screen, &ctx->tiler_heap, 4096, false, PAN_ALLOCATE_INVISIBLE | PAN_ALLOCATE_GROWABLE, 1, 128);
- panfrost_drm_allocate_slab(screen, &ctx->tiler_dummy, 1, false, PAN_ALLOCATE_INVISIBLE, 0, 0);
+ ctx->scratchpad = panfrost_drm_create_bo(screen, 64 * 4 * 4096, 0);
+ ctx->tiler_heap = panfrost_drm_create_bo(screen, 4096 * 4096,
+ PAN_ALLOCATE_INVISIBLE |
+ PAN_ALLOCATE_GROWABLE);
+ ctx->tiler_dummy = panfrost_drm_create_bo(screen, 4096,
+ PAN_ALLOCATE_INVISIBLE);
+ assert(ctx->scratchpad && ctx->tiler_heap && ctx->tiler_dummy);
}
/* New context creation, which also does hardware initialisation since I don't
diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index 5af950e1001..8f9cc44feda 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -126,10 +126,10 @@ struct panfrost_context {
struct pipe_framebuffer_state pipe_framebuffer;
struct panfrost_streamout streamout;
+ struct panfrost_bo *scratchpad;
+ struct panfrost_bo *tiler_heap;
+ struct panfrost_bo *tiler_dummy;
struct panfrost_memory cmdstream_persistent;
- struct panfrost_memory scratchpad;
- struct panfrost_memory tiler_heap;
- struct panfrost_memory tiler_dummy;
struct panfrost_memory depth_stencil_buffer;
bool active_queries;
diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c
index 040cb1368e4..1edbb5bd1dc 100644
--- a/src/gallium/drivers/panfrost/pan_drm.c
+++ b/src/gallium/drivers/panfrost/pan_drm.c
@@ -298,8 +298,8 @@ panfrost_drm_submit_vs_fs_batch(struct panfrost_batch *batch, bool has_draws)
struct panfrost_context *ctx = batch->ctx;
int ret = 0;
- panfrost_batch_add_bo(batch, ctx->scratchpad.bo);
- panfrost_batch_add_bo(batch, ctx->tiler_heap.bo);
+ panfrost_batch_add_bo(batch, ctx->scratchpad);
+ panfrost_batch_add_bo(batch, ctx->tiler_heap);
panfrost_batch_add_bo(batch, batch->polygon_list);
if (batch->first_job.gpu) {