The context can be retrieved from batch->ctx.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
struct panfrost_context *ctx = pan_context(pipe);
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
- panfrost_batch_clear(ctx, batch, buffers, color, depth, stencil);
+ panfrost_batch_clear(batch, buffers, color, depth, stencil);
}
static mali_ptr
SET_BIT(ctx->fragment_shader_core.unknown2_4, MALI_NO_MSAA, !msaa);
}
- panfrost_batch_set_requirements(ctx, batch);
+ panfrost_batch_set_requirements(batch);
if (ctx->occlusion_query) {
ctx->payloads[PIPE_SHADER_FRAGMENT].gl_enables |= MALI_OCCLUSION_QUERY | MALI_OCCLUSION_PRECISE;
struct pipe_fence_handle **fence,
struct panfrost_batch *batch)
{
- panfrost_batch_submit(ctx, batch);
+ panfrost_batch_submit(batch);
/* If visual, we can stall a frame */
ctx->last_fragment_flushed = true;
/* The job finished up, so we're safe to clean it up now */
- panfrost_free_batch(ctx, ctx->last_batch);
+ panfrost_free_batch(ctx->last_batch);
}
if (fence) {
}
void
-panfrost_free_batch(struct panfrost_context *ctx, struct panfrost_batch *batch)
+panfrost_free_batch(struct panfrost_batch *batch)
{
if (!batch)
return;
+ struct panfrost_context *ctx = batch->ctx;
+
set_foreach(batch->bos, entry) {
struct panfrost_bo *bo = (struct panfrost_bo *)entry->key;
panfrost_bo_unreference(ctx->base.screen, bo);
prsc);
if (entry) {
struct panfrost_batch *batch = entry->data;
- panfrost_batch_submit(panfrost, job);
+ panfrost_batch_submit(job);
}
#endif
/* TODO stub */
}
void
-panfrost_batch_submit(struct panfrost_context *ctx, struct panfrost_batch *batch)
+panfrost_batch_submit(struct panfrost_batch *batch)
{
+ assert(batch);
+
+ struct panfrost_context *ctx = batch->ctx;
int ret;
- assert(batch);
panfrost_scoreboard_link_batch(batch);
bool has_draws = batch->last_job.gpu;
}
void
-panfrost_batch_set_requirements(struct panfrost_context *ctx,
- struct panfrost_batch *batch)
+panfrost_batch_set_requirements(struct panfrost_batch *batch)
{
+ struct panfrost_context *ctx = batch->ctx;
+
if (ctx->rasterizer && ctx->rasterizer->base.multisample)
batch->requirements |= PAN_REQ_MSAA;
}
void
-panfrost_batch_clear(struct panfrost_context *ctx,
- struct panfrost_batch *batch,
+panfrost_batch_clear(struct panfrost_batch *batch,
unsigned buffers,
const union pipe_color_union *color,
double depth, unsigned stencil)
-
{
+ struct panfrost_context *ctx = batch->ctx;
+
if (buffers & PIPE_CLEAR_COLOR) {
for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; ++i) {
if (!(buffers & (PIPE_CLEAR_COLOR0 << i)))
if (_mesa_set_search(batch->bos, rsc->bo)) {
printf("TODO: submit job for flush\n");
- //panfrost_batch_submit(panfrost, job);
+ //panfrost_batch_submit(job);
continue;
}
}
panfrost_create_batch(struct panfrost_context *ctx);
void
-panfrost_free_batch(struct panfrost_context *ctx,
- struct panfrost_batch *batch);
+panfrost_free_batch(struct panfrost_batch *batch);
struct panfrost_batch *
panfrost_get_batch(struct panfrost_context *ctx,
struct pipe_resource *prsc);
void
-panfrost_batch_submit(struct panfrost_context *ctx, struct panfrost_batch *batch);
+panfrost_batch_submit(struct panfrost_batch *batch);
void
-panfrost_batch_set_requirements(struct panfrost_context *ctx,
- struct panfrost_batch *batch);
+panfrost_batch_set_requirements(struct panfrost_batch *batch);
mali_ptr
panfrost_batch_get_polygon_list(struct panfrost_batch *batch, unsigned size);
void
-panfrost_batch_clear(struct panfrost_context *ctx,
- struct panfrost_batch *batch,
+panfrost_batch_clear(struct panfrost_batch *batch,
unsigned buffers,
const union pipe_color_union *color,
double depth, unsigned stencil);