From c5ba55314cb3187dd4cc115002bbc14a086d1547 Mon Sep 17 00:00:00 2001 From: Ray Smith Date: Wed, 10 Jan 2024 17:00:37 +0000 Subject: [PATCH] panfrost: Fix format tables for v4 and v5 pan_format.c was only being built with PAN_ARCH in [6, 7, 9], but has conditional compilation for PAN_ARCH <= 5 which never got compiled. Signed-off-by: Ray Smith Part-of: --- src/panfrost/lib/meson.build | 2 +- src/panfrost/lib/pan_format.h | 3 +++ src/panfrost/lib/pan_props.c | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/panfrost/lib/meson.build b/src/panfrost/lib/meson.build index 12b927a2973..e729981cdc9 100644 --- a/src/panfrost/lib/meson.build +++ b/src/panfrost/lib/meson.build @@ -22,7 +22,7 @@ subdir('genxml') subdir('kmod') -pixel_format_versions = ['6', '7', '9'] +pixel_format_versions = ['5', '6', '7', '9'] libpanfrost_pixel_format = [] foreach ver : pixel_format_versions diff --git a/src/panfrost/lib/pan_format.h b/src/panfrost/lib/pan_format.h index 3f1eb4f2610..8e90b2e25b2 100644 --- a/src/panfrost/lib/pan_format.h +++ b/src/panfrost/lib/pan_format.h @@ -55,12 +55,15 @@ struct pan_blendable_format { mali_pixel_format bifrost[2]; }; +extern const struct pan_blendable_format + panfrost_blendable_formats_v5[PIPE_FORMAT_COUNT]; extern const struct pan_blendable_format panfrost_blendable_formats_v6[PIPE_FORMAT_COUNT]; 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]; +extern const struct panfrost_format panfrost_pipe_format_v5[PIPE_FORMAT_COUNT]; extern const struct panfrost_format panfrost_pipe_format_v6[PIPE_FORMAT_COUNT]; extern const struct panfrost_format panfrost_pipe_format_v7[PIPE_FORMAT_COUNT]; extern const struct panfrost_format panfrost_pipe_format_v9[PIPE_FORMAT_COUNT]; diff --git a/src/panfrost/lib/pan_props.c b/src/panfrost/lib/pan_props.c index b3fcf606d3b..4a1912b099d 100644 --- a/src/panfrost/lib/pan_props.c +++ b/src/panfrost/lib/pan_props.c @@ -250,7 +250,10 @@ panfrost_open_device(void *memctx, int fd, struct panfrost_device *dev) dev->tiler_features = panfrost_query_tiler_features(dev); dev->has_afbc = panfrost_query_afbc(dev, dev->arch); - if (dev->arch <= 6) { + if (dev->arch <= 5) { + dev->formats = panfrost_pipe_format_v5; + dev->blendable_formats = panfrost_blendable_formats_v5; + } else if (dev->arch == 6) { dev->formats = panfrost_pipe_format_v6; dev->blendable_formats = panfrost_blendable_formats_v6; } else if (dev->arch <= 7) {