From: Rob Clark Date: Sat, 25 Jan 2020 19:04:58 +0000 (-0800) Subject: freedreno: constify fd_tile X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cbae9f34e9c80635a99a6cb2b0371bb67c5d7e62;p=mesa.git freedreno: constify fd_tile In a following patch, when we cache the gmem state, we will want to treat the gmem state as immuatable. So start converting things to const to make this more clear.. fd_tile is a good place to start. Signed-off-by: Rob Clark Part-of: --- diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c index bd600a5162c..4119e19a358 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c @@ -216,7 +216,7 @@ prepare_tile_fini_ib(struct fd_batch *batch) } static void -fd2_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile) +fd2_emit_tile_gmem2mem(struct fd_batch *batch, const struct fd_tile *tile) { fd2_emit_ib(batch->gmem, batch->tile_fini); } @@ -273,7 +273,7 @@ emit_mem2gmem_surf(struct fd_batch *batch, uint32_t base, } static void -fd2_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile) +fd2_emit_tile_mem2gmem(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd2_context *fd2_ctx = fd2_context(ctx); @@ -655,7 +655,7 @@ fd2_emit_tile_init(struct fd_batch *batch) /* before mem2gmem */ static void -fd2_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) +fd2_emit_tile_prep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_ringbuffer *ring = batch->gmem; struct pipe_framebuffer_state *pfb = &batch->framebuffer; @@ -677,7 +677,7 @@ fd2_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) /* before IB to rendering cmds: */ static void -fd2_emit_tile_renderprep(struct fd_batch *batch, struct fd_tile *tile) +fd2_emit_tile_renderprep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd2_context *fd2_ctx = fd2_context(ctx); diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c index 4bcb3cb1a79..6a9f6433c3d 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c @@ -357,7 +357,7 @@ emit_gmem2mem_surf(struct fd_batch *batch, } static void -fd3_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile) +fd3_emit_tile_gmem2mem(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd_ringbuffer *ring = batch->gmem; @@ -538,7 +538,7 @@ emit_mem2gmem_surf(struct fd_batch *batch, uint32_t bases[], } static void -fd3_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile) +fd3_emit_tile_mem2gmem(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd_gmem_stateobj *gmem = &ctx->gmem; @@ -972,7 +972,7 @@ fd3_emit_tile_init(struct fd_batch *batch) /* before mem2gmem */ static void -fd3_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) +fd3_emit_tile_prep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_ringbuffer *ring = batch->gmem; struct pipe_framebuffer_state *pfb = &batch->framebuffer; @@ -985,7 +985,7 @@ fd3_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) /* before IB to rendering cmds: */ static void -fd3_emit_tile_renderprep(struct fd_batch *batch, struct fd_tile *tile) +fd3_emit_tile_renderprep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd3_context *fd3_ctx = fd3_context(ctx); diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c b/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c index 2040b4f98d6..52e020d1aa6 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c @@ -187,7 +187,7 @@ emit_gmem2mem_surf(struct fd_batch *batch, bool stencil, } static void -fd4_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile) +fd4_emit_tile_gmem2mem(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd_gmem_stateobj *gmem = &ctx->gmem; @@ -325,7 +325,7 @@ emit_mem2gmem_surf(struct fd_batch *batch, uint32_t *bases, } static void -fd4_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile) +fd4_emit_tile_mem2gmem(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd_gmem_stateobj *gmem = &ctx->gmem; @@ -705,7 +705,7 @@ fd4_emit_tile_init(struct fd_batch *batch) /* before mem2gmem */ static void -fd4_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) +fd4_emit_tile_prep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd_ringbuffer *ring = batch->gmem; @@ -753,7 +753,7 @@ fd4_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) /* before IB to rendering cmds: */ static void -fd4_emit_tile_renderprep(struct fd_batch *batch, struct fd_tile *tile) +fd4_emit_tile_renderprep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd4_context *fd4_ctx = fd4_context(ctx); diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c index 0523ef616a9..8897d7735aa 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c @@ -410,7 +410,7 @@ fd5_emit_tile_init(struct fd_batch *batch) /* before mem2gmem */ static void -fd5_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) +fd5_emit_tile_prep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd_gmem_stateobj *gmem = &ctx->gmem; @@ -522,7 +522,7 @@ emit_mem2gmem_surf(struct fd_batch *batch, uint32_t base, } static void -fd5_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile) +fd5_emit_tile_mem2gmem(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_ringbuffer *ring = batch->gmem; struct fd_context *ctx = batch->ctx; @@ -566,7 +566,7 @@ fd5_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile) /* before IB to rendering cmds: */ static void -fd5_emit_tile_renderprep(struct fd_batch *batch, struct fd_tile *tile) +fd5_emit_tile_renderprep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_ringbuffer *ring = batch->gmem; struct fd_gmem_stateobj *gmem = &batch->ctx->gmem; @@ -652,7 +652,7 @@ emit_gmem2mem_surf(struct fd_batch *batch, uint32_t base, } static void -fd5_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile) +fd5_emit_tile_gmem2mem(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd_gmem_stateobj *gmem = &ctx->gmem; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c index 004fe0ed609..09407de90a3 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c @@ -549,7 +549,7 @@ check_vsc_overflow(struct fd_context *ctx) * is skipped for tiles that have no visible geometry. */ static void -emit_conditional_ib(struct fd_batch *batch, struct fd_tile *tile, +emit_conditional_ib(struct fd_batch *batch, const struct fd_tile *tile, struct fd_ringbuffer *target) { struct fd_ringbuffer *ring = batch->gmem; @@ -819,7 +819,7 @@ set_window_offset(struct fd_ringbuffer *ring, uint32_t x1, uint32_t y1) /* before mem2gmem */ static void -fd6_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) +fd6_emit_tile_prep(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_context *ctx = batch->ctx; struct fd_gmem_stateobj *gmem = &ctx->gmem; @@ -1213,13 +1213,13 @@ prepare_tile_setup_ib(struct fd_batch *batch) * transfer from system memory to gmem */ static void -fd6_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile) +fd6_emit_tile_mem2gmem(struct fd_batch *batch, const struct fd_tile *tile) { } /* before IB to rendering cmds: */ static void -fd6_emit_tile_renderprep(struct fd_batch *batch, struct fd_tile *tile) +fd6_emit_tile_renderprep(struct fd_batch *batch, const struct fd_tile *tile) { if (batch->fast_cleared || !use_hw_binning(batch)) { fd6_emit_ib(batch->gmem, batch->tile_setup); @@ -1309,7 +1309,7 @@ prepare_tile_fini_ib(struct fd_batch *batch) } static void -fd6_emit_tile(struct fd_batch *batch, struct fd_tile *tile) +fd6_emit_tile(struct fd_batch *batch, const struct fd_tile *tile) { if (!use_hw_binning(batch)) { fd6_emit_ib(batch->gmem, batch->draw); @@ -1319,7 +1319,7 @@ fd6_emit_tile(struct fd_batch *batch, struct fd_tile *tile) } static void -fd6_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile) +fd6_emit_tile_gmem2mem(struct fd_batch *batch, const struct fd_tile *tile) { struct fd_ringbuffer *ring = batch->gmem; diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 422d6c01a3b..1a60f978597 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -311,11 +311,11 @@ struct fd_context { /* GMEM/tile handling fxns: */ void (*emit_tile_init)(struct fd_batch *batch); - void (*emit_tile_prep)(struct fd_batch *batch, struct fd_tile *tile); - void (*emit_tile_mem2gmem)(struct fd_batch *batch, struct fd_tile *tile); - void (*emit_tile_renderprep)(struct fd_batch *batch, struct fd_tile *tile); - void (*emit_tile)(struct fd_batch *batch, struct fd_tile *tile); - void (*emit_tile_gmem2mem)(struct fd_batch *batch, struct fd_tile *tile); + void (*emit_tile_prep)(struct fd_batch *batch, const struct fd_tile *tile); + void (*emit_tile_mem2gmem)(struct fd_batch *batch, const struct fd_tile *tile); + void (*emit_tile_renderprep)(struct fd_batch *batch, const struct fd_tile *tile); + void (*emit_tile)(struct fd_batch *batch, const struct fd_tile *tile); + void (*emit_tile_gmem2mem)(struct fd_batch *batch, const struct fd_tile *tile); void (*emit_tile_fini)(struct fd_batch *batch); /* optional */ /* optional, for GMEM bypass: */ diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c index fe80e2020fe..0a960859a6c 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.c +++ b/src/gallium/drivers/freedreno/freedreno_gmem.c @@ -505,7 +505,7 @@ fd_gmem_render_tiles(struct fd_batch *batch) * case would be a single clear. */ bool -fd_gmem_needs_restore(struct fd_batch *batch, struct fd_tile *tile, +fd_gmem_needs_restore(struct fd_batch *batch, const struct fd_tile *tile, uint32_t buffers) { if (!(batch->restore & buffers)) diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.h b/src/gallium/drivers/freedreno/freedreno_gmem.h index 3f37e2d7632..00c446603f6 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.h +++ b/src/gallium/drivers/freedreno/freedreno_gmem.h @@ -65,7 +65,7 @@ struct fd_batch; void fd_gmem_render_tiles(struct fd_batch *batch); -bool fd_gmem_needs_restore(struct fd_batch *batch, struct fd_tile *tile, +bool fd_gmem_needs_restore(struct fd_batch *batch, const struct fd_tile *tile, uint32_t buffers); #endif /* FREEDRENO_GMEM_H_ */