intel/genxml: Remove support for start/end atttributes

Keep the support in gen_sort_xml.py to allow it still convert
old MRs into the new format.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36138>
This commit is contained in:
Caio Oliveira 2025-07-15 10:31:57 -07:00 committed by Marge Bot
parent c418cb85f7
commit 8783828f3d
3 changed files with 10 additions and 47 deletions

View file

@ -147,9 +147,6 @@ static void
get_array_offset_count(const char **atts, uint32_t *offset, uint32_t *count,
uint32_t *size, bool *variable)
{
bool is_old_format = false;
bool is_new_format = false;
*offset = 0;
for (int i = 0; atts[i]; i += 2) {
@ -159,17 +156,9 @@ get_array_offset_count(const char **atts, uint32_t *offset, uint32_t *count,
*count = strtoul(atts[i + 1], &p, 0);
if (*count == 0)
*variable = true;
} else if (strcmp(atts[i], "start") == 0) {
assert(!is_new_format);
is_old_format = true;
*offset = strtoul(atts[i + 1], &p, 0);
} else if (strcmp(atts[i], "dword") == 0) {
assert(!is_old_format);
is_new_format = true;
*offset += 32 * strtoul(atts[i + 1], &p, 0);
} else if (strcmp(atts[i], "offset_bits") == 0) {
assert(!is_old_format);
is_new_format = true;
*offset += strtoul(atts[i + 1], &p, 0);
} else if (strcmp(atts[i], "size") == 0) {
*size = strtoul(atts[i + 1], &p, 0);
@ -350,9 +339,6 @@ create_field(struct parser_context *ctx, const char **atts)
field = rzalloc(ctx->group, struct intel_field);
field->parent = ctx->group;
bool is_old_format = false;
bool is_new_format = false;
uint32_t dword = 0;
uint32_t bits_start = 0;
uint32_t bits_end = 0;
@ -368,21 +354,9 @@ create_field(struct parser_context *ctx, const char **atts)
if (strcmp(field->name, "DWord Length") == 0) {
field->parent->dword_length_field = field;
}
} else if (strcmp(atts[i], "start") == 0) {
assert(!is_new_format);
is_old_format = true;
bits_start = strtoul(atts[i + 1], &p, 0);
} else if (strcmp(atts[i], "end") == 0) {
assert(!is_new_format);
is_old_format = true;
bits_end = strtoul(atts[i + 1], &p, 0);
} else if (strcmp(atts[i], "dword") == 0) {
assert(!is_old_format);
is_new_format = true;
dword = strtoul(atts[i + 1], &p, 10);
} else if (strcmp(atts[i], "bits") == 0) {
assert(!is_old_format);
is_new_format = true;
const char *bits_str = atts[i + 1];
const char *colon = strchr(bits_str, ':');
assert(colon);

View file

@ -214,13 +214,8 @@ class Field(object):
def add_gen(self, gen, xml_attrs):
assert isinstance(gen, Gen)
if 'start' in xml_attrs:
dword = 0
start = int(xml_attrs['start'])
end = int(xml_attrs['end'])
else:
dword = int(xml_attrs['dword'])
end, start = map(int, xml_attrs['bits'].split(':'))
dword = int(xml_attrs['dword'])
end, start = map(int, xml_attrs['bits'].split(':'))
self.start_by_gen[gen] = dword * 32 + start
self.bits_by_gen[gen] = 1 + end - start

View file

@ -73,15 +73,11 @@ class Field(object):
if "name" in attrs:
self.name = safe_name(attrs["name"])
if "start" in attrs:
self.start = int(attrs["start"])
self.end = int(attrs["end"])
else:
dword = int(attrs["dword"])
end_bit, start_bit = map(int, attrs["bits"].split(":"))
dword = int(attrs["dword"])
end_bit, start_bit = map(int, attrs["bits"].split(":"))
self.start = dword * 32 + start_bit
self.end = dword * 32 + end_bit
self.start = dword * 32 + start_bit
self.end = dword * 32 + end_bit
self.type = attrs["type"]
self.nonzero = bool_from_str(attrs.get("nonzero", "false"))
@ -467,12 +463,10 @@ class Parser(object):
self.group = Group(self, None, 0, 1, size)
elif name == "group":
if "start" in attrs:
start = int(attrs["start"])
else:
dword = int(attrs["dword"])
offset_bits = int(attrs.get("offset_bits", 0))
start = dword * 32 + offset_bits
dword = int(attrs["dword"])
offset_bits = int(attrs.get("offset_bits", 0))
start = dword * 32 + offset_bits
group = Group(self, self.group,
start, int(attrs["count"]), int(attrs["size"]))