mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
tu: Drop emitting of deprecated packing.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38796>
This commit is contained in:
parent
ab6b2e4663
commit
fd6489c026
2 changed files with 24 additions and 48 deletions
|
|
@ -32,7 +32,7 @@ class Enum(object):
|
||||||
def names(self):
|
def names(self):
|
||||||
return [n for (n, value) in self.values]
|
return [n for (n, value) in self.values]
|
||||||
|
|
||||||
def dump(self, is_deprecated):
|
def dump(self, has_variants):
|
||||||
use_hex = False
|
use_hex = False
|
||||||
for (name, value) in self.values:
|
for (name, value) in self.values:
|
||||||
if value > 0x1000:
|
if value > 0x1000:
|
||||||
|
|
@ -46,7 +46,7 @@ class Enum(object):
|
||||||
print("\t%s = %d," % (name, value))
|
print("\t%s = %d," % (name, value))
|
||||||
print("};\n")
|
print("};\n")
|
||||||
|
|
||||||
def dump_pack_struct(self, is_deprecated):
|
def dump_pack_struct(self, has_variants):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -230,7 +230,7 @@ class Bitset(object):
|
||||||
|
|
||||||
print(" };")
|
print(" };")
|
||||||
|
|
||||||
def dump_pack_struct(self, is_deprecated, reg=None):
|
def dump_pack_struct(self, has_variants, reg=None):
|
||||||
if not reg:
|
if not reg:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -261,20 +261,16 @@ class Bitset(object):
|
||||||
tab_to(" uint32_t", "dword;")
|
tab_to(" uint32_t", "dword;")
|
||||||
print("};\n")
|
print("};\n")
|
||||||
|
|
||||||
depcrstr = ""
|
if not has_variants:
|
||||||
if is_deprecated:
|
print("static%s inline struct fd_reg_pair" % constexpr_mark)
|
||||||
depcrstr = " FD_DEPRECATED"
|
if reg.array:
|
||||||
print("static%s inline%s struct fd_reg_pair" %
|
print("pack_%s(uint32_t __i, struct %s fields)\n{" % (prefix, prefix))
|
||||||
(constexpr_mark, depcrstr))
|
else:
|
||||||
if reg.array:
|
print("pack_%s(struct %s fields)\n{" % (prefix, prefix))
|
||||||
print("pack_%s(uint32_t __i, struct %s fields)\n{" % (
|
|
||||||
prefix, prefix))
|
|
||||||
else:
|
|
||||||
print("pack_%s(struct %s fields)\n{" % (prefix, prefix))
|
|
||||||
|
|
||||||
self.dump_regpair_builder(reg)
|
self.dump_regpair_builder(reg)
|
||||||
|
|
||||||
print("\n}\n")
|
print("\n}\n")
|
||||||
|
|
||||||
if self.get_address_field():
|
if self.get_address_field():
|
||||||
skip = ", { .reg = 0 }"
|
skip = ", { .reg = 0 }"
|
||||||
|
|
@ -288,7 +284,7 @@ class Bitset(object):
|
||||||
print("#define %s(...) pack_%s(__struct_cast(%s) { __VA_ARGS__ })%s\n" %
|
print("#define %s(...) pack_%s(__struct_cast(%s) { __VA_ARGS__ })%s\n" %
|
||||||
(prefix, prefix, prefix, skip))
|
(prefix, prefix, prefix, skip))
|
||||||
|
|
||||||
def dump(self, is_deprecated, prefix=None, reg=None):
|
def dump(self, has_variants, prefix=None, reg=None):
|
||||||
if prefix is None:
|
if prefix is None:
|
||||||
prefix = self.name
|
prefix = self.name
|
||||||
if self.reg and self.reg.bit_size == 64:
|
if self.reg and self.reg.bit_size == 64:
|
||||||
|
|
@ -390,16 +386,13 @@ class Array(object):
|
||||||
offset += self.parent.total_offset()
|
offset += self.parent.total_offset()
|
||||||
return offset
|
return offset
|
||||||
|
|
||||||
def dump(self, is_deprecated):
|
def dump(self, has_variants):
|
||||||
depcrstr = ""
|
|
||||||
if is_deprecated:
|
|
||||||
depcrstr = " FD_DEPRECATED"
|
|
||||||
proto = indices_varlist(self.indices())
|
proto = indices_varlist(self.indices())
|
||||||
strides = indices_strides(self.indices())
|
strides = indices_strides(self.indices())
|
||||||
array_offset = self.total_offset()
|
array_offset = self.total_offset()
|
||||||
if self.fixed_offsets:
|
if self.fixed_offsets and not has_variants:
|
||||||
print("static CONSTEXPR inline%s uint32_t __offset_%s(%s idx)" %
|
print("static CONSTEXPR inline uint32_t __offset_%s(%s idx)" %
|
||||||
(depcrstr, self.local_name, self.index_ctype()))
|
(self.local_name, self.index_ctype()))
|
||||||
print("{\n\tswitch (idx) {")
|
print("{\n\tswitch (idx) {")
|
||||||
if self.index_type:
|
if self.index_type:
|
||||||
for val, offset in zip(self.index_type.names(), self.offsets):
|
for val, offset in zip(self.index_type.names(), self.offsets):
|
||||||
|
|
@ -416,7 +409,7 @@ class Array(object):
|
||||||
tab_to("#define REG_%s_%s(%s)" % (self.domain, self.name,
|
tab_to("#define REG_%s_%s(%s)" % (self.domain, self.name,
|
||||||
proto), "(0x%08x + %s )\n" % (array_offset, strides))
|
proto), "(0x%08x + %s )\n" % (array_offset, strides))
|
||||||
|
|
||||||
def dump_pack_struct(self, is_deprecated):
|
def dump_pack_struct(self, has_variants):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def dump_regpair_builder(self):
|
def dump_regpair_builder(self):
|
||||||
|
|
@ -464,26 +457,23 @@ class Reg(object):
|
||||||
return "(0x%08x + 0x%x*__i)" % (offset, self.array.stride)
|
return "(0x%08x + 0x%x*__i)" % (offset, self.array.stride)
|
||||||
return "0x%08x" % self.offset
|
return "0x%08x" % self.offset
|
||||||
|
|
||||||
def dump(self, is_deprecated):
|
def dump(self, has_variants):
|
||||||
depcrstr = ""
|
|
||||||
if is_deprecated:
|
|
||||||
depcrstr = " FD_DEPRECATED "
|
|
||||||
proto = indices_prototype(self.indices())
|
proto = indices_prototype(self.indices())
|
||||||
strides = indices_strides(self.indices())
|
strides = indices_strides(self.indices())
|
||||||
offset = self.total_offset()
|
offset = self.total_offset()
|
||||||
if proto == '':
|
if proto == '':
|
||||||
tab_to("#define REG_%s" % self.full_name, "0x%08x" % offset)
|
tab_to("#define REG_%s" % self.full_name, "0x%08x" % offset)
|
||||||
else:
|
elif not has_variants:
|
||||||
print("static CONSTEXPR inline%s uint32_t REG_%s(%s) { return 0x%08x + %s; }" % (
|
print("static CONSTEXPR inline uint32_t REG_%s(%s) { return 0x%08x + %s; }" % (
|
||||||
depcrstr, self.full_name, proto, offset, strides))
|
self.full_name, proto, offset, strides))
|
||||||
|
|
||||||
if self.bitset.inline:
|
if self.bitset.inline:
|
||||||
self.bitset.dump(is_deprecated, self.full_name, self)
|
self.bitset.dump(has_variants, self.full_name, self)
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
def dump_pack_struct(self, is_deprecated):
|
def dump_pack_struct(self, has_variants):
|
||||||
if self.bitset.inline:
|
if self.bitset.inline:
|
||||||
self.bitset.dump_pack_struct(is_deprecated, self)
|
self.bitset.dump_pack_struct(has_variants, self)
|
||||||
|
|
||||||
def dump_regpair_builder(self):
|
def dump_regpair_builder(self):
|
||||||
self.bitset.dump_regpair_builder(self)
|
self.bitset.dump_regpair_builder(self)
|
||||||
|
|
@ -984,19 +974,8 @@ def dump_c(args, guard, func):
|
||||||
print("#endif")
|
print("#endif")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
print("#ifndef FD_NO_DEPRECATED_PACK")
|
|
||||||
print("#define FD_DEPRECATED __attribute__((deprecated))")
|
|
||||||
print("#else")
|
|
||||||
print("#define FD_DEPRECATED")
|
|
||||||
print("#endif")
|
|
||||||
print()
|
|
||||||
|
|
||||||
func(p)
|
func(p)
|
||||||
|
|
||||||
print()
|
|
||||||
print("#undef FD_DEPRECATED")
|
|
||||||
print()
|
|
||||||
|
|
||||||
print("#endif /* %s */" % guard)
|
print("#endif /* %s */" % guard)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,9 +135,6 @@ if freedreno_kmds.contains('virtio')
|
||||||
tu_deps += dep_libdrm
|
tu_deps += dep_libdrm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Temporarily quiet deprecated warnings until turnip is converted:
|
|
||||||
tu_flags += '-DFD_NO_DEPRECATED_PACK'
|
|
||||||
|
|
||||||
tu_tracepoints = custom_target(
|
tu_tracepoints = custom_target(
|
||||||
'tu_tracepoints.[ch]',
|
'tu_tracepoints.[ch]',
|
||||||
input: 'tu_tracepoints.py',
|
input: 'tu_tracepoints.py',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue