mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
freedreno/registers: Reintroduce FD_NO_DEPRECATED_PACK
The non-variant reg packers were removed in commit fd6489c026 ("tu:
Drop emitting of deprecated packing."), along with
FD_NO_DEPRECATED_PACK.
Add support to mark the even older reg builders as deprecated, and
re-introduce FD_NO_DEPRECATED_PACK to control this.
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
This commit is contained in:
parent
2f3d6119fc
commit
31d757495e
3 changed files with 34 additions and 7 deletions
|
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "util/macros.h"
|
||||||
|
|
||||||
#include "fd6_hw.h"
|
#include "fd6_hw.h"
|
||||||
|
|
||||||
/* In order to debug issues with usage of stale reg data we need to have
|
/* In order to debug issues with usage of stale reg data we need to have
|
||||||
|
|
@ -26,6 +28,9 @@
|
||||||
static inline bool
|
static inline bool
|
||||||
fd_reg_stomp_allowed(chip CHIP, uint16_t reg)
|
fd_reg_stomp_allowed(chip CHIP, uint16_t reg)
|
||||||
{
|
{
|
||||||
|
PRAGMA_DIAGNOSTIC_PUSH
|
||||||
|
PRAGMA_DIAGNOSTIC_IGNORED_CLANG(-W#pragma-messages)
|
||||||
|
|
||||||
switch (CHIP) {
|
switch (CHIP) {
|
||||||
case A6XX: {
|
case A6XX: {
|
||||||
switch (reg) {
|
switch (reg) {
|
||||||
|
|
@ -77,6 +82,7 @@ fd_reg_stomp_allowed(chip CHIP, uint16_t reg)
|
||||||
default: {
|
default: {
|
||||||
UNREACHABLE("Unknown GPU");
|
UNREACHABLE("Unknown GPU");
|
||||||
}
|
}
|
||||||
|
PRAGMA_DIAGNOSTIC_POP
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,10 @@ def tab_to(name, value):
|
||||||
tab_count = 1
|
tab_count = 1
|
||||||
print(name + ('\t' * tab_count) + value)
|
print(name + ('\t' * tab_count) + value)
|
||||||
|
|
||||||
|
def define_macro(name, value, has_variants):
|
||||||
|
if has_variants:
|
||||||
|
value = "__FD_DEPRECATED " + value
|
||||||
|
tab_to(name, value)
|
||||||
|
|
||||||
def mask(low, high):
|
def mask(low, high):
|
||||||
return ((0xffffffffffffffff >> (64 - (high + 1 - low))) << low)
|
return ((0xffffffffffffffff >> (64 - (high + 1 - low))) << low)
|
||||||
|
|
@ -407,11 +411,13 @@ class Array(object):
|
||||||
print("\t\tdefault: return INVALID_IDX(idx);")
|
print("\t\tdefault: return INVALID_IDX(idx);")
|
||||||
print("\t}\n}")
|
print("\t}\n}")
|
||||||
if proto == '':
|
if proto == '':
|
||||||
tab_to("#define REG_%s_%s" %
|
define_macro("#define REG_%s_%s" %
|
||||||
(self.domain, self.name), "0x%08x\n" % array_offset)
|
(self.domain, self.name), "0x%08x\n" % array_offset,
|
||||||
|
has_variants)
|
||||||
else:
|
else:
|
||||||
tab_to("#define REG_%s_%s(%s)" % (self.domain, self.name,
|
define_macro("#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),
|
||||||
|
has_variants)
|
||||||
|
|
||||||
def dump_pack_struct(self, has_variants):
|
def dump_pack_struct(self, has_variants):
|
||||||
pass
|
pass
|
||||||
|
|
@ -466,10 +472,13 @@ class Reg(object):
|
||||||
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)
|
define_macro("#define REG_%s" % self.full_name, "0x%08x" % offset, has_variants)
|
||||||
elif not has_variants:
|
elif not has_variants:
|
||||||
print("static CONSTEXPR inline uint32_t REG_%s(%s) { return 0x%08x + %s; }" % (
|
depcrstr = ""
|
||||||
self.full_name, proto, offset, strides))
|
if has_variants:
|
||||||
|
depcrstr = " __FD_DEPRECATED "
|
||||||
|
print("static CONSTEXPR inline%s uint32_t REG_%s(%s) { return 0x%08x + %s; }" % (
|
||||||
|
depcrstr, self.full_name, proto, offset, strides))
|
||||||
|
|
||||||
if self.bitset.inline:
|
if self.bitset.inline:
|
||||||
self.bitset.dump(has_variants, self.full_name, self)
|
self.bitset.dump(has_variants, self.full_name, self)
|
||||||
|
|
@ -980,6 +989,15 @@ def dump_c(args, guard, func):
|
||||||
print("#endif")
|
print("#endif")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
# TODO figure out what to do about fd_reg_stomp_allowed()
|
||||||
|
# vs gcc.. for now only enable the warnings with clang:
|
||||||
|
print("#if defined(__clang__) && !defined(FD_NO_DEPRECATED_PACK)")
|
||||||
|
print("#define __FD_DEPRECATED _Pragma (\"GCC warning \\\"Deprecated reg builder\\\"\")")
|
||||||
|
print("#else")
|
||||||
|
print("#define __FD_DEPRECATED")
|
||||||
|
print("#endif")
|
||||||
|
print()
|
||||||
|
|
||||||
func(p)
|
func(p)
|
||||||
|
|
||||||
print("#endif /* %s */" % guard)
|
print("#endif /* %s */" % guard)
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,9 @@ 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