From f3ff1265ba79f6c8d1f39b3c8678578d0677913d Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 10 Nov 2020 09:57:24 +0100 Subject: [PATCH] panfrost: Fix Bifrost blend descriptor emission Format conversion only works if the num_comps field is set to 4, probably because the tile buffer always store those 4 components internally. Fixes: edd98aac3f16 ("panfrost: Add support for native wallpapering on Bifrost") Fixes: 8389976b7c09 ("panfrost: XML-ify the blend descriptors") Cc: 20.3 Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: (cherry picked from commit 35ae9408f2a6b2f6f307562e8adc33af95406f12) --- .gitlab-ci/deqp-panfrost-g52-fails.txt | 37 -------------------- .pick_status.json | 2 +- src/gallium/drivers/panfrost/pan_cmdstream.c | 5 ++- src/panfrost/lib/pan_blit.c | 2 +- 4 files changed, 6 insertions(+), 40 deletions(-) diff --git a/.gitlab-ci/deqp-panfrost-g52-fails.txt b/.gitlab-ci/deqp-panfrost-g52-fails.txt index ea20b358e8e..15c26d738e3 100644 --- a/.gitlab-ci/deqp-panfrost-g52-fails.txt +++ b/.gitlab-ci/deqp-panfrost-g52-fails.txt @@ -13,54 +13,17 @@ dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rg8,Fail dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb10_a2,Fail dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail dEQP-GLES2.functional.fbo.completeness.size.distinct,Fail -dEQP-GLES2.functional.fbo.render.color.blend_npot_rbo_rgb565,Fail -dEQP-GLES2.functional.fbo.render.color.blend_npot_rbo_rgb565_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.color.blend_npot_tex2d_rgb,Fail -dEQP-GLES2.functional.fbo.render.color.blend_npot_tex2d_rgb_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.color.blend_rbo_rgb565,Fail -dEQP-GLES2.functional.fbo.render.color.blend_rbo_rgb565_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.color.blend_tex2d_rgb,Fail -dEQP-GLES2.functional.fbo.render.color.blend_tex2d_rgb_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.texsubimage.between_render_tex2d_rgb,Fail dEQP-GLES2.functional.negative_api.shader.uniform_matrixfv_invalid_transpose,Fail dEQP-GLES2.functional.negative_api.texture.generatemipmap_zero_level_array_compressed,Fail dEQP-GLES2.functional.shaders.builtin_variable.fragcoord_xyz,Fail dEQP-GLES2.functional.shaders.random.all_features.fragment.88,Fail dEQP-GLES2.functional.shaders.texture_functions.vertex.texturecubelod,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_nicest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_non_square_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_non_square_nicest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_nicest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_non_square_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_non_square_nicest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_nicest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_non_square_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_non_square_nicest,Fail dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_linear,Fail dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_nearest,Fail dEQP-GLES2.functional.texture.mipmap.cube.bias.linear_linear,Fail dEQP-GLES2.functional.texture.mipmap.cube.bias.linear_nearest,Fail -dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_nicest,Fail -dEQP-GLES2.functional.texture.mipmap.cube.generate.l8_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.cube.generate.l8_nicest,Fail -dEQP-GLES2.functional.texture.mipmap.cube.generate.la88_fastest,Fail -dEQP-GLES2.functional.texture.mipmap.cube.generate.la88_nicest,Fail dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_linear,Fail dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_nearest,Fail -dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.2d_alpha,Fail -dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.cube_alpha,Fail -dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_alpha,Fail -dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_alpha,Fail dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_linear_clamp,Fail dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_linear_mirror,Fail dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_nearest_clamp,Fail diff --git a/.pick_status.json b/.pick_status.json index 95aa3b4915b..3352fa63c99 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1471,7 +1471,7 @@ "description": "panfrost: Fix Bifrost blend descriptor emission", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "edd98aac3f16f216fa157f031f4c10fc294e7c8e" }, diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 0653db31c2b..9d043211f70 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -296,7 +296,10 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch, else cfg.bifrost.internal.mode = MALI_BIFROST_BLEND_MODE_FIXED_FUNCTION; - cfg.bifrost.internal.fixed_function.num_comps = format_desc->nr_channels; + /* If we want the conversion to work properly, + * num_comps must be set to 4 + */ + cfg.bifrost.internal.fixed_function.num_comps = 4; cfg.bifrost.internal.fixed_function.conversion.memory_format.format = panfrost_format_to_bifrost_blend(format_desc, true); if (dev->quirks & HAS_SWIZZLES) { diff --git a/src/panfrost/lib/pan_blit.c b/src/panfrost/lib/pan_blit.c index c16e4d6552e..bfac3b4be8b 100644 --- a/src/panfrost/lib/pan_blit.c +++ b/src/panfrost/lib/pan_blit.c @@ -569,7 +569,7 @@ bifrost_load_emit_blend_rt(struct pan_pool *pool, void *out, cfg.bifrost.equation.alpha.b = MALI_BLEND_OPERAND_B_SRC; cfg.bifrost.equation.alpha.c = MALI_BLEND_OPERAND_C_ZERO; cfg.bifrost.equation.color_mask = 0xf; - cfg.bifrost.internal.fixed_function.num_comps = format_desc->nr_channels; + cfg.bifrost.internal.fixed_function.num_comps = 4; cfg.bifrost.internal.fixed_function.conversion.memory_format.format = panfrost_format_to_bifrost_blend(format_desc, true); cfg.bifrost.internal.fixed_function.conversion.register_format =