diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index 69fe8e1e30f..b7160eb783d 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -310,7 +310,10 @@ static unsigned pan_bytes_per_pixel_tib(const struct panfrost_device *dev, enum pipe_format format) { - if (dev->blendable_formats[format].internal) { + const struct pan_blendable_format *bf = + GENX(panfrost_blendable_format_from_pipe_format)(format); + + if (bf->internal) { /* Blendable formats are always 32-bits in the tile buffer, * extra bits are used as padding or to dither */ return 4; @@ -407,7 +410,8 @@ pan_rt_init_format(const struct panfrost_device *dev, if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) cfg->srgb = true; - struct pan_blendable_format fmt = dev->blendable_formats[rt->format]; + struct pan_blendable_format fmt = + *GENX(panfrost_blendable_format_from_pipe_format)(rt->format); if (fmt.internal) { cfg->internal_format = fmt.internal; @@ -859,7 +863,9 @@ GENX(pan_emit_fbd)(const struct panfrost_device *dev, panfrost_invert_swizzle(desc->swizzle, swizzle); cfg.swizzle = panfrost_translate_swizzle_4(swizzle); - struct pan_blendable_format fmt = dev->blendable_formats[rt->format]; + struct pan_blendable_format fmt = + *GENX(panfrost_blendable_format_from_pipe_format)(rt->format); + if (fmt.internal) { cfg.internal_format = fmt.internal; cfg.color_writeback_format = fmt.writeback; diff --git a/src/panfrost/lib/pan_format.h b/src/panfrost/lib/pan_format.h index 407be7a6b5f..138555f3504 100644 --- a/src/panfrost/lib/pan_format.h +++ b/src/panfrost/lib/pan_format.h @@ -55,6 +55,7 @@ struct pan_blendable_format { mali_pixel_format bifrost[2]; }; +#define panfrost_blendable_formats_v4 panfrost_blendable_formats_v5 extern const struct pan_blendable_format panfrost_blendable_formats_v5[PIPE_FORMAT_COUNT]; extern const struct pan_blendable_format @@ -63,6 +64,7 @@ extern const struct pan_blendable_format panfrost_blendable_formats_v7[PIPE_FORMAT_COUNT]; extern const struct pan_blendable_format panfrost_blendable_formats_v9[PIPE_FORMAT_COUNT]; +#define panfrost_blendable_formats_v10 panfrost_blendable_formats_v9 #define panfrost_pipe_format_v4 panfrost_pipe_format_v5 extern const struct panfrost_format panfrost_pipe_format_v5[PIPE_FORMAT_COUNT]; @@ -157,6 +159,12 @@ GENX(panfrost_format_from_pipe_format)(enum pipe_format f) { return &GENX(panfrost_pipe_format)[f]; } + +static inline const struct pan_blendable_format * +GENX(panfrost_blendable_format_from_pipe_format)(enum pipe_format f) +{ + return &GENX(panfrost_blendable_formats)[f]; +} #endif #endif