panfrost: Add support for INTEL_blackhole_render

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8607>
This commit is contained in:
Icecream95 2021-01-21 16:22:35 +13:00 committed by Marge Bot
parent 96d7555770
commit f55649d20b
4 changed files with 16 additions and 1 deletions

View file

@ -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;

View file

@ -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 */

View file

@ -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) {

View file

@ -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: