summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_emit.c5
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_emit.c6
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_emit.c5
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_emit.c5
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.h8
-rw-r--r--src/gallium/drivers/freedreno/freedreno_screen.h8
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_gallium.c6
7 files changed, 24 insertions, 19 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
index 7ee4487194d..1535e069427 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
@@ -948,13 +948,14 @@ fd3_emit_restore(struct fd_batch *batch, struct fd_ringbuffer *ring)
void
fd3_emit_init_screen(struct pipe_screen *pscreen)
{
+ struct fd_screen *screen = fd_screen(pscreen);
+ screen->emit_const = fd3_emit_const;
+ screen->emit_const_bo = fd3_emit_const_bo;
}
void
fd3_emit_init(struct pipe_context *pctx)
{
struct fd_context *ctx = fd_context(pctx);
- ctx->emit_const = fd3_emit_const;
- ctx->emit_const_bo = fd3_emit_const_bo;
ctx->emit_ib = fd3_emit_ib;
}
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c
index f670d4f8c4a..bcd385d2bf3 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c
@@ -935,14 +935,16 @@ fd4_mem_to_mem(struct fd_ringbuffer *ring, struct pipe_resource *dst,
void
fd4_emit_init_screen(struct pipe_screen *pscreen)
{
+ struct fd_screen *screen = fd_screen(pscreen);
+
+ screen->emit_const = fd4_emit_const;
+ screen->emit_const_bo = fd4_emit_const_bo;
}
void
fd4_emit_init(struct pipe_context *pctx)
{
struct fd_context *ctx = fd_context(pctx);
- ctx->emit_const = fd4_emit_const;
- ctx->emit_const_bo = fd4_emit_const_bo;
ctx->emit_ib = fd4_emit_ib;
ctx->mem_to_mem = fd4_mem_to_mem;
}
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_emit.c b/src/gallium/drivers/freedreno/a5xx/fd5_emit.c
index ab375c4c01e..4710c690007 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_emit.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_emit.c
@@ -1122,14 +1122,15 @@ fd5_mem_to_mem(struct fd_ringbuffer *ring, struct pipe_resource *dst,
void
fd5_emit_init_screen(struct pipe_screen *pscreen)
{
+ struct fd_screen *screen = fd_screen(pscreen);
+ screen->emit_const = fd5_emit_const;
+ screen->emit_const_bo = fd5_emit_const_bo;
}
void
fd5_emit_init(struct pipe_context *pctx)
{
struct fd_context *ctx = fd_context(pctx);
- ctx->emit_const = fd5_emit_const;
- ctx->emit_const_bo = fd5_emit_const_bo;
ctx->emit_ib = fd5_emit_ib;
ctx->mem_to_mem = fd5_mem_to_mem;
}
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
index fd2ceaa4730..f70890f3b1e 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
@@ -1333,14 +1333,15 @@ fd6_framebuffer_barrier(struct fd_context *ctx)
void
fd6_emit_init_screen(struct pipe_screen *pscreen)
{
+ struct fd_screen *screen = fd_screen(pscreen);
+ screen->emit_const = fd6_emit_const;
+ screen->emit_const_bo = fd6_emit_const_bo;
}
void
fd6_emit_init(struct pipe_context *pctx)
{
struct fd_context *ctx = fd_context(pctx);
- ctx->emit_const = fd6_emit_const;
- ctx->emit_const_bo = fd6_emit_const_bo;
ctx->emit_ib = fd6_emit_ib;
ctx->mem_to_mem = fd6_mem_to_mem;
ctx->framebuffer_barrier = fd6_framebuffer_barrier;
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h
index 43c73ef909a..2f92b0575c2 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.h
+++ b/src/gallium/drivers/freedreno/freedreno_context.h
@@ -327,14 +327,6 @@ struct fd_context {
/* compute: */
void (*launch_grid)(struct fd_context *ctx, const struct pipe_grid_info *info);
- /* constant emit: (note currently not used/needed for a2xx) */
- void (*emit_const)(struct fd_ringbuffer *ring, gl_shader_stage type,
- uint32_t regid, uint32_t offset, uint32_t sizedwords,
- const uint32_t *dwords, struct pipe_resource *prsc);
- /* emit bo addresses as constant: */
- void (*emit_const_bo)(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
- uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets);
-
/* indirect-branch emit: */
void (*emit_ib)(struct fd_ringbuffer *ring, struct fd_ringbuffer *target);
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h
index b65495de9fc..afd6fd83a86 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.h
+++ b/src/gallium/drivers/freedreno/freedreno_screen.h
@@ -94,6 +94,14 @@ struct fd_screen {
uint32_t (*setup_slices)(struct fd_resource *rsc);
unsigned (*tile_mode)(const struct pipe_resource *prsc);
+ /* constant emit: (note currently not used/needed for a2xx) */
+ void (*emit_const)(struct fd_ringbuffer *ring, gl_shader_stage type,
+ uint32_t regid, uint32_t offset, uint32_t sizedwords,
+ const uint32_t *dwords, struct pipe_resource *prsc);
+ /* emit bo addresses as constant: */
+ void (*emit_const_bo)(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
+ uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets);
+
int64_t cpu_gpu_time_delta;
struct fd_batch_cache batch_cache;
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
index babc49b35c7..1d0e727d775 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
@@ -207,7 +207,7 @@ emit_const(struct fd_context *ctx, struct fd_ringbuffer *ring,
{
assert(dst_offset + size <= v->constlen * 4);
- ctx->emit_const(ring, v->type, dst_offset,
+ ctx->screen->emit_const(ring, v->type, dst_offset,
offset, size, user_buffer, buffer);
}
@@ -274,7 +274,7 @@ emit_ubos(struct fd_context *ctx, const struct ir3_shader_variant *v,
assert(offset * 4 + params < v->constlen * 4);
ring_wfi(ctx->batch, ring);
- ctx->emit_const_bo(ring, v->type, false, offset * 4, params, prscs, offsets);
+ ctx->screen->emit_const_bo(ring, v->type, false, offset * 4, params, prscs, offsets);
}
}
@@ -408,7 +408,7 @@ emit_tfbos(struct fd_context *ctx, const struct ir3_shader_variant *v,
assert(offset * 4 + params < v->constlen * 4);
ring_wfi(ctx->batch, ring);
- ctx->emit_const_bo(ring, v->type, true, offset * 4, params, prscs, offsets);
+ ctx->screen->emit_const_bo(ring, v->type, true, offset * 4, params, prscs, offsets);
}
}