summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_context.c
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2019-09-01 10:54:38 +0200
committerBoris Brezillon <[email protected]>2019-09-13 16:25:06 +0200
commite46d95d51bc11301b603f1beb9b1341b3623a46b (patch)
tree5e5ed06ae0bc02fd126aa18d0c038916dfb61617 /src/gallium/drivers/panfrost/pan_context.c
parent40e20324e0c304960b86f4721270e7c1d5379318 (diff)
panfrost: Allow testing if a specific batch is targeting a scanout FB
Rename panfrost_is_scanout() into panfrost_batch_is_scanout(), pass it a batch instead of a context and move the code to pan_job.c. With this in place, we can now test if a batch is targeting a scanout FB even if this batch is not bound to the context. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_context.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 0fb4c2584e4..35b36f501e2 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -151,24 +151,6 @@ panfrost_emit_mfbd(struct panfrost_context *ctx, unsigned vertex_count)
return framebuffer;
}
-/* Are we currently rendering to the screen (rather than an FBO)? */
-
-bool
-panfrost_is_scanout(struct panfrost_context *ctx)
-{
- /* If there is no color buffer, it's an FBO */
- if (ctx->pipe_framebuffer.nr_cbufs != 1)
- return false;
-
- /* If we're too early that no framebuffer was sent, it's scanout */
- if (!ctx->pipe_framebuffer.cbufs[0])
- return true;
-
- return ctx->pipe_framebuffer.cbufs[0]->texture->bind & PIPE_BIND_DISPLAY_TARGET ||
- ctx->pipe_framebuffer.cbufs[0]->texture->bind & PIPE_BIND_SCANOUT ||
- ctx->pipe_framebuffer.cbufs[0]->texture->bind & PIPE_BIND_SHARED;
-}
-
static void
panfrost_clear(
struct pipe_context *pipe,
@@ -2396,7 +2378,7 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
*/
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
- bool is_scanout = panfrost_is_scanout(ctx);
+ bool is_scanout = panfrost_batch_is_scanout(batch);
bool has_draws = batch->last_job.gpu;
/* Bail out early when the current and new states are the same. */