[Mesa-dev] [PATCH 1/2] freedreno: a2xx: fix crash on first clear

Rob Clark robdclark at gmail.com
Wed Jun 20 13:56:37 UTC 2018


On Tue, Jun 19, 2018 at 9:02 PM, Jonathan Marek <jonathan at marek.ca> wrote:
> blend can be NULL, so check for that

hmm, which case are you hitting that?  From a quick look I think
a3xx-a5xx would have the same issue.  Maybe we should just init
ctx->blend to a dummy state obj when the ctx is created?

BR,
-R

>
> Signed-off-by: Jonathan Marek <jonathan at marek.ca>
> ---
>  src/gallium/drivers/freedreno/a2xx/fd2_emit.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c
> index 9c765dfd88..e36eebf98c 100644
> --- a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c
> +++ b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c
> @@ -303,7 +303,7 @@ fd2_emit_state(struct fd_context *ctx, const enum fd_dirty_3d_state dirty)
>         if (dirty & (FD_DIRTY_BLEND | FD_DIRTY_ZSA)) {
>                 OUT_PKT3(ring, CP_SET_CONSTANT, 2);
>                 OUT_RING(ring, CP_REG(REG_A2XX_RB_COLORCONTROL));
> -               OUT_RING(ring, zsa->rb_colorcontrol | blend->rb_colorcontrol);
> +               OUT_RING(ring, blend ? zsa->rb_colorcontrol | blend->rb_colorcontrol : 0);
>         }
>
>         if (dirty & (FD_DIRTY_BLEND | FD_DIRTY_FRAMEBUFFER)) {
> @@ -313,13 +313,13 @@ fd2_emit_state(struct fd_context *ctx, const enum fd_dirty_3d_state dirty)
>
>                 OUT_PKT3(ring, CP_SET_CONSTANT, 2);
>                 OUT_RING(ring, CP_REG(REG_A2XX_RB_BLEND_CONTROL));
> -               OUT_RING(ring, blend->rb_blendcontrol_alpha |
> +               OUT_RING(ring, blend ? blend->rb_blendcontrol_alpha |
>                         COND(has_alpha, blend->rb_blendcontrol_rgb) |
> -                       COND(!has_alpha, blend->rb_blendcontrol_no_alpha_rgb));
> +                       COND(!has_alpha, blend->rb_blendcontrol_no_alpha_rgb) : 0);
>
>                 OUT_PKT3(ring, CP_SET_CONSTANT, 2);
>                 OUT_RING(ring, CP_REG(REG_A2XX_RB_COLOR_MASK));
> -               OUT_RING(ring, blend->rb_colormask);
> +               OUT_RING(ring, blend ? blend->rb_colormask : 0xf);
>         }
>
>         if (dirty & FD_DIRTY_BLEND_COLOR) {
> --
> 2.17.1
>


More information about the mesa-dev mailing list