On Tue, Sep 9, 2025 at 8:01 AM Dmitry Baryshkov
<dmitry.barysh...@oss.qualcomm.com> wrote:
>
> On Mon, Sep 08, 2025 at 12:30:04PM -0700, Rob Clark wrote:
> > 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 <robin.cl...@oss.qualcomm.com>
> > ---
> >  drivers/gpu/drm/msm/registers/gen_header.py | 37 +--------------------
> >  1 file changed, 1 insertion(+), 36 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/registers/gen_header.py 
> > b/drivers/gpu/drm/msm/registers/gen_header.py
> > index a409404627c7..56273a810c1d 100644
> > --- a/drivers/gpu/drm/msm/registers/gen_header.py
> > +++ b/drivers/gpu/drm/msm/registers/gen_header.py
> > @@ -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)
>
> 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

>
> > -     print("*/")
> > +     print("/* Autogenerated file, DO NOT EDIT manually! */")
> >
> >       print()
> >       print("#ifdef __KERNEL__")
> > --
> > 2.51.0
> >
>
> --
> With best wishes
> Dmitry

Reply via email to