panfrost: Get rid of the mali_xxx enum redefinitions

The gen_macros.h header should include the common header file when
PAN_ARCH is undefined, thus making those redefinitions useless.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12551>
This commit is contained in:
Boris Brezillon 2021-08-06 12:30:04 +02:00
parent 13c13efcac
commit 5f3910a343
3 changed files with 7 additions and 38 deletions

View file

@ -23,6 +23,8 @@
*
*/
#include "gen_macros.h"
#include <string.h>
#include "pan_util.h"
#include "pan_format.h"
@ -70,18 +72,6 @@ float_to_fixed(float f, unsigned bits_int, unsigned bits_frac, bool dither)
}
}
/* These values are shared across hardware versions. Don't include GenXML. */
enum mali_color_buffer_internal_format {
MALI_COLOR_BUFFER_INTERNAL_FORMAT_RAW = 0,
MALI_COLOR_BUFFER_INTERNAL_FORMAT_R8G8B8A8 = 1,
MALI_COLOR_BUFFER_INTERNAL_FORMAT_R10G10B10A2 = 2,
MALI_COLOR_BUFFER_INTERNAL_FORMAT_R8G8B8A2 = 3,
MALI_COLOR_BUFFER_INTERNAL_FORMAT_R4G4B4A4 = 4,
MALI_COLOR_BUFFER_INTERNAL_FORMAT_R5G6B5A0 = 5,
MALI_COLOR_BUFFER_INTERNAL_FORMAT_R5G5B5A1 = 6,
MALI_COLOR_BUFFER_NUM_FORMATS,
};
struct mali_tib_layout {
unsigned int_r, frac_r;
unsigned int_g, frac_g;
@ -89,7 +79,7 @@ struct mali_tib_layout {
unsigned int_a, frac_a;
};
static const struct mali_tib_layout tib_layouts[MALI_COLOR_BUFFER_NUM_FORMATS] = {
static const struct mali_tib_layout tib_layouts[] = {
[MALI_COLOR_BUFFER_INTERNAL_FORMAT_R8G8B8A8] = { 8, 0, 8, 0, 8, 0, 8, 0 },
[MALI_COLOR_BUFFER_INTERNAL_FORMAT_R10G10B10A2] = { 10, 0, 10, 0, 10, 0, 2, 0 },
[MALI_COLOR_BUFFER_INTERNAL_FORMAT_R8G8B8A2] = { 8, 2, 8, 2, 8, 2, 2, 0 },
@ -132,7 +122,7 @@ pan_pack_color(uint32_t *packed, const union pipe_color_union *color,
enum mali_color_buffer_internal_format internal =
panfrost_blendable_formats_v7[format].internal;
if (internal == MALI_COLOR_BUFFER_INTERNAL_FORMAT_RAW) {
if (internal == MALI_COLOR_BUFFER_INTERNAL_FORMAT_RAW_VALUE) {
pan_pack_raw(packed, color, format);
return;
}
@ -155,7 +145,7 @@ pan_pack_color(uint32_t *packed, const union pipe_color_union *color,
}
/* Look up the layout of the tilebuffer */
assert(internal < MALI_COLOR_BUFFER_NUM_FORMATS);
assert(internal < ARRAY_SIZE(tib_layouts));
struct mali_tib_layout l = tib_layouts[internal];
unsigned count_r = l.int_r + l.frac_r;

View file

@ -28,6 +28,8 @@
#ifndef __PAN_FORMAT_H
#define __PAN_FORMAT_H
#include "gen_macros.h"
#include "util/format/u_format.h"
/* Formats */
@ -53,18 +55,6 @@ extern const struct panfrost_format panfrost_pipe_format_v6[PIPE_FORMAT_COUNT];
extern const struct panfrost_format panfrost_pipe_format_v7[PIPE_FORMAT_COUNT];
/* Helpers to construct swizzles */
#ifndef PAN_PACK_H
/* Avoid the GenXML dependence */
enum mali_channel {
MALI_CHANNEL_R = 0,
MALI_CHANNEL_G = 1,
MALI_CHANNEL_B = 2,
MALI_CHANNEL_A = 3,
MALI_CHANNEL_0 = 4,
MALI_CHANNEL_1 = 5,
};
#endif
#define PAN_V6_SWIZZLE(R, G, B, A) ( \
((MALI_CHANNEL_ ## R) << 0) | \

View file

@ -83,17 +83,6 @@ enum pan_image_crc_mode {
PAN_IMAGE_CRC_OOB,
};
#ifndef PAN_PACK_H
/* Avoid the GenXML dependence */
enum mali_texture_dimension {
MALI_TEXTURE_DIMENSION_CUBE = 0,
MALI_TEXTURE_DIMENSION_1D = 1,
MALI_TEXTURE_DIMENSION_2D = 2,
MALI_TEXTURE_DIMENSION_3D = 3,
};
#endif
struct pan_image_layout {
uint64_t modifier;
enum pipe_format format;