Mesa (master): panfrost: Add support for INTEL_blackhole_render
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jan 22 06:41:51 UTC 2021
Module: Mesa
Branch: master
Commit: f55649d20b4b0263245f047db6239a46890e04a4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f55649d20b4b0263245f047db6239a46890e04a4
Author: Icecream95 <ixn at disroot.org>
Date: Thu Jan 21 16:22:35 2021 +1300
panfrost: Add support for INTEL_blackhole_render
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8607>
---
src/gallium/drivers/panfrost/pan_context.c | 9 +++++++++
src/gallium/drivers/panfrost/pan_context.h | 2 ++
src/gallium/drivers/panfrost/pan_job.c | 5 ++++-
src/gallium/drivers/panfrost/pan_screen.c | 1 +
4 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 54a279ec35d..f8570149ee8 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -185,6 +185,14 @@ panfrost_texture_barrier(struct pipe_context *pipe, unsigned flags)
panfrost_flush_all_batches(ctx);
}
+static void
+panfrost_set_frontend_noop(struct pipe_context *pipe, bool enable)
+{
+ struct panfrost_context *ctx = pan_context(pipe);
+ panfrost_flush_all_batches(ctx);
+ ctx->is_noop = enable;
+}
+
#define DEFINE_CASE(c) case PIPE_PRIM_##c: return MALI_DRAW_MODE_##c;
static int
@@ -1583,6 +1591,7 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
gallium->clear = panfrost_clear;
gallium->draw_vbo = panfrost_draw_vbo;
gallium->texture_barrier = panfrost_texture_barrier;
+ gallium->set_frontend_noop = panfrost_set_frontend_noop;
gallium->set_vertex_buffers = panfrost_set_vertex_buffers;
gallium->set_constant_buffer = panfrost_set_constant_buffer;
diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index a65442a88bb..39ee2186418 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -181,6 +181,8 @@ struct panfrost_context {
struct panfrost_query *cond_query;
bool cond_cond;
enum pipe_render_cond_flag cond_mode;
+
+ bool is_noop;
};
/* Corresponds to the CSO */
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 301ce459b21..32f3ff2bbdf 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -983,7 +983,10 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
bo_handles[submit.bo_handle_count++] = dev->tiler_heap->gem_handle;
submit.bo_handles = (u64) (uintptr_t) bo_handles;
- ret = drmIoctl(dev->fd, DRM_IOCTL_PANFROST_SUBMIT, &submit);
+ if (ctx->is_noop)
+ ret = 0;
+ else
+ ret = drmIoctl(dev->fd, DRM_IOCTL_PANFROST_SUBMIT, &submit);
free(bo_handles);
if (ret) {
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 83c23bfe026..49d2f1eb8d8 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -116,6 +116,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_DEPTH_CLIP_DISABLE_SEPARATE:
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
+ case PIPE_CAP_FRONTEND_NOOP:
return 1;
case PIPE_CAP_MAX_RENDER_TARGETS:
More information about the mesa-commit
mailing list