mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-16 15:50:19 +01:00
panfrost: legalize afbc before blitting
If we legalize AFBC late, we end up in a situation while we might need to do a blit while inside a previous blit operation, but u_blitter state isn't saved recursively, and that leads to crashes. This patch solves this issue by splitting panfrost_blit into two functions and legalizing AFBC early. Signed-off-by: Italo Nicola <italonicola@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>
This commit is contained in:
parent
5027b5aa28
commit
17a62ff993
5 changed files with 28 additions and 91 deletions
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "util/format/u_format.h"
|
||||
#include "pan_context.h"
|
||||
#include "pan_resource.h"
|
||||
#include "pan_util.h"
|
||||
|
||||
void
|
||||
|
|
@ -79,6 +80,18 @@ panfrost_blitter_save(struct panfrost_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_blit_no_afbc_legalization(struct pipe_context *pipe,
|
||||
const struct pipe_blit_info *info)
|
||||
{
|
||||
struct panfrost_context *ctx = pan_context(pipe);
|
||||
|
||||
panfrost_blitter_save(ctx, info->render_condition_enable
|
||||
? PAN_RENDER_BLIT_COND
|
||||
: PAN_RENDER_BLIT);
|
||||
util_blitter_blit(ctx->blitter, info);
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_blit(struct pipe_context *pipe, const struct pipe_blit_info *info)
|
||||
{
|
||||
|
|
@ -91,11 +104,13 @@ panfrost_blit(struct pipe_context *pipe, const struct pipe_blit_info *info)
|
|||
unreachable("Unsupported blit\n");
|
||||
|
||||
/* Legalize here because it could trigger a recursive blit otherwise */
|
||||
pan_legalize_afbc_format(ctx, pan_resource(info->dst.resource),
|
||||
info->dst.format, true);
|
||||
struct panfrost_resource *src = pan_resource(info->src.resource);
|
||||
enum pipe_format src_view_format = util_format_linear(info->src.format);
|
||||
pan_legalize_afbc_format(ctx, src, src_view_format, false);
|
||||
|
||||
panfrost_blitter_save(ctx, info->render_condition_enable
|
||||
? PAN_RENDER_BLIT_COND
|
||||
: PAN_RENDER_BLIT);
|
||||
util_blitter_blit(ctx->blitter, info);
|
||||
struct panfrost_resource *dst = pan_resource(info->dst.resource);
|
||||
enum pipe_format dst_view_format = util_format_linear(info->dst.format);
|
||||
pan_legalize_afbc_format(ctx, dst, dst_view_format, true);
|
||||
|
||||
panfrost_blit_no_afbc_legalization(pipe, info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@
|
|||
#include "pan_jm.h"
|
||||
#include "pan_job.h"
|
||||
#include "pan_pool.h"
|
||||
#include "pan_resource.h"
|
||||
#include "pan_shader.h"
|
||||
#include "pan_texture.h"
|
||||
#include "pan_util.h"
|
||||
|
|
|
|||
|
|
@ -864,7 +864,7 @@ pan_blit_from_staging(struct pipe_context *pctx,
|
|||
blit.mask = util_format_get_mask(blit.src.format);
|
||||
blit.filter = PIPE_TEX_FILTER_NEAREST;
|
||||
|
||||
panfrost_blit(pctx, &blit);
|
||||
panfrost_blit_no_afbc_legalization(pctx, &blit);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -884,7 +884,7 @@ pan_blit_to_staging(struct pipe_context *pctx, struct panfrost_transfer *trans)
|
|||
blit.mask = util_format_get_mask(blit.dst.format);
|
||||
blit.filter = PIPE_TEX_FILTER_NEAREST;
|
||||
|
||||
panfrost_blit(pctx, &blit);
|
||||
panfrost_blit_no_afbc_legalization(pctx, &blit);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1342,7 +1342,7 @@ pan_resource_modifier_convert(struct panfrost_context *ctx,
|
|||
&blit.dst.box);
|
||||
blit.src.box = blit.dst.box;
|
||||
|
||||
panfrost_blit(&ctx->base, &blit);
|
||||
panfrost_blit_no_afbc_legalization(&ctx->base, &blit);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -197,4 +197,7 @@ void pan_legalize_afbc_format(struct panfrost_context *ctx,
|
|||
void pan_dump_resource(struct panfrost_context *ctx,
|
||||
struct panfrost_resource *rsc);
|
||||
|
||||
void panfrost_blit_no_afbc_legalization(struct pipe_context *pipe,
|
||||
const struct pipe_blit_info *info);
|
||||
|
||||
#endif /* PAN_RESOURCE_H */
|
||||
|
|
|
|||
|
|
@ -375,88 +375,6 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gl hdr,Fail
|
|||
spec@khr_texture_compression_astc@sliced-3d-miptree-gl hdr@HDR Profile,Fail
|
||||
spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp,Fail
|
||||
spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp@sRGB decode full precision,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_ALPHA/Destination: GL_ALPHA,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_ALPHA12/Destination: GL_ALPHA12,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_ALPHA16/Destination: GL_ALPHA16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_ALPHA8/Destination: GL_ALPHA8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_INTENSITY/Destination: GL_INTENSITY,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_INTENSITY8/Destination: GL_INTENSITY8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_LUMINANCE/Destination: GL_LUMINANCE,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_LUMINANCE12_ALPHA12/Destination: GL_LUMINANCE12_ALPHA12,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_LUMINANCE16_ALPHA16/Destination: GL_LUMINANCE16_ALPHA16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_LUMINANCE8/Destination: GL_LUMINANCE8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_LUMINANCE8_ALPHA8/Destination: GL_LUMINANCE8_ALPHA8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_LUMINANCE_ALPHA/Destination: GL_LUMINANCE_ALPHA,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_R16/Destination: GL_R16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_R16_SNORM/Destination: GL_R16_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_R32F/Destination: GL_R32F,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_R8/Destination: GL_R8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_R8_SNORM/Destination: GL_R8_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RED/Destination: GL_RED,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RG/Destination: GL_RG,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RG16/Destination: GL_RG16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RG16_SNORM/Destination: GL_RG16_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RG32F/Destination: GL_RG32F,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RG32I/Destination: GL_RG32I,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RG32UI/Destination: GL_RG32UI,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RG8/Destination: GL_RG8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RG8_SNORM/Destination: GL_RG8_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGB/Destination: GL_RGB,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGB16/Destination: GL_RGB16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGB32F/Destination: GL_RGB32F,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGB32I/Destination: GL_RGB32I,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGB32UI/Destination: GL_RGB32UI,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGB8/Destination: GL_RGB8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGBA/Destination: GL_RGBA,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGBA16/Destination: GL_RGBA16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGBA16_SNORM/Destination: GL_RGBA16_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGBA32F/Destination: GL_RGBA32F,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGBA32I/Destination: GL_RGBA32I,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGBA32UI/Destination: GL_RGBA32UI,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGBA8/Destination: GL_RGBA8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=2@Source: GL_RGBA8_SNORM/Destination: GL_RGBA8_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_ALPHA/Destination: GL_ALPHA,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_ALPHA12/Destination: GL_ALPHA12,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_ALPHA16/Destination: GL_ALPHA16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_ALPHA8/Destination: GL_ALPHA8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_INTENSITY/Destination: GL_INTENSITY,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_INTENSITY8/Destination: GL_INTENSITY8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_LUMINANCE/Destination: GL_LUMINANCE,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_LUMINANCE12_ALPHA12/Destination: GL_LUMINANCE12_ALPHA12,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_LUMINANCE16_ALPHA16/Destination: GL_LUMINANCE16_ALPHA16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_LUMINANCE8/Destination: GL_LUMINANCE8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_LUMINANCE8_ALPHA8/Destination: GL_LUMINANCE8_ALPHA8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_LUMINANCE_ALPHA/Destination: GL_LUMINANCE_ALPHA,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_R16/Destination: GL_R16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_R16_SNORM/Destination: GL_R16_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_R32F/Destination: GL_R32F,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_R8/Destination: GL_R8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_R8_SNORM/Destination: GL_R8_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RED/Destination: GL_RED,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RG/Destination: GL_RG,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RG16/Destination: GL_RG16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RG16_SNORM/Destination: GL_RG16_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RG32F/Destination: GL_RG32F,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RG32I/Destination: GL_RG32I,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RG32UI/Destination: GL_RG32UI,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RG8/Destination: GL_RG8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RG8_SNORM/Destination: GL_RG8_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGB/Destination: GL_RGB,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGB16/Destination: GL_RGB16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGB32F/Destination: GL_RGB32F,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGB32I/Destination: GL_RGB32I,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGB32UI/Destination: GL_RGB32UI,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGB8/Destination: GL_RGB8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA/Destination: GL_RGBA,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA16/Destination: GL_RGBA16,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA16_SNORM/Destination: GL_RGBA16_SNORM,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA32F/Destination: GL_RGBA32F,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA32I/Destination: GL_RGBA32I,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA32UI/Destination: GL_RGBA32UI,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA8/Destination: GL_RGBA8,Fail
|
||||
spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA8_SNORM/Destination: GL_RGBA8_SNORM,Fail
|
||||
spec@oes_texture_view@sampling-2d-array-as-cubemap,Crash
|
||||
spec@!opengl 1.0@gl-1.0-edgeflag-const,Fail
|
||||
spec@!opengl 1.0@gl-1.0-edgeflag,Fail
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue