diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 7516e67f51b..54f6b706422 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -190,8 +190,8 @@ panfrost_create_sampler_state(struct pipe_context *pctx, struct panfrost_sampler_state *so = CALLOC_STRUCT(panfrost_sampler_state); so->base = *cso; -#if PAN_ARCH == 7 - /* On v7, pan_texture.c composes the API swizzle with a bijective +#if PAN_ARCH == 7 || PAN_ARCH >= 10 + /* On v7 and v10+, pan_texture.c composes the API swizzle with a bijective * swizzle derived from the format, to allow more formats than the * hardware otherwise supports. When packing border colours, we need to * undo this bijection, by swizzling with its inverse. diff --git a/src/panfrost/lib/meson.build b/src/panfrost/lib/meson.build index 8163af1736b..719ef0e4e76 100644 --- a/src/panfrost/lib/meson.build +++ b/src/panfrost/lib/meson.build @@ -5,7 +5,7 @@ subdir('genxml') subdir('kmod') -pixel_format_versions = ['5', '6', '7', '9'] +pixel_format_versions = ['5', '6', '7', '9', '10'] libpanfrost_pixel_format = [] foreach ver : pixel_format_versions diff --git a/src/panfrost/lib/pan_format.c b/src/panfrost/lib/pan_format.c index e75d8cd7af8..c5cccee8993 100644 --- a/src/panfrost/lib/pan_format.c +++ b/src/panfrost/lib/pan_format.c @@ -599,7 +599,7 @@ const struct panfrost_format GENX(panfrost_pipe_format)[PIPE_FORMAT_COUNT] = { }; /* clang-format on */ -#if PAN_ARCH == 7 +#if PAN_ARCH == 7 || PAN_ARCH >= 10 /* * Decompose a component ordering swizzle into a component ordering (applied * first) and a swizzle (applied second). The output ordering "pre" is allowed diff --git a/src/panfrost/lib/pan_format.h b/src/panfrost/lib/pan_format.h index 35b2f35f00a..ffb3d9a78ab 100644 --- a/src/panfrost/lib/pan_format.h +++ b/src/panfrost/lib/pan_format.h @@ -64,7 +64,8 @@ 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 +extern const struct pan_blendable_format + panfrost_blendable_formats_v10[PIPE_FORMAT_COUNT]; static inline const struct pan_blendable_format * panfrost_blendable_format_table(unsigned arch) @@ -89,7 +90,7 @@ 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]; -#define panfrost_pipe_format_v10 panfrost_pipe_format_v9 +extern const struct panfrost_format panfrost_pipe_format_v10[PIPE_FORMAT_COUNT]; static inline const struct panfrost_format * panfrost_format_table(unsigned arch) @@ -132,7 +133,7 @@ panfrost_get_default_swizzle(unsigned components) } } -#if PAN_ARCH == 7 +#if PAN_ARCH == 7 || PAN_ARCH >= 10 struct pan_decomposed_swizzle { /* Component ordering to apply first */ enum mali_rgb_component_order pre; diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c index db43a0d2510..a845c033eb6 100644 --- a/src/panfrost/lib/pan_texture.c +++ b/src/panfrost/lib/pan_texture.c @@ -619,11 +619,13 @@ GENX(panfrost_new_texture)(const struct pan_image_view *iview, void *out, }; util_format_compose_swizzles(replicate_x, iview->swizzle, swizzle); - } else if (PAN_ARCH == 7 && !panfrost_format_is_yuv(format)) { -#if PAN_ARCH == 7 + } else if ((PAN_ARCH == 7 || PAN_ARCH == 10) && + !panfrost_format_is_yuv(format)) { +#if PAN_ARCH == 7 || PAN_ARCH >= 10 /* v7 (only) restricts component orders when AFBC is in use. * Rather than restrict AFBC, we use an allowed component order * with an invertible swizzle composed. + * v10 has the same restriction, but on AFRC formats. */ enum mali_rgb_component_order orig = mali_format & BITFIELD_MASK(12); struct pan_decomposed_swizzle decomposed =