Module Name:    src
Committed By:   riastradh
Date:           Sat Jul  2 00:26:07 UTC 2022

Modified Files:
        src/sys/external/bsd/drm2/drm: drm_gem_cma_helper.c
        src/sys/external/bsd/drm2/include/drm: drm_gem_cma_helper.h

Log Message:
drm: Rewrite drm_gem_cma_helper.h from scratch.

The header file was originally part of drm with no licence text,
which I took to mean BSD-licensed like the rest of the Linux drm code
base is by default -- everything in Linux under include/drm and
drivers/gpu/drm not otherwise marked.

In 2017, a tree-wide automated change was applied to Linux which
caused an SPDX GPL header to appear in drm_gem_cma_helper.h.  When I
asked the drm developers about this in drm files, they explained that
it was an automated process and many of the SPDX headers were wrong,
so when excluding GPL files in drm updates, I heeded the actual GPL
vs BSD/MIT licence text and revision history rather than the SPDX
headers.

I excluded drm_gem_cma_helper.c because it was clearly originally GPL
as an exception to the default BSD licence under Linux's
drivers/gpu/drm, and Jared reimplemented the API for ues by some
(NetBSD, BSD-licensed) Arm display drivers.

During an update after that, the header file was lost in the merge
shuffle and I copied it back in without noticing the SPDX header
file.  In retrospect, I see now that it's not clear what the intent
was: the .c file was obviously GPL, and maybe the .h file was
supposed to be too but it wasn't carved out as an exception among the
drm code.

To keep our story simpler, I just drafted a new .h file that provides
a compatible subset of the interface we use, derived from the .c file
Jared wrote, written according to several deterministic rules based
on KNF that yield a non-creative specification of the compatible
interface:

1. $NetBSD$ RCS id
2. standard TNF copyright statement
3. header guard derived from #include file name
4. minimal #includes, grouped and sorted according to KNF
5. forward declaration of structs, sorted lexicographically
6. definitions of structs, members sorted lexicographically by name
7. downcasting macros, written in KNF and sorted lexicographically
8. minimal extern variable declarations, sorted lexicographically
9. minimal, function prototypes, written in KNF and sorted
   lexicographically

`Minimal' means added one by one, according to the errors issued by
the compiler (and in the case of #includes, according to the correct
header file for the missing types or function prototypes being used),
until the compiler is formally satisfied.

Any changes to this will, unless otherwise marked, be covered by the
standard TNF licence now on the file.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c
cvs rdiff -u -r1.2 -r1.3 \
    src/sys/external/bsd/drm2/include/drm/drm_gem_cma_helper.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to