diff --git a/docs/drivers/lima.rst b/docs/drivers/lima.rst index dde1155e20d..b4e5a8f7e7f 100644 --- a/docs/drivers/lima.rst +++ b/docs/drivers/lima.rst @@ -57,6 +57,14 @@ These are some display drivers that have been tested with Lima: - Tiny DRM: ``tinydrm`` - Xilinx ZynqMP: ``zynqmp-dpsub`` +DRIconf variables +----------------- + +``lima_allow_fp16_rts`` + Expose support for FP16 render-targets. This has the side-effect of + dropping support for 4xMSAA, which unfortunately can't be supported + at the same time due to API and hardware restrictions. + Environment variables --------------------- diff --git a/src/gallium/drivers/lima/ci/lima-fails.txt b/src/gallium/drivers/lima/ci/lima-fails.txt index d096a8ed15a..7844dca9b4d 100644 --- a/src/gallium/drivers/lima/ci/lima-fails.txt +++ b/src/gallium/drivers/lima/ci/lima-fails.txt @@ -44,7 +44,6 @@ dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_nearest,Fail wayland-dEQP-EGL.functional.create_context.no_config,Fail wayland-dEQP-EGL.functional.image.modify.renderbuffer_depth16_renderbuffer_clear_depth,Fail -wayland-dEQP-EGL.functional.wide_color.window_fp16_default_colorspace,Fail wayland-dEQP-EGL.functional.wide_color.window_8888_colorspace_srgb,Fail wayland-dEQP-EGL.functional.wide_color.window_888_colorspace_srgb,Fail diff --git a/src/gallium/drivers/lima/driinfo_lima.h b/src/gallium/drivers/lima/driinfo_lima.h index 07e69ec3da9..b4480576866 100644 --- a/src/gallium/drivers/lima/driinfo_lima.h +++ b/src/gallium/drivers/lima/driinfo_lima.h @@ -1 +1,4 @@ /* lima specific driconf options */ +DRI_CONF_SECTION_MISCELLANEOUS + DRI_CONF_OPT_B(lima_allow_fp16_rts, false, "Allow using FP16 render-targets") +DRI_CONF_SECTION_END diff --git a/src/gallium/drivers/lima/lima_screen.c b/src/gallium/drivers/lima/lima_screen.c index 8657c18448c..d47fe51fe53 100644 --- a/src/gallium/drivers/lima/lima_screen.c +++ b/src/gallium/drivers/lima/lima_screen.c @@ -246,9 +246,14 @@ lima_screen_is_format_supported(struct pipe_screen *pscreen, if (!lima_format_pixel_supported(format)) return false; - /* multisample unsupported with half float target */ - if (sample_count > 1 && util_format_is_float(format)) - return false; + if (util_format_is_float(format)) { + if (!lima_screen(pscreen)->allow_fp16_rts) + return false; + + /* multisample unsupported with half float target */ + if (sample_count > 1) + return false; + } } if (usage & PIPE_BIND_DEPTH_STENCIL) { @@ -589,6 +594,9 @@ lima_screen_create(int fd, const struct pipe_screen_config *config, driParseConfigFiles(config->options, config->options_info, 0, "lima", NULL, NULL, NULL, 0, NULL, 0); + screen->allow_fp16_rts = driQueryOptionb(config->options, + "lima_allow_fp16_rts"); + if (!lima_screen_query_info(screen)) goto err_out0; diff --git a/src/gallium/drivers/lima/lima_screen.h b/src/gallium/drivers/lima/lima_screen.h index 5f76edd551a..76dedb99879 100644 --- a/src/gallium/drivers/lima/lima_screen.h +++ b/src/gallium/drivers/lima/lima_screen.h @@ -95,6 +95,7 @@ struct lima_screen { #define pp_buffer_size 0x1000 bool has_growable_heap_buffer; + bool allow_fp16_rts; struct disk_cache *disk_cache; };