intel/decoder: constify functions not modifying instructions/fields
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27270>
This commit is contained in:

committed by
Marge Bot

parent
8318bef289
commit
7bd4b537fe
@@ -92,7 +92,7 @@ intel_batch_decode_ctx_finish(struct intel_batch_decode_ctx *ctx)
|
||||
|
||||
static void
|
||||
ctx_print_group(struct intel_batch_decode_ctx *ctx,
|
||||
struct intel_group *group,
|
||||
const struct intel_group *group,
|
||||
uint64_t address, const void *map)
|
||||
{
|
||||
intel_print_group(ctx->fp, group, address, map, 0,
|
||||
|
@@ -1075,7 +1075,7 @@ intel_group_get_length(const struct intel_group *group, const uint32_t *p)
|
||||
}
|
||||
|
||||
static const char *
|
||||
intel_get_enum_name(struct intel_enum *e, uint64_t value)
|
||||
intel_get_enum_name(const struct intel_enum *e, uint64_t value)
|
||||
{
|
||||
for (int i = 0; i < e->nvalues; i++) {
|
||||
if (e->values[i]->value == value) {
|
||||
@@ -1356,7 +1356,7 @@ iter_decode_field(struct intel_field_iterator *iter)
|
||||
|
||||
void
|
||||
intel_field_iterator_init(struct intel_field_iterator *iter,
|
||||
struct intel_group *group,
|
||||
const struct intel_group *group,
|
||||
const uint32_t *p, int p_bit,
|
||||
bool print_colors)
|
||||
{
|
||||
@@ -1412,7 +1412,7 @@ print_dword_header(FILE *outfile,
|
||||
}
|
||||
|
||||
bool
|
||||
intel_field_is_header(struct intel_field *field)
|
||||
intel_field_is_header(const struct intel_field *field)
|
||||
{
|
||||
uint32_t bits;
|
||||
|
||||
@@ -1428,7 +1428,8 @@ intel_field_is_header(struct intel_field *field)
|
||||
}
|
||||
|
||||
void
|
||||
intel_print_group_custom_spacing(FILE *outfile, struct intel_group *group, uint64_t offset,
|
||||
intel_print_group_custom_spacing(FILE *outfile,
|
||||
const struct intel_group *group, uint64_t offset,
|
||||
const uint32_t *p, int p_bit, bool color,
|
||||
const char *spacing_reg, const char *spacing_dword)
|
||||
{
|
||||
@@ -1456,7 +1457,8 @@ intel_print_group_custom_spacing(FILE *outfile, struct intel_group *group, uint6
|
||||
}
|
||||
|
||||
void
|
||||
intel_print_group(FILE *outfile, struct intel_group *group, uint64_t offset,
|
||||
intel_print_group(FILE *outfile,
|
||||
const struct intel_group *group, uint64_t offset,
|
||||
const uint32_t *p, int p_bit, bool color)
|
||||
{
|
||||
const char *spacing_reg = " ";
|
||||
|
@@ -71,14 +71,14 @@ uint32_t intel_group_get_opcode(const struct intel_group *group);
|
||||
struct intel_field *intel_group_find_field(struct intel_group *group, const char *name);
|
||||
struct intel_enum *intel_spec_find_enum(struct intel_spec *spec, const char *name);
|
||||
|
||||
bool intel_field_is_header(struct intel_field *field);
|
||||
bool intel_field_is_header(const struct intel_field *field);
|
||||
|
||||
/* Only allow 5 levels of subgroup'ing
|
||||
*/
|
||||
#define DECODE_MAX_ARRAY_DEPTH 5
|
||||
|
||||
struct intel_field_iterator {
|
||||
struct intel_group *group;
|
||||
const struct intel_group *group;
|
||||
char name[128];
|
||||
char value[128];
|
||||
uint64_t raw_value;
|
||||
@@ -89,12 +89,12 @@ struct intel_field_iterator {
|
||||
int start_bit; /**< current field starts at this bit offset into p */
|
||||
int end_bit; /**< current field ends at this bit offset into p */
|
||||
|
||||
struct intel_field *fields[DECODE_MAX_ARRAY_DEPTH];
|
||||
struct intel_group *groups[DECODE_MAX_ARRAY_DEPTH];
|
||||
const struct intel_field *fields[DECODE_MAX_ARRAY_DEPTH];
|
||||
const struct intel_group *groups[DECODE_MAX_ARRAY_DEPTH];
|
||||
int array_iter[DECODE_MAX_ARRAY_DEPTH];
|
||||
int level;
|
||||
|
||||
struct intel_field *field;
|
||||
const struct intel_field *field;
|
||||
bool print_colors;
|
||||
};
|
||||
|
||||
@@ -196,19 +196,20 @@ struct intel_field {
|
||||
};
|
||||
|
||||
void intel_field_iterator_init(struct intel_field_iterator *iter,
|
||||
struct intel_group *group,
|
||||
const struct intel_group *group,
|
||||
const uint32_t *p, int p_bit,
|
||||
bool print_colors);
|
||||
|
||||
bool intel_field_iterator_next(struct intel_field_iterator *iter);
|
||||
|
||||
void intel_print_group_custom_spacing(FILE *outfile, struct intel_group *group,
|
||||
void intel_print_group_custom_spacing(FILE *outfile,
|
||||
const struct intel_group *group,
|
||||
uint64_t offset, const uint32_t *p,
|
||||
int p_bit, bool color,
|
||||
const char *spacing_reg,
|
||||
const char *spacing_dword);
|
||||
void intel_print_group(FILE *out,
|
||||
struct intel_group *group,
|
||||
const struct intel_group *group,
|
||||
uint64_t offset, const uint32_t *p, int p_bit,
|
||||
bool color);
|
||||
|
||||
|
Reference in New Issue
Block a user