drm/msm/registers: gen_header.py and regs sync
Subsystems (4)
Rob Clark
maintainercover drm/msm/registers: gen_header.py and regs sync
Now that https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37216
has synced kernel side changes back to mesa, this completes the round trip by syncing mesa side changes back to the kernel.
Rob Clark (5):
drm/msm/registers: Remove license/etc from generated headers drm/msm/registers: Sync gen_header.py from mesa drm/msm/registers: Make TPL1_BICUBIC_WEIGHTS_TABLE an array drm/msm/registers: Generate _HI/LO builders for reg64 drm/msm/registers: Sync GPU registers from mesa
drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 10 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 18 +- drivers/gpu/drm/msm/adreno/a6xx_preempt.c | 4 +- drivers/gpu/drm/msm/registers/adreno/a6xx.xml | 718 ++++++++++-------- .../msm/registers/adreno/a6xx_descriptors.xml | 40 - .../drm/msm/registers/adreno/a6xx_enums.xml | 50 +- .../drm/msm/registers/adreno/adreno_pm4.xml | 179 ++--- drivers/gpu/drm/msm/registers/gen_header.py | 201 ++--- 8 files changed, 639 insertions(+), 581 deletions(-)
Signature · 1 line
2.51.0
Rob Clark
maintainerPATCH 1/5 drm/msm/registers: Remove license/etc from generated headers
Since these generated files are no longer checked in, either in mesa or in the linux kernel, simplify things by dropping the verbose generated comment.
These were semi-nerf'd on the kernel side, in the name of build reproducibility, by commit ba64c6737f86 ("drivers: gpu: drm: msm:
registers: improve reproducibility"), but in a way that was semi- kernel specific. We can just reduce the divergence between kernel and mesa by just dropping all of this.
--- drivers/gpu/drm/msm/registers/gen_header.py | 37 +-------------------- 1 file changed, 1 insertion(+), 36 deletions(-)
drivers/gpu/drm/msm/registers/gen_header.py +1 -36
@@ -444,9 +444,6 @@ class Parser(object): self.variants = set() self.file = [] self.xml_files = [] - self.copyright_year = None - self.authors = [] - self.license = None def error(self, message): parser, filename = self.stack[-1]
@@ -686,10 +683,6 @@ class Parser(object): self.parse_field(attrs["name"], attrs) elif name == "database": self.do_validate(attrs["xsi:schemaLocation"]) - elif name == "copyright": - self.copyright_year = attrs["year"] - elif name == "author": - self.authors.append(attrs["name"] + " <" + attrs["email"] + "> " + attrs["name"]) def end_element(self, name): if name == "domain":
@@ -706,8 +699,6 @@ class Parser(object): self.current_array = self.current_array.parent elif name == "enum": self.current_enum = None - elif name == "license": - self.license = self.cdata def character_data(self, data): self.cdata += data
@@ -868,33 +859,7 @@ def dump_c(args, guard, func): print("#ifndef %s\n#define %s\n" % (guard, guard)) - print("""/* Autogenerated file, DO NOT EDIT manually! - -This file was generated by the rules-ng-ng gen_header.py tool in this git repository: -http://gitlab.freedesktop.org/mesa/mesa/ -git clone https://gitlab.freedesktop.org/mesa/mesa.git - -The rules-ng-ng source files this header was generated from are: -""") - maxlen = 0 - for filepath in p.xml_files: - new_filepath = re.sub("^.+drivers","drivers",filepath) - maxlen = max(maxlen, len(new_filepath)) - for filepath in p.xml_files: - pad = " " * (maxlen - len(new_filepath)) - filesize = str(os.path.getsize(filepath)) - filesize = " " * (7 - len(filesize)) + filesize - filetime = time.ctime(os.path.getmtime(filepath)) - print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)") - if p.copyright_year: - current_year = str(datetime.date.today().year) - print() - print("Copyright (C) %s-%s by the following authors:" % (p.copyright_year, current_year)) - for author in p.authors: - print("- " + author) - if p.license: - print(p.license) - print("*/") + print("/* Autogenerated file, DO NOT EDIT manually! */") print() print("#ifdef __KERNEL__")
Signature · 1 line
2.51.0
Re: [PATCH 1/5] drm/msm/registers: Remove license/etc from generated headers
Quoted 69 lines · Rob Clark
Since these generated files are no longer checked in, either in mesa or in the linux kernel, simplify things by dropping the verbose generated comment.
These were semi-nerf'd on the kernel side, in the name of build reproducibility, by commit
ba64c6737f86("drivers: gpu: drm: msm:
registers: improve reproducibility"), but in a way that was semi- kernel specific. We can just reduce the divergence between kernel and mesa by just dropping all of this.Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/registers/gen_header.py | 37 +-------------------- 1 file changed, 1 insertion(+), 36 deletions(-)drivers/gpu/drm/msm/registers/gen_header.py +0
-25@@ -444,9 +444,6 @@ class Parser(object): self.variants = set() self.file = [] self.xml_files = [] - self.copyright_year = None - self.authors = [] - self.license = None def error(self, message): parser, filename = self.stack[-1]@@ -686,10 +683,6 @@ class Parser(object): self.parse_field(attrs["name"], attrs) elif name == "database": self.do_validate(attrs["xsi:schemaLocation"]) - elif name == "copyright": - self.copyright_year = attrs["year"] - elif name == "author": - self.authors.append(attrs["name"] + " <" + attrs["email"] + "> " + attrs["name"]) def end_element(self, name): if name == "domain":@@ -706,8 +699,6 @@ class Parser(object): self.current_array = self.current_array.parent elif name == "enum": self.current_enum = None - elif name == "license": - self.license = self.cdata def character_data(self, data): self.cdata += data@@ -868,33 +859,7 @@ def dump_c(args, guard, func): print("#ifndef %s\n#define %s\n" % (guard, guard)) - print("""/* Autogenerated file, DO NOT EDIT manually! - -This file was generated by the rules-ng-ng gen_header.py tool in this git repository: -http://gitlab.freedesktop.org/mesa/mesa/ -git clone https://gitlab.freedesktop.org/mesa/mesa.git - -The rules-ng-ng source files this header was generated from are: -""") - maxlen = 0 - for filepath in p.xml_files: - new_filepath = re.sub("^.+drivers","drivers",filepath) - maxlen = max(maxlen, len(new_filepath)) - for filepath in p.xml_files: - pad = " " * (maxlen - len(new_filepath)) - filesize = str(os.path.getsize(filepath)) - filesize = " " * (7 - len(filesize)) + filesize
drivers/gpu/drm/msm/registers/gen_header.py def dump_c(args, guard, func): · line 896
Quoted 10 lines
drivers/gpu/drm/msm/registers/gen_header.py +0
-10- filetime = time.ctime(os.path.getmtime(filepath)) - print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)") - if p.copyright_year: - current_year = str(datetime.date.today().year) - print() - print("Copyright (C) %s-%s by the following authors:" % (p.copyright_year, current_year)) - for author in p.authors: - print("- " + author) - if p.license: - print(p.license)
IANAL, but I as the generated files contain C/C++ functions, I think we need to have a corresponding licence in the file.
Quoted 8 lines
drivers/gpu/drm/msm/registers/gen_header.py +1
-1- print("*/") + print("/* Autogenerated file, DO NOT EDIT manually! */") print() print("#ifdef __KERNEL__")Signature · 1 line
2.51.0
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 1/5] drm/msm/registers: Remove license/etc from generated headers
Quoted 76 lines · Dmitry Baryshkov
Quoted 74 lines · Rob Clark
Since these generated files are no longer checked in, either in mesa or in the linux kernel, simplify things by dropping the verbose generated comment.
These were semi-nerf'd on the kernel side, in the name of build reproducibility, by commit
ba64c6737f86("drivers: gpu: drm: msm:
registers: improve reproducibility"), but in a way that was semi- kernel specific. We can just reduce the divergence between kernel and mesa by just dropping all of this.Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/registers/gen_header.py | 37 +-------------------- 1 file changed, 1 insertion(+), 36 deletions(-)drivers/gpu/drm/msm/registers/gen_header.py +0
-30@@ -444,9 +444,6 @@ class Parser(object): self.variants = set() self.file = [] self.xml_files = [] - self.copyright_year = None - self.authors = [] - self.license = None def error(self, message): parser, filename = self.stack[-1]@@ -686,10 +683,6 @@ class Parser(object): self.parse_field(attrs["name"], attrs) elif name == "database": self.do_validate(attrs["xsi:schemaLocation"]) - elif name == "copyright": - self.copyright_year = attrs["year"] - elif name == "author": - self.authors.append(attrs["name"] + " <" + attrs["email"] + "> " + attrs["name"]) def end_element(self, name): if name == "domain":@@ -706,8 +699,6 @@ class Parser(object): self.current_array = self.current_array.parent elif name == "enum": self.current_enum = None - elif name == "license": - self.license = self.cdata def character_data(self, data): self.cdata += data@@ -868,33 +859,7 @@ def dump_c(args, guard, func): print("#ifndef %s\n#define %s\n" % (guard, guard)) - print("""/* Autogenerated file, DO NOT EDIT manually! - -This file was generated by the rules-ng-ng gen_header.py tool in this git repository: -http://gitlab.freedesktop.org/mesa/mesa/ -git clone https://gitlab.freedesktop.org/mesa/mesa.git - -The rules-ng-ng source files this header was generated from are: -""") - maxlen = 0 - for filepath in p.xml_files: - new_filepath = re.sub("^.+drivers","drivers",filepath) - maxlen = max(maxlen, len(new_filepath)) - for filepath in p.xml_files: - pad = " " * (maxlen - len(new_filepath)) - filesize = str(os.path.getsize(filepath)) - filesize = " " * (7 - len(filesize)) + filesize - filetime = time.ctime(os.path.getmtime(filepath)) - print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)") - if p.copyright_year: - current_year = str(datetime.date.today().year) - print()
Quoted 8 lines
drivers/gpu/drm/msm/registers/gen_header.py def dump_c(args, guard, func): · line 896
Quoted 5 lines
drivers/gpu/drm/msm/registers/gen_header.py +0
-5- print("Copyright (C) %s-%s by the following authors:" % (p.copyright_year, current_year)) - for author in p.authors: - print("- " + author) - if p.license: - print(p.license)IANAL, but I as the generated files contain C/C++ functions, I think we need to have a corresponding licence in the file.
I can't find anything that indicates a difference depending on the contents of the generated file (ie. whether it be functions/tables/prototypes/etc). And AFAICT it is implicit that the license of the generated file is inherited from the input to the generator.
Some other points:
- the various *.mod.c files generated for each kernel module do not contain a license
- various files generated by asn1_compiler do not contain a license
- other generated .c/.h files are a mixed bag, some contain a license header and some do not
(In all of the cases the generated files should not be distributed, IMHO. Yocto should fix this.)
BR,
-R
Quoted 13 lines
Quoted 9 lines
drivers/gpu/drm/msm/registers/gen_header.py +1
-2- print("*/") + print("/* Autogenerated file, DO NOT EDIT manually! */") print() print("#ifdef __KERNEL__") --2.51.0
--
With best wishes
Dmitry
Re: [PATCH 1/5] drm/msm/registers: Remove license/etc from generated headers
Quoted 100 lines · Rob Clark
Quoted 76 lines · Dmitry Baryshkov
Quoted 74 lines · Rob Clark
Since these generated files are no longer checked in, either in mesa or in the linux kernel, simplify things by dropping the verbose generated comment.
These were semi-nerf'd on the kernel side, in the name of build reproducibility, by commit
ba64c6737f86("drivers: gpu: drm: msm:
registers: improve reproducibility"), but in a way that was semi- kernel specific. We can just reduce the divergence between kernel and mesa by just dropping all of this.Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/registers/gen_header.py | 37 +-------------------- 1 file changed, 1 insertion(+), 36 deletions(-)drivers/gpu/drm/msm/registers/gen_header.py +0
-30@@ -444,9 +444,6 @@ class Parser(object): self.variants = set() self.file = [] self.xml_files = [] - self.copyright_year = None - self.authors = [] - self.license = None def error(self, message): parser, filename = self.stack[-1]@@ -686,10 +683,6 @@ class Parser(object): self.parse_field(attrs["name"], attrs) elif name == "database": self.do_validate(attrs["xsi:schemaLocation"]) - elif name == "copyright": - self.copyright_year = attrs["year"] - elif name == "author": - self.authors.append(attrs["name"] + " <" + attrs["email"] + "> " + attrs["name"]) def end_element(self, name): if name == "domain":@@ -706,8 +699,6 @@ class Parser(object): self.current_array = self.current_array.parent elif name == "enum": self.current_enum = None - elif name == "license": - self.license = self.cdata def character_data(self, data): self.cdata += data@@ -868,33 +859,7 @@ def dump_c(args, guard, func): print("#ifndef %s\n#define %s\n" % (guard, guard)) - print("""/* Autogenerated file, DO NOT EDIT manually! - -This file was generated by the rules-ng-ng gen_header.py tool in this git repository: -http://gitlab.freedesktop.org/mesa/mesa/ -git clone https://gitlab.freedesktop.org/mesa/mesa.git - -The rules-ng-ng source files this header was generated from are: -""") - maxlen = 0 - for filepath in p.xml_files: - new_filepath = re.sub("^.+drivers","drivers",filepath) - maxlen = max(maxlen, len(new_filepath)) - for filepath in p.xml_files: - pad = " " * (maxlen - len(new_filepath)) - filesize = str(os.path.getsize(filepath)) - filesize = " " * (7 - len(filesize)) + filesize - filetime = time.ctime(os.path.getmtime(filepath)) - print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)") - if p.copyright_year: - current_year = str(datetime.date.today().year) - print()Quoted 8 lines
drivers/gpu/drm/msm/registers/gen_header.py def dump_c(args, guard, func): · line 896
Quoted 5 lines
drivers/gpu/drm/msm/registers/gen_header.py +0
-5- print("Copyright (C) %s-%s by the following authors:" % (p.copyright_year, current_year)) - for author in p.authors: - print("- " + author) - if p.license: - print(p.license)IANAL, but I as the generated files contain C/C++ functions, I think we need to have a corresponding licence in the file.
I can't find anything that indicates a difference depending on the contents of the generated file (ie. whether it be functions/tables/prototypes/etc). And AFAICT it is implicit that the license of the generated file is inherited from the input to the generator.
Some other points:
- the various *.mod.c files generated for each kernel module do not contain a license
- various files generated byasn1_compilerdo not contain a license
- other generated .c/.h files are a mixed bag, some contain a license header and some do not
Quoted 2 lines
(In all of the cases the generated files should not be distributed, IMHO. Yocto should fix this.)
It's a bit funny. Normally you use something like linux-headers-foo, which contains just include/*, arch/foo/include/ and some other files. Yocto has adopted a way of building the modules against a full-kernel source & binaries dirs. As such, those two directories are parts of the cache aka 'shared state', which gets shared, etc.
Quoted 17 lines
BR,
-RQuoted 13 lines
Quoted 9 lines
drivers/gpu/drm/msm/registers/gen_header.py +1
-2- print("*/") + print("/* Autogenerated file, DO NOT EDIT manually! */") print() print("#ifdef __KERNEL__") --2.51.0
--
With best wishes
Dmitry
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 1/5] drm/msm/registers: Remove license/etc from generated headers
Quoted 102 lines · Dmitry Baryshkov
Quoted 100 lines · Rob Clark
Quoted 76 lines · Dmitry Baryshkov
Quoted 74 lines · Rob Clark
Since these generated files are no longer checked in, either in mesa or in the linux kernel, simplify things by dropping the verbose generated comment.
These were semi-nerf'd on the kernel side, in the name of build reproducibility, by commit
ba64c6737f86("drivers: gpu: drm: msm:
registers: improve reproducibility"), but in a way that was semi- kernel specific. We can just reduce the divergence between kernel and mesa by just dropping all of this.Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/registers/gen_header.py | 37 +-------------------- 1 file changed, 1 insertion(+), 36 deletions(-)drivers/gpu/drm/msm/registers/gen_header.py +0
-30@@ -444,9 +444,6 @@ class Parser(object): self.variants = set() self.file = [] self.xml_files = [] - self.copyright_year = None - self.authors = [] - self.license = None def error(self, message): parser, filename = self.stack[-1]@@ -686,10 +683,6 @@ class Parser(object): self.parse_field(attrs["name"], attrs) elif name == "database": self.do_validate(attrs["xsi:schemaLocation"]) - elif name == "copyright": - self.copyright_year = attrs["year"] - elif name == "author": - self.authors.append(attrs["name"] + " <" + attrs["email"] + "> " + attrs["name"]) def end_element(self, name): if name == "domain":@@ -706,8 +699,6 @@ class Parser(object): self.current_array = self.current_array.parent elif name == "enum": self.current_enum = None - elif name == "license": - self.license = self.cdata def character_data(self, data): self.cdata += data@@ -868,33 +859,7 @@ def dump_c(args, guard, func): print("#ifndef %s\n#define %s\n" % (guard, guard)) - print("""/* Autogenerated file, DO NOT EDIT manually! - -This file was generated by the rules-ng-ng gen_header.py tool in this git repository: -http://gitlab.freedesktop.org/mesa/mesa/ -git clone https://gitlab.freedesktop.org/mesa/mesa.git - -The rules-ng-ng source files this header was generated from are: -""") - maxlen = 0 - for filepath in p.xml_files: - new_filepath = re.sub("^.+drivers","drivers",filepath) - maxlen = max(maxlen, len(new_filepath)) - for filepath in p.xml_files: - pad = " " * (maxlen - len(new_filepath)) - filesize = str(os.path.getsize(filepath)) - filesize = " " * (7 - len(filesize)) + filesize - filetime = time.ctime(os.path.getmtime(filepath)) - print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)") - if p.copyright_year: - current_year = str(datetime.date.today().year) - print()Quoted 8 lines
drivers/gpu/drm/msm/registers/gen_header.py def dump_c(args, guard, func): · line 896
Quoted 5 lines
drivers/gpu/drm/msm/registers/gen_header.py +0
-5- print("Copyright (C) %s-%s by the following authors:" % (p.copyright_year, current_year)) - for author in p.authors: - print("- " + author) - if p.license: - print(p.license)IANAL, but I as the generated files contain C/C++ functions, I think we need to have a corresponding licence in the file.
I can't find anything that indicates a difference depending on the contents of the generated file (ie. whether it be functions/tables/prototypes/etc). And AFAICT it is implicit that the license of the generated file is inherited from the input to the generator.
Some other points:
- the various *.mod.c files generated for each kernel module do not contain a license
- various files generated byasn1_compilerdo not contain a license
- other generated .c/.h files are a mixed bag, some contain a license header and some do not
Quoted 8 lines
Quoted 2 lines
(In all of the cases the generated files should not be distributed, IMHO. Yocto should fix this.)
It's a bit funny. Normally you use something like linux-headers-foo, which contains just
include/*,arch/foo/include/and some other files. Yocto has adopted a way of building the modules against a full-kernel source & binaries dirs. As such, those two directories are parts of the cache aka 'shared state', which gets shared, etc.
So _all_ generated files get shared? Is this about building out-of-tree modules? (Which even in that case, they shouldn't need these generated files.)
BR,
-R
Quoted 21 lines
Quoted 17 lines
BR,
-RQuoted 13 lines
Quoted 9 lines
drivers/gpu/drm/msm/registers/gen_header.py +1
-2- print("*/") + print("/* Autogenerated file, DO NOT EDIT manually! */") print() print("#ifdef __KERNEL__") --2.51.0
--
With best wishes
Dmitry--
With best wishes
Dmitry
Re: [PATCH 1/5] drm/msm/registers: Remove license/etc from generated headers
Quoted 113 lines · Rob Clark
Quoted 102 lines · Dmitry Baryshkov
Quoted 100 lines · Rob Clark
Quoted 76 lines · Dmitry Baryshkov
Quoted 74 lines · Rob Clark
Since these generated files are no longer checked in, either in mesa or in the linux kernel, simplify things by dropping the verbose generated comment.
These were semi-nerf'd on the kernel side, in the name of build reproducibility, by commit
ba64c6737f86("drivers: gpu: drm: msm:
registers: improve reproducibility"), but in a way that was semi- kernel specific. We can just reduce the divergence between kernel and mesa by just dropping all of this.Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/registers/gen_header.py | 37 +-------------------- 1 file changed, 1 insertion(+), 36 deletions(-)drivers/gpu/drm/msm/registers/gen_header.py +0
-30@@ -444,9 +444,6 @@ class Parser(object): self.variants = set() self.file = [] self.xml_files = [] - self.copyright_year = None - self.authors = [] - self.license = None def error(self, message): parser, filename = self.stack[-1]@@ -686,10 +683,6 @@ class Parser(object): self.parse_field(attrs["name"], attrs) elif name == "database": self.do_validate(attrs["xsi:schemaLocation"]) - elif name == "copyright": - self.copyright_year = attrs["year"] - elif name == "author": - self.authors.append(attrs["name"] + " <" + attrs["email"] + "> " + attrs["name"]) def end_element(self, name): if name == "domain":@@ -706,8 +699,6 @@ class Parser(object): self.current_array = self.current_array.parent elif name == "enum": self.current_enum = None - elif name == "license": - self.license = self.cdata def character_data(self, data): self.cdata += data@@ -868,33 +859,7 @@ def dump_c(args, guard, func): print("#ifndef %s\n#define %s\n" % (guard, guard)) - print("""/* Autogenerated file, DO NOT EDIT manually! - -This file was generated by the rules-ng-ng gen_header.py tool in this git repository: -http://gitlab.freedesktop.org/mesa/mesa/ -git clone https://gitlab.freedesktop.org/mesa/mesa.git - -The rules-ng-ng source files this header was generated from are: -""") - maxlen = 0 - for filepath in p.xml_files: - new_filepath = re.sub("^.+drivers","drivers",filepath) - maxlen = max(maxlen, len(new_filepath)) - for filepath in p.xml_files: - pad = " " * (maxlen - len(new_filepath)) - filesize = str(os.path.getsize(filepath)) - filesize = " " * (7 - len(filesize)) + filesize - filetime = time.ctime(os.path.getmtime(filepath)) - print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)") - if p.copyright_year: - current_year = str(datetime.date.today().year) - print()Quoted 8 lines
drivers/gpu/drm/msm/registers/gen_header.py def dump_c(args, guard, func): · line 896
Quoted 5 lines
drivers/gpu/drm/msm/registers/gen_header.py +0
-5- print("Copyright (C) %s-%s by the following authors:" % (p.copyright_year, current_year)) - for author in p.authors: - print("- " + author) - if p.license: - print(p.license)IANAL, but I as the generated files contain C/C++ functions, I think we need to have a corresponding licence in the file.
I can't find anything that indicates a difference depending on the contents of the generated file (ie. whether it be functions/tables/prototypes/etc). And AFAICT it is implicit that the license of the generated file is inherited from the input to the generator.
Some other points:
- the various *.mod.c files generated for each kernel module do not contain a license
- various files generated byasn1_compilerdo not contain a license
- other generated .c/.h files are a mixed bag, some contain a license header and some do notQuoted 8 lines
Quoted 2 lines
(In all of the cases the generated files should not be distributed, IMHO. Yocto should fix this.)
It's a bit funny. Normally you use something like linux-headers-foo, which contains just
include/*,arch/foo/include/and some other files. Yocto has adopted a way of building the modules against a full-kernel source & binaries dirs. As such, those two directories are parts of the cache aka 'shared state', which gets shared, etc.
Quoted 3 lines
So _all_ generated files get shared? Is this about building out-of-tree modules? (Which even in that case, they shouldn't need these generated files.)
Yes.
Signature · 2 lines
With best wishes Dmitry
Rob Clark
maintainerPATCH 2/5 drm/msm/registers: Sync gen_header.py from mesa
In reply to Rob ClarkSync from mesa commit 04e2140d8be7 ("freedreno/registers: remove python 3.9 dependency for compiling msm").
--- drivers/gpu/drm/msm/registers/gen_header.py | 157 +++++++++++++------- 1 file changed, 107 insertions(+), 50 deletions(-)
drivers/gpu/drm/msm/registers/gen_header.py +107 -50
@@ -11,7 +11,6 @@ import collections import argparse import time import datetime -import re class Error(Exception): def __init__(self, message):
@@ -31,7 +30,7 @@ class Enum(object): def names(self): return [n for (n, value) in self.values] - def dump(self): + def dump(self, is_deprecated): use_hex = False for (name, value) in self.values: if value > 0x1000:
@@ -45,7 +44,7 @@ class Enum(object): print("\t%s = %d," % (name, value)) print("};\n") - def dump_pack_struct(self): + def dump_pack_struct(self, is_deprecated): pass class Field(object):
@@ -70,11 +69,11 @@ class Field(object): raise parser.error("booleans should be 1 bit fields") elif self.type == "float" and not (high - low == 31 or high - low == 15): raise parser.error("floats should be 16 or 32 bit fields") - elif not self.type in builtin_types and not self.type in parser.enums: + elif self.type not in builtin_types and self.type not in parser.enums: raise parser.error("unknown type '%s'" % self.type) def ctype(self, var_name): - if self.type == None: + if self.type is None: type = "uint32_t" val = var_name elif self.type == "boolean":
@@ -124,7 +123,7 @@ def field_name(reg, f): name = f.name.lower() else: # We hit this path when a reg is defined with no bitset fields, ie. - # <reg32 offset="0x88db" name="RB_BLIT_DST_ARRAY_PITCH" low="0" high="28" shr="6" type="uint"/> + # <reg32 offset="0x88db" name="RB_RESOLVE_SYSTEM_BUFFER_ARRAY_PITCH" low="0" high="28" shr="6" type="uint"/> name = reg.name.lower() if (name in [ "double", "float", "int" ]) or not (name[0].isalpha()):
@@ -146,6 +145,18 @@ def indices_strides(indices): "%s(i%d)" % (offset, idx) for (idx, (ctype, stride, offset)) in enumerate(indices)]) +def is_number(str): + try: + int(str) + return True + except ValueError: + return False + +def sanitize_variant(variant): + if variant and "-" in variant: + return variant[:variant.index("-")] + return variant + class Bitset(object): def __init__(self, name, template): self.name = name
@@ -175,11 +186,7 @@ class Bitset(object): print("#endif\n") print(" return (struct fd_reg_pair) {") - if reg.array: - print(" .reg = REG_%s(__i)," % reg.full_name) - else: - print(" .reg = REG_%s," % reg.full_name) - + print(" .reg = (uint32_t)%s," % reg.reg_offset()) print(" .value =") for f in self.fields: if f.type in [ "address", "waddress" ]:
@@ -204,7 +211,7 @@ class Bitset(object): print(" };") - def dump_pack_struct(self, reg=None): + def dump_pack_struct(self, is_deprecated, reg=None): if not reg: return
@@ -229,12 +236,15 @@ class Bitset(object): tab_to(" uint32_t", "dword;") print("};\n") + depcrstr = "" + if is_deprecated: + depcrstr = " FD_DEPRECATED" if reg.array: - print("static inline struct fd_reg_pair\npack_%s(uint32_t __i, struct %s fields)\n{" % - (prefix, prefix)) + print("static inline%s struct fd_reg_pair\npack_%s(uint32_t __i, struct %s fields)\n{" % + (depcrstr, prefix, prefix)) else: - print("static inline struct fd_reg_pair\npack_%s(struct %s fields)\n{" % - (prefix, prefix)) + print("static inline%s struct fd_reg_pair\npack_%s(struct %s fields)\n{" % + (depcrstr, prefix, prefix)) self.dump_regpair_builder(reg)
@@ -253,8 +263,8 @@ class Bitset(object): (prefix, prefix, prefix, skip)) - def dump(self, prefix=None): - if prefix == None: + def dump(self, is_deprecated, prefix=None): + if prefix is None: prefix = self.name for f in self.fields: if f.name:
@@ -262,9 +272,9 @@ class Bitset(object): else: name = prefix - if not f.name and f.low == 0 and f.shr == 0 and not f.type in ["float", "fixed", "ufixed"]: + if not f.name and f.low == 0 and f.shr == 0 and f.type not in ["float", "fixed", "ufixed"]: pass - elif f.type == "boolean" or (f.type == None and f.low == f.high): + elif f.type == "boolean" or (f.type is None and f.low == f.high): tab_to("#define %s" % name, "0x%08x" % (1 << f.low)) else: tab_to("#define %s__MASK" % name, "0x%08x" % mask(f.low, f.high))
@@ -286,6 +296,7 @@ class Array(object): self.domain = domain self.variant = variant self.parent = parent + self.children = [] if self.parent: self.name = self.parent.name + "_" + self.local_name else:
@@ -337,12 +348,15 @@ class Array(object): offset += self.parent.total_offset() return offset - def dump(self): + def dump(self, is_deprecated): + depcrstr = "" + if is_deprecated: + depcrstr = " FD_DEPRECATED" proto = indices_varlist(self.indices()) strides = indices_strides(self.indices()) array_offset = self.total_offset() if self.fixed_offsets: - print("static inline uint32_t __offset_%s(%s idx)" % (self.local_name, self.index_ctype())) + print("static inline%s uint32_t __offset_%s(%s idx)" % (depcrstr, self.local_name, self.index_ctype())) print("{\n\tswitch (idx) {") if self.index_type: for val, offset in zip(self.index_type.names(), self.offsets):
@@ -357,7 +371,7 @@ class Array(object): else: tab_to("#define REG_%s_%s(%s)" % (self.domain, self.name, proto), "(0x%08x + %s )\n" % (array_offset, strides)) - def dump_pack_struct(self): + def dump_pack_struct(self, is_deprecated): pass def dump_regpair_builder(self):
@@ -373,6 +387,7 @@ class Reg(object): self.bit_size = bit_size if array: self.name = array.name + "_" + self.name + array.children.append(self) self.full_name = self.domain + "_" + self.name if "stride" in attrs: self.stride = int(attrs["stride"], 0)
@@ -397,25 +412,34 @@ class Reg(object): else: return self.offset - def dump(self): + def reg_offset(self): + if self.array: + offset = self.array.offset + self.offset + return "(0x%08x + 0x%x*__i)" % (offset, self.array.stride) + return "0x%08x" % self.offset + + def dump(self, is_deprecated): + depcrstr = "" + if is_deprecated: + depcrstr = " FD_DEPRECATED " proto = indices_prototype(self.indices()) strides = indices_strides(self.indices()) offset = self.total_offset() if proto == '': tab_to("#define REG_%s" % self.full_name, "0x%08x" % offset) else: - print("static inline uint32_t REG_%s(%s) { return 0x%08x + %s; }" % (self.full_name, proto, offset, strides)) + print("static inline%s uint32_t REG_%s(%s) { return 0x%08x + %s; }" % (depcrstr, self.full_name, proto, offset, strides)) if self.bitset.inline: - self.bitset.dump(self.full_name) + self.bitset.dump(is_deprecated, self.full_name) + print("") - def dump_pack_struct(self): + def dump_pack_struct(self, is_deprecated): if self.bitset.inline: - self.bitset.dump_pack_struct(self) + self.bitset.dump_pack_struct(is_deprecated, self) def dump_regpair_builder(self): - if self.bitset.inline: - self.bitset.dump_regpair_builder(self) + self.bitset.dump_regpair_builder(self) def dump_py(self): print("\tREG_%s = 0x%08x" % (self.full_name, self.offset))
@@ -451,7 +475,7 @@ class Parser(object): def prefix(self, variant=None): if self.current_prefix_type == "variant" and variant: - return variant + return sanitize_variant(variant) elif self.current_stripe: return self.current_stripe + "_" + self.current_domain elif self.current_prefix:
@@ -497,15 +521,22 @@ class Parser(object): return varset def parse_variants(self, attrs): - if not "variants" in attrs: + if "variants" not in attrs: return None - variant = attrs["variants"].split(",")[0] - if "-" in variant: - variant = variant[:variant.index("-")] + variant = attrs["variants"].split(",")[0] varset = self.parse_varset(attrs) - assert varset.has_name(variant) + if "-" in variant: + # if we have a range, validate that both the start and end + # of the range are valid enums: + start = variant[:variant.index("-")] + end = variant[variant.index("-") + 1:] + assert varset.has_name(start) + if end != "": + assert varset.has_name(end) + else: + assert varset.has_name(variant) return variant
@@ -569,9 +600,6 @@ class Parser(object): error_str = str(xmlschema.error_log.filter_from_errors()[0]) raise self.error("Schema validation failed for: " + filename + "\n" + error_str) except ImportError as e: - if self.validate: - raise e - print("lxml not found, skipping validation", file=sys.stderr) def do_parse(self, filename):
@@ -640,7 +668,7 @@ class Parser(object): elif name == "domain": self.current_domain = attrs["name"] if "prefix" in attrs: - self.current_prefix = self.parse_variants(attrs) + self.current_prefix = sanitize_variant(self.parse_variants(attrs)) self.current_prefix_type = attrs["prefix"] else: self.current_prefix = None
@@ -648,7 +676,7 @@ class Parser(object): if "varset" in attrs: self.current_varset = self.enums[attrs["varset"]] elif name == "stripe": - self.current_stripe = self.parse_variants(attrs) + self.current_stripe = sanitize_variant(self.parse_variants(attrs)) elif name == "enum": self.current_enum_value = 0 self.current_enum = Enum(attrs["name"])
@@ -696,6 +724,13 @@ class Parser(object): elif name == "reg32": self.current_reg = None elif name == "array": + # if the array has no Reg children, push an implicit reg32: + if len(self.current_array.children) == 0: + attrs = { + "name": "REG", + "offset": "0", + } + self.parse_reg(attrs, 32) self.current_array = self.current_array.parent elif name == "enum": self.current_enum = None
@@ -711,10 +746,10 @@ class Parser(object): if variants: for variant, vreg in variants.items(): if reg == vreg: - d[(usage, variant)].append(reg) + d[(usage, sanitize_variant(variant))].append(reg) else: for variant in self.variants: - d[(usage, variant)].append(reg) + d[(usage, sanitize_variant(variant))].append(reg) print("#ifdef __cplusplus")
@@ -744,6 +779,9 @@ class Parser(object): print("#endif") + def has_variants(self, reg): + return reg.name in self.variant_regs and not is_number(reg.name) and not is_number(reg.name[1:]) + def dump(self): enums = [] bitsets = []
@@ -757,7 +795,7 @@ class Parser(object): regs.append(e) for e in enums + bitsets + regs: - e.dump() + e.dump(self.has_variants(e)) self.dump_reg_usages()
@@ -773,8 +811,7 @@ class Parser(object): def dump_reg_variants(self, regname, variants): - # Don't bother for things that only have a single variant: - if len(variants) == 1: + if is_number(regname) or is_number(regname[1:]): return print("#ifdef __cplusplus") print("struct __%s {" % regname)
@@ -825,11 +862,20 @@ class Parser(object): xtravar = "__i, " print("__%s(%sstruct __%s fields) {" % (regname, xtra, regname)) for variant in variants.keys(): - print(" if (%s == %s) {" % (varenum.upper(), variant)) + if "-" in variant: + start = variant[:variant.index("-")] + end = variant[variant.index("-") + 1:] + if end != "": + print(" if ((%s >= %s) && (%s <= %s)) {" % (varenum.upper(), start, varenum.upper(), end)) + else: + print(" if (%s >= %s) {" % (varenum.upper(), start)) + else: + print(" if (%s == %s) {" % (varenum.upper(), variant)) reg = variants[variant] reg.dump_regpair_builder() print(" } else") print(" assert(!\"invalid variant\");") + print(" return (struct fd_reg_pair){};") print("}") if bit_size == 64:
@@ -842,7 +888,7 @@ class Parser(object): def dump_structs(self): for e in self.file: - e.dump_pack_struct() + e.dump_pack_struct(self.has_variants(e)) for regname in self.variant_regs: self.dump_reg_variants(regname, self.variant_regs[regname])
@@ -877,9 +923,20 @@ def dump_c(args, guard, func): print("#endif") print() + print("#ifndef FD_NO_DEPRECATED_PACK") + print("#define FD_DEPRECATED __attribute__((deprecated))") + print("#else") + print("#define FD_DEPRECATED") + print("#endif") + print() + func(p) - print("\n#endif /* %s */" % guard) + print() + print("#undef FD_DEPRECATED") + print() + + print("#endif /* %s */" % guard) def dump_c_defines(args):
@@ -896,7 +953,7 @@ def dump_py_defines(args): p = Parser() try: - p.parse(args.rnn, args.xml) + p.parse(args.rnn, args.xml, args.validate) except Error as e: print(e, file=sys.stderr) exit(1)
Signature · 1 line
2.51.0
Rob Clark
maintainerPATCH 3/5 drm/msm/registers: Make TPL1_BICUBIC_WEIGHTS_TABLE an array
In reply to Rob ClarkSynced from mesa commit 77c42c1a5752 ("freedreno/registers: Make TPL1_BICUBIC_WEIGHTS_TABLE an array").
--- drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 10 +++++----- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 10 +++++----- drivers/gpu/drm/msm/registers/adreno/a6xx.xml | 18 +++++++----------- 3 files changed, 17 insertions(+), 21 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +5 -5
@@ -1355,11 +1355,11 @@ DECLARE_ADRENO_REGLIST_LIST(a7xx_pwrup_reglist);/* Applicable for X185, A750 */ static const u32 a750_ifpc_reglist_regs[] = { -REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_0 , -REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_1 , -REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_2 , -REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_3 , -REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_4 , +REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (0 ), +REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (1 ), +REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (2 ), +REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (3 ), +REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (4 ),REG_A6XX_TPL1_NC_MODE_CNTL ,REG_A6XX_SP_NC_MODE_CNTL ,REG_A6XX_CP_DBG_ECO_CNTL ,
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +5 -5
@@ -1337,14 +1337,14 @@ static int hw_init(struct msm_gpu *gpu)/* Set weights for bicubic filtering */ if (adreno_is_a650_family (adreno_gpu) ||adreno_is_x185 (adreno_gpu)) { -gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_0 ,0 ); -gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_1 , +gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (0 ),0 ); +gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (1 ),0x3fe05ff4 ); -gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_2 , +gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (2 ),0x3fa0ebee ); -gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_3 , +gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (3 ),0x3f5193ed ); -gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_4 , +gpu_write (gpu,REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE (4 ),0x3f0243f0 ); }
drivers/gpu/drm/msm/registers/adreno/a6xx.xml +7 -11
@@ -3296,17 +3296,13 @@ by a particular renderpass/blit. </reg32> <reg32 offset="0xb605" name="TPL1_UNKNOWN_B605" low="0" high="7" type="uint" variants="A6XX" usage="cmd"/> <!-- always 0x0 or 0x44 ? --> - <reg32 offset="0xb608" name="TPL1_BICUBIC_WEIGHTS_TABLE_0" low="0" high="29" variants="A6XX"/> - <reg32 offset="0xb609" name="TPL1_BICUBIC_WEIGHTS_TABLE_1" low="0" high="29" variants="A6XX"/> - <reg32 offset="0xb60a" name="TPL1_BICUBIC_WEIGHTS_TABLE_2" low="0" high="29" variants="A6XX"/> - <reg32 offset="0xb60b" name="TPL1_BICUBIC_WEIGHTS_TABLE_3" low="0" high="29" variants="A6XX"/> - <reg32 offset="0xb60c" name="TPL1_BICUBIC_WEIGHTS_TABLE_4" low="0" high="29" variants="A6XX"/> - - <reg32 offset="0xb608" name="TPL1_BICUBIC_WEIGHTS_TABLE_0" low="0" high="29" variants="A7XX" usage="cmd"/> - <reg32 offset="0xb609" name="TPL1_BICUBIC_WEIGHTS_TABLE_1" low="0" high="29" variants="A7XX" usage="cmd"/> - <reg32 offset="0xb60a" name="TPL1_BICUBIC_WEIGHTS_TABLE_2" low="0" high="29" variants="A7XX" usage="cmd"/> - <reg32 offset="0xb60b" name="TPL1_BICUBIC_WEIGHTS_TABLE_3" low="0" high="29" variants="A7XX" usage="cmd"/> - <reg32 offset="0xb60c" name="TPL1_BICUBIC_WEIGHTS_TABLE_4" low="0" high="29" variants="A7XX" usage="cmd"/> + <array offset="0xb608" name="TPL1_BICUBIC_WEIGHTS_TABLE" stride="1" length="5" variants="A6XX"> + <reg32 offset="0" name="REG" low="0" high="29"/> + </array> + + <array offset="0xb608" name="TPL1_BICUBIC_WEIGHTS_TABLE" stride="1" length="5" variants="A7XX"> + <reg32 offset="0" name="REG" low="0" high="29" usage="cmd"/> + </array> <array offset="0xb610" name="TPL1_PERFCTR_TP_SEL" stride="1" length="12" variants="A6XX"/> <array offset="0xb610" name="TPL1_PERFCTR_TP_SEL" stride="1" length="18" variants="A7XX"/>
Signature · 1 line
2.51.0
Re: [PATCH 3/5] drm/msm/registers: Make TPL1_BICUBIC_WEIGHTS_TABLE an array
Quoted 10 lines · Rob Clark
Synced from mesa commit
77c42c1a5752("freedreno/registers: MakeTPL1_BICUBIC_WEIGHTS_TABLEan array").Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 10 +++++----- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 10 +++++----- drivers/gpu/drm/msm/registers/adreno/a6xx.xml | 18 +++++++----------- 3 files changed, 17 insertions(+), 21 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Rob Clark
maintainerPATCH 4/5 drm/msm/registers: Generate _HI/LO builders for reg64
In reply to Rob ClarkThe upstream mesa copy of the GPU regs has shifted more things to reg64 instead of seperate 32b HI/LO reg32's. This works better with the "new- style" c++ builders that mesa has been migrating to for a6xx+ (to better handle register shuffling between gens), but it leaves the C builders with missing _HI/LO builders.
So handle the special case of reg64, automatically generating the missing _HI/LO builders.
--- drivers/gpu/drm/msm/registers/gen_header.py | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/msm/registers/gen_header.py +7 -0
@@ -161,6 +161,7 @@ class Bitset(object): def __init__(self, name, template): self.name = name self.inline = False + self.reg = None if template: self.fields = template.fields[:] else:
@@ -266,6 +267,11 @@ class Bitset(object): def dump(self, is_deprecated, prefix=None): if prefix is None: prefix = self.name + if self.reg and self.reg.bit_size == 64: + print("static inline uint32_t %s_LO(uint32_t val)\n{" % prefix) + print("\treturn val;\n}") + print("static inline uint32_t %s_HI(uint32_t val)\n{" % prefix) + print("\treturn val;\n}") for f in self.fields: if f.name: name = prefix + "_" + f.name
@@ -645,6 +651,7 @@ class Parser(object): self.current_reg = Reg(attrs, self.prefix(variant), self.current_array, bit_size) self.current_reg.bitset = self.current_bitset + self.current_bitset.reg = self.current_reg if len(self.stack) == 1: self.file.append(self.current_reg)
Signature · 1 line
2.51.0
Re: [PATCH 4/5] drm/msm/registers: Generate _HI/LO builders for reg64
Quoted 6 lines · Rob Clark
The upstream mesa copy of the GPU regs has shifted more things to reg64 instead of seperate 32b HI/LO reg32's. This works better with the "new- style" c++ builders that mesa has been migrating to for a6xx+ (to better handle register shuffling between gens), but it leaves the C builders with missing _HI/LO builders.
Quoted 8 lines
So handle the special case of reg64, automatically generating the missing _HI/LO builders.
Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/registers/gen_header.py | 7 +++++++ 1 file changed, 7 insertions(+)
Signature · 2 lines
With best wishes Dmitry
Rob Clark
maintainerPATCH 5/5 drm/msm/registers: Sync GPU registers from mesa
In reply to Rob ClarkIn particular, to pull in a SP_READ_SEL_LOCATION bitfield size fix to fix a7xx GPU snapshot.
Sync from mesa commit 15ee3873aa4d ("freedreno/registers: Update GMU register xml").
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 +- drivers/gpu/drm/msm/adreno/a6xx_preempt.c | 4 +- drivers/gpu/drm/msm/registers/adreno/a6xx.xml | 702 ++++++++++-------- .../msm/registers/adreno/a6xx_descriptors.xml | 40 - .../drm/msm/registers/adreno/a6xx_enums.xml | 50 +- .../drm/msm/registers/adreno/adreno_pm4.xml | 179 ++--- 6 files changed, 508 insertions(+), 475 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +4 -4
@@ -264,8 +264,8 @@ static void a6xx_set_pagetable(struct a6xx_gpu *a6xx_gpu,* Needed for preemption */ OUT_PKT7 (ring,CP_MEM_WRITE ,5 ); -OUT_RING (ring,CP_MEM_WRITE_0_ADDR_LO (lower_32_bits (memptr))); -OUT_RING (ring,CP_MEM_WRITE_1_ADDR_HI (upper_32_bits (memptr))); +OUT_RING (ring,A5XX_CP_MEM_WRITE_ADDR_LO (lower_32_bits (memptr))); +OUT_RING (ring,A5XX_CP_MEM_WRITE_ADDR_HI (upper_32_bits (memptr)));OUT_RING (ring,lower_32_bits (ttbr));OUT_RING (ring,upper_32_bits (ttbr));OUT_RING (ring, ctx->seqno);
@@ -295,9 +295,9 @@ static void a6xx_set_pagetable(struct a6xx_gpu *a6xx_gpu,*/ OUT_PKT7 (ring,CP_WAIT_REG_MEM ,6 );OUT_RING (ring,CP_WAIT_REG_MEM_0_FUNCTION (WRITE_EQ )); -OUT_RING (ring,CP_WAIT_REG_MEM_1_POLL_ADDR_LO ( +OUT_RING (ring,CP_WAIT_REG_MEM_POLL_ADDR_LO (REG_A6XX_RBBM_PERFCTR_SRAM_INIT_STATUS )); -OUT_RING (ring,CP_WAIT_REG_MEM_2_POLL_ADDR_HI (0 )); +OUT_RING (ring,CP_WAIT_REG_MEM_POLL_ADDR_HI (0 ));OUT_RING (ring,CP_WAIT_REG_MEM_3_REF (0x1 ));OUT_RING (ring,CP_WAIT_REG_MEM_4_MASK (0x1 ));OUT_RING (ring,CP_WAIT_REG_MEM_5_DELAY_LOOP_CYCLES (0 ));
drivers/gpu/drm/msm/adreno/a6xx_preempt.c +2 -2
@@ -111,9 +111,9 @@ static void preempt_prepare_postamble(struct a6xx_gpu *a6xx_gpu) postamble[count++] =PKT7 (CP_WAIT_REG_MEM ,6 ); postamble[count++] =CP_WAIT_REG_MEM_0_FUNCTION (WRITE_EQ ); - postamble[count++] =CP_WAIT_REG_MEM_1_POLL_ADDR_LO ( + postamble[count++] =CP_WAIT_REG_MEM_POLL_ADDR_LO (REG_A6XX_RBBM_PERFCTR_SRAM_INIT_STATUS ); - postamble[count++] =CP_WAIT_REG_MEM_2_POLL_ADDR_HI (0 ); + postamble[count++] =CP_WAIT_REG_MEM_POLL_ADDR_HI (0 ); postamble[count++] =CP_WAIT_REG_MEM_3_REF (0x1 ); postamble[count++] =CP_WAIT_REG_MEM_4_MASK (0x1 ); postamble[count++] =CP_WAIT_REG_MEM_5_DELAY_LOOP_CYCLES (0 );
drivers/gpu/drm/msm/registers/adreno/a6xx.xml +406 -296
1,215 lines not on this page · raw message
drivers/gpu/drm/msm/registers/adreno/a6xx_descriptors.xml +0 -40
@@ -9,38 +9,6 @@ xsi:schemaLocation="https://gitlab.freedesktop.org/freedreno/ rules-fd.xsd"> <domain name="A6XX_TEX_SAMP" width="32"> <doc>Texture sampler dwords</doc> - <enum name="a6xx_tex_filter"> <!-- same as a4xx? --> - <value name="A6XX_TEX_NEAREST" value="0"/> - <value name="A6XX_TEX_LINEAR" value="1"/> - <value name="A6XX_TEX_ANISO" value="2"/> - <value name="A6XX_TEX_CUBIC" value="3"/> <!-- a650 only --> - </enum> - <enum name="a6xx_tex_clamp"> <!-- same as a4xx? --> - <value name="A6XX_TEX_REPEAT" value="0"/> - <value name="A6XX_TEX_CLAMP_TO_EDGE" value="1"/> - <value name="A6XX_TEX_MIRROR_REPEAT" value="2"/> - <value name="A6XX_TEX_CLAMP_TO_BORDER" value="3"/> - <value name="A6XX_TEX_MIRROR_CLAMP" value="4"/> - </enum> - <enum name="a6xx_tex_aniso"> <!-- same as a4xx? --> - <value name="A6XX_TEX_ANISO_1" value="0"/> - <value name="A6XX_TEX_ANISO_2" value="1"/> - <value name="A6XX_TEX_ANISO_4" value="2"/> - <value name="A6XX_TEX_ANISO_8" value="3"/> - <value name="A6XX_TEX_ANISO_16" value="4"/> - </enum> - <enum name="a6xx_reduction_mode"> - <value name="A6XX_REDUCTION_MODE_AVERAGE" value="0"/> - <value name="A6XX_REDUCTION_MODE_MIN" value="1"/> - <value name="A6XX_REDUCTION_MODE_MAX" value="2"/> - </enum> - <enum name="a6xx_fast_border_color"> - <!-- R B G A --> - <value name="A6XX_BORDER_COLOR_0_0_0_0" value="0"/> - <value name="A6XX_BORDER_COLOR_0_0_0_1" value="1"/> - <value name="A6XX_BORDER_COLOR_1_1_1_0" value="2"/> - <value name="A6XX_BORDER_COLOR_1_1_1_1" value="3"/> - </enum> <reg32 offset="0" name="0"> <bitfield name="MIPFILTER_LINEAR_NEAR" pos="0" type="boolean"/>
@@ -79,14 +47,6 @@ xsi:schemaLocation="https://gitlab.freedesktop.org/freedreno/ rules-fd.xsd"> <domain name="A6XX_TEX_CONST" width="32" varset="chip"> <doc>Texture constant dwords</doc> - <enum name="a6xx_tex_swiz"> <!-- same as a4xx? --> - <value name="A6XX_TEX_X" value="0"/> - <value name="A6XX_TEX_Y" value="1"/> - <value name="A6XX_TEX_Z" value="2"/> - <value name="A6XX_TEX_W" value="3"/> - <value name="A6XX_TEX_ZERO" value="4"/> - <value name="A6XX_TEX_ONE" value="5"/> - </enum> <reg32 offset="0" name="0"> <bitfield name="TILE_MODE" low="0" high="1" type="a6xx_tile_mode"/> <bitfield name="SRGB" pos="2" type="boolean"/>
drivers/gpu/drm/msm/registers/adreno/a6xx_enums.xml +48 -2
66 lines not on this page · raw message
drivers/gpu/drm/msm/registers/adreno/adreno_pm4.xml +48 -131
319 lines not on this page · raw message
Signature · 1 line
2.51.0
Re: [PATCH 5/5] drm/msm/registers: Sync GPU registers from mesa
Quoted 8 lines · Rob Clark
In particular, to pull in a
SP_READ_SEL_LOCATIONbitfield size fix to fix a7xx GPU snapshot.Sync from mesa commit
15ee3873aa4d("freedreno/registers: Update GMU register xml").Cc Karmjit Mahil <[email protected]>Signed-off-by Rob Clark <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 +- drivers/gpu/drm/msm/adreno/a6xx_preempt.c | 4 +- drivers/gpu/drm/msm/registers/adreno/a6xx.xml | 702 ++++++++++-------- .../msm/registers/adreno/a6xx_descriptors.xml | 40 - .../drm/msm/registers/adreno/a6xx_enums.xml | 50 +- .../drm/msm/registers/adreno/adreno_pm4.xml | 179 ++--- 6 files changed, 508 insertions(+), 475 deletions(-)
Signature · 2 lines
With best wishes Dmitry