diff --git a/src/freedreno/ci/freedreno-a618-fails.txt b/src/freedreno/ci/freedreno-a618-fails.txt index 887c7e0f43d..61235890ffa 100644 --- a/src/freedreno/ci/freedreno-a618-fails.txt +++ b/src/freedreno/ci/freedreno-a618-fails.txt @@ -229,6 +229,10 @@ spec@arb_base_instance@arb_base_instance-drawarrays,Fail spec@ext_base_instance@arb_base_instance-baseinstance-doesnt-affect-gl-instance-id_gles3,Fail spec@ext_base_instance@arb_base_instance-drawarrays_gles3,Fail +# Bad assumptions in piglit about layout of multiplanar formats, +# it should use separate buffers per plane: +spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yvu420,Fail + # glcts update dEQP-GLES2.functional.texture.mipmap.cube.projected.nearest_linear,Fail KHR-GL46.texture_view.view_classes,Fail diff --git a/src/freedreno/ci/freedreno-a630-fails.txt b/src/freedreno/ci/freedreno-a630-fails.txt index 31afea68030..efa776e6a54 100644 --- a/src/freedreno/ci/freedreno-a630-fails.txt +++ b/src/freedreno/ci/freedreno-a630-fails.txt @@ -222,6 +222,10 @@ spec@arb_occlusion_query@occlusion_query_order,Fail spec@khr_texture_compression_astc@miptree-gles srgb-fp,Fail spec@khr_texture_compression_astc@miptree-gles srgb-fp@sRGB decode full precision,Fail +# Bad assumptions in piglit about layout of multiplanar formats, +# it should use separate buffers per plane: +spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yvu420,Fail + # glcts update dEQP-GLES2.functional.texture.mipmap.cube.projected.nearest_linear,Fail KHR-GLES3.framebuffer_blit.framebuffer_blit_functionality_multisampled_to_singlesampled_blit,Fail diff --git a/src/freedreno/ci/freedreno-a660-fails.txt b/src/freedreno/ci/freedreno-a660-fails.txt index be552045a43..293d3196fb1 100644 --- a/src/freedreno/ci/freedreno-a660-fails.txt +++ b/src/freedreno/ci/freedreno-a660-fails.txt @@ -21,6 +21,10 @@ dEQP-VK.dynamic_rendering.primary_cmd_buff.local_read.max_input_attachments,Fail gmem-dEQP-VK.dynamic_rendering.primary_cmd_buff.local_read.input_attachments_without_mapping,Fail gmem-dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.uniform_32struct_to_16struct.uniform_geom,Fail +# Bad assumptions in piglit about layout of multiplanar formats, +# it should use separate buffers per plane: +spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yvu420,Fail + # OpenCL tests below # ## rusticl-core issues: diff --git a/src/freedreno/ci/freedreno-a750-fails.txt b/src/freedreno/ci/freedreno-a750-fails.txt index d66334b9544..2aae50b3dac 100644 --- a/src/freedreno/ci/freedreno-a750-fails.txt +++ b/src/freedreno/ci/freedreno-a750-fails.txt @@ -31,6 +31,10 @@ dynamic-dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_u dynamic-dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.compatibility_depth_zero_stencil_zero_testing_stencil,Fail dynamic-dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_stencil,Fail +# Bad assumptions in piglit about layout of multiplanar formats, +# it should use separate buffers per plane: +spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yvu420,Fail + # New fails in 1.3.10.0 dEQP-VK.dynamic_rendering.primary_cmd_buff.local_read.max_input_attachments,Fail diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_resource.cc b/src/gallium/drivers/freedreno/a6xx/fd6_resource.cc index 22d2621544d..ddd0fd492ad 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.cc +++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.cc @@ -278,7 +278,8 @@ fd6_layout_resource(struct fd_resource *rsc, enum fd_layout_type type) } static bool -fill_ubwc_buffer_sizes(struct fd_resource *rsc, struct winsys_handle *handle) +layout_resource_for_handle(struct fd_resource *rsc, struct winsys_handle *handle, + bool ubwc, unsigned tile_mode) { struct pipe_resource *prsc = &rsc->b.b; struct fd_screen *screen = fd_screen(prsc->screen); @@ -287,10 +288,10 @@ fill_ubwc_buffer_sizes(struct fd_resource *rsc, struct winsys_handle *handle) .pitch = handle->stride, }; - if (!can_do_ubwc(prsc)) + if (ubwc && !can_do_ubwc(prsc)) return false; - struct fdl_image_params params = fd_image_params(prsc, true, TILE6_3); + struct fdl_image_params params = fd_image_params(prsc, ubwc, tile_mode); if (!fdl6_layout_image(&rsc->layout, screen->info, ¶ms, &l)) return false; @@ -304,29 +305,22 @@ fill_ubwc_buffer_sizes(struct fd_resource *rsc, struct winsys_handle *handle) static bool fd6_layout_resource_for_handle(struct fd_resource *rsc, struct winsys_handle *handle) { - switch (handle->modifier) { + uint64_t modifier = handle->modifier; + + switch (modifier) { case DRM_FORMAT_MOD_QCOM_COMPRESSED: - return fill_ubwc_buffer_sizes(rsc, handle); + return layout_resource_for_handle(rsc, handle, true, TILE6_3); case DRM_FORMAT_MOD_LINEAR: - if (can_do_ubwc(&rsc->b.b)) { - perf_debug("%" PRSC_FMT - ": not UBWC: imported with DRM_FORMAT_MOD_LINEAR!", - PRSC_ARGS(&rsc->b.b)); - } - return true; - case DRM_FORMAT_MOD_QCOM_TILED3: - rsc->layout.tile_mode = fd6_tile_mode(&rsc->b.b); - FALLTHROUGH; case DRM_FORMAT_MOD_INVALID: - /* For now, without buffer metadata, we must assume that buffers - * imported with INVALID modifier are linear - */ if (can_do_ubwc(&rsc->b.b)) { - perf_debug("%" PRSC_FMT - ": not UBWC: imported with DRM_FORMAT_MOD_INVALID!", - PRSC_ARGS(&rsc->b.b)); + const char *mod_name = + (modifier == DRM_FORMAT_MOD_LINEAR) ? "LINEAR" : "INVALID"; + perf_debug("%" PRSC_FMT ": not UBWC: imported with DRM_FORMAT_MOD_%s!", + PRSC_ARGS(&rsc->b.b), mod_name); } - return true; + return layout_resource_for_handle(rsc, handle, false, TILE6_LINEAR); + case DRM_FORMAT_MOD_QCOM_TILED3: + return layout_resource_for_handle(rsc, handle, false, TILE6_3); default: return false; }