From 5742493650e849259601fb5b3bd2367a8f39cc89 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 21 Apr 2021 18:04:34 +0200 Subject: [PATCH] panfrost: Only advertise INDIRECT_DRAW if the kernel supports HEAP BOs The indirect draw implementation uses a HEAP pool to allocate varyings. Don't advertise INDIRECT_DRAW if the kernel doesn't support allocating HEAP BOs. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_screen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 67d25e89951..014de6fbda7 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -104,6 +104,10 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param) /* Don't expose MRT related CAPs on GPUs that don't implement them */ bool has_mrt = !(dev->quirks & MIDGARD_SFBD); + /* Only kernel drivers >= 1.1 can allocate HEAP BOs */ + bool has_heap = dev->kernel_version->version_major > 1 || + dev->kernel_version->version_minor >= 1; + /* Bifrost is WIP */ switch (param) { case PIPE_CAP_NPOT_TEXTURES: @@ -304,7 +308,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param) return 0; case PIPE_CAP_DRAW_INDIRECT: - return is_deqp; + return has_heap && is_deqp; default: return u_pipe_screen_get_param_defaults(screen, param);