static void
panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate,
- struct pipe_fence_handle **fence,
struct panfrost_batch *batch)
{
panfrost_batch_submit(batch);
/* If visual, we can stall a frame */
if (!flush_immediate)
- panfrost_drm_force_flush_fragment(ctx, fence);
+ panfrost_drm_force_flush_fragment(ctx);
ctx->last_fragment_flushed = false;
ctx->last_batch = batch;
/* If readback, flush now (hurts the pipelined performance) */
if (flush_immediate)
- panfrost_drm_force_flush_fragment(ctx, fence);
+ panfrost_drm_force_flush_fragment(ctx);
}
static void
bool flush_immediate = /*flags & PIPE_FLUSH_END_OF_FRAME*/true;
/* Submit the frame itself */
- panfrost_submit_frame(ctx, flush_immediate, fence, batch);
+ panfrost_submit_frame(ctx, flush_immediate, batch);
+
+ if (fence) {
+ struct panfrost_fence *f = panfrost_fence_create(ctx);
+ pipe->screen->fence_reference(pipe->screen, fence, NULL);
+ *fence = (struct pipe_fence_handle *)f;
+ }
/* Prepare for the next frame */
panfrost_invalidate_frame(ctx);
return ret;
}
-static struct panfrost_fence *
+struct panfrost_fence *
panfrost_fence_create(struct panfrost_context *ctx)
{
struct pipe_context *gallium = (struct pipe_context *) ctx;
}
void
-panfrost_drm_force_flush_fragment(struct panfrost_context *ctx,
- struct pipe_fence_handle **fence)
+panfrost_drm_force_flush_fragment(struct panfrost_context *ctx)
{
struct pipe_context *gallium = (struct pipe_context *) ctx;
struct panfrost_screen *screen = pan_screen(gallium->screen);
/* The job finished up, so we're safe to clean it up now */
panfrost_free_batch(ctx->last_batch);
}
-
- if (fence) {
- struct panfrost_fence *f = panfrost_fence_create(ctx);
- gallium->screen->fence_reference(gallium->screen, fence, NULL);
- *fence = (struct pipe_fence_handle *)f;
- }
}
unsigned
int
panfrost_drm_submit_vs_fs_batch(struct panfrost_batch *batch, bool has_draws);
void
-panfrost_drm_force_flush_fragment(struct panfrost_context *ctx,
- struct pipe_fence_handle **fence);
+panfrost_drm_force_flush_fragment(struct panfrost_context *ctx);
unsigned
panfrost_drm_query_gpu_version(struct panfrost_screen *screen);
int