Skip to contentSkip to conversation

drm/doc: Document kapi doc expectations

PATCH In review Daniel Vetter 6 participants 9 messages Jun 25, 2019 – Jul 19, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/doc: Document kapi doc expectations

We've had this already for anything new. With my drm_prime.c cleanup I also think documentations for everything already existing is complete, and we can bake this in as a requirements subsystem wide.

Cc Laurent Pinchart <[email protected]>
Cc Jani Nikula <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>

---
resending stand-alone for more visibility and a-b gathering. -Daniel

---
 Documentation/gpu/introduction.rst | 13 +++++++++++++
 Documentation/gpu/todo.rst         | 13 -------------
 2 files changed, 13 insertions(+), 13 deletions(-)
Documentation/gpu/introduction.rst +13 -0
index fccbe375244d..a94ad6ad1f54 100644
@@ -51,6 +51,19 @@ and "FIXME" where the interface could be cleaned up.
 
 Also read the :ref:`guidelines for the kernel documentation at large <doc_guide>`.
 
+Documentation Requirements for kAPI
+-----------------------------------
+
+All kernel APIs exported to other modules must be documented, including their
+datastructures and at least a short introductory section explaining the overall
+concepts. Documentation should be put into the code itself as kerneldoc comments
+as much as reasonable. Do not blindly document everything, but document only
+what's relevant for driver authors: Internal functions of drm.ko and definitely
+static functions should not have formal kerneldoc comments. Use normal C
+comments if you feel like a comment is warranted. Similar for data structures,
+annotate anything entirely private with ``/* private: */`` comments as per the
+documentation guide.
+
 Getting Started
 ===============
 
Documentation/gpu/todo.rst +0 -13
index e717f280f9ae..db88969a56ee 100644
@@ -301,19 +301,6 @@ In the end no .c file should need to include ``drmP.h`` anymore.
 
 Contact: Daniel Vetter
 
-Add missing kerneldoc for exported functions
---------------------------------------------
-
-The DRM reference documentation is still lacking kerneldoc in a few areas. The
-task would be to clean up interfaces like moving functions around between
-files to better group them and improving the interfaces like dropping return
-values for functions that never fail. Then write kerneldoc for all exported
-functions and an overview section and integrate it all into the drm book.
-
-See https://dri.freedesktop.org/docs/drm/ for what's there already.
-
-Contact: Daniel Vetter
-
 Make panic handling work
 ------------------------
 
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 4 lines · Daniel Vetter

We've had this already for anything new. With my drm_prime.c cleanup I also think documentations for everything already existing is complete, and we can bake this in as a requirements subsystem wide.

Quoted 9 lines
Cc Laurent Pinchart <[email protected]>
Cc Jani Nikula <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Wholeheartedly-Acked-by Sean Paul <[email protected]>
Quoted 59 lines

---
resending stand-alone for more visibility and a-b gathering.

(quoted diff) +0 -2
-Daniel
---
 Documentation/gpu/introduction.rst | 13 +++++++++++++
 Documentation/gpu/todo.rst         | 13 -------------
 2 files changed, 13 insertions(+), 13 deletions(-)
Documentation/gpu/introduction.rst +13 -0
index fccbe375244d..a94ad6ad1f54 100644
@@ -51,6 +51,19 @@ and "FIXME" where the interface could be cleaned up.
 
 Also read the :ref:`guidelines for the kernel documentation at large <doc_guide>`.
 
+Documentation Requirements for kAPI
+-----------------------------------
+
+All kernel APIs exported to other modules must be documented, including their
+datastructures and at least a short introductory section explaining the overall
+concepts. Documentation should be put into the code itself as kerneldoc comments
+as much as reasonable. Do not blindly document everything, but document only
+what's relevant for driver authors: Internal functions of drm.ko and definitely
+static functions should not have formal kerneldoc comments. Use normal C
+comments if you feel like a comment is warranted. Similar for data structures,
+annotate anything entirely private with ``/* private: */`` comments as per the
+documentation guide.
+
 Getting Started
 ===============
 
Documentation/gpu/todo.rst +0 -13
index e717f280f9ae..db88969a56ee 100644
@@ -301,19 +301,6 @@ In the end no .c file should need to include ``drmP.h`` anymore.
 
 Contact: Daniel Vetter
 
-Add missing kerneldoc for exported functions
---------------------------------------------
-
-The DRM reference documentation is still lacking kerneldoc in a few areas. The
-task would be to clean up interfaces like moving functions around between
-files to better group them and improving the interfaces like dropping return
-values for functions that never fail. Then write kerneldoc for all exported
-functions and an overview section and integrate it all into the drm book.
-
-See https://dri.freedesktop.org/docs/drm/ for what's there already.
-
-Contact: Daniel Vetter
-
 Make panic handling work
 ------------------------
 
Signature · 1 line
2.20.1
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#2 lore raw
In reply to Daniel Vetter
Quoted 2 lines · Daniel Vetter

We've had this already for anything new. With my drm_prime.c cleanup I also think documentations for everything already existing is complete,

s/documentations/documentation?

Quoted 11 lines

and we can bake this in as a requirements subsystem wide.

Cc Laurent Pinchart <[email protected]>
Cc Jani Nikula <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 1 line

---

For what it is worth...

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by Maxime Ripard on v1 1/1
#3 lore raw
In reply to Daniel Vetter
Quoted 4 lines · Daniel Vetter

We've had this already for anything new. With my drm_prime.c cleanup I also think documentations for everything already existing is complete, and we can bake this in as a requirements subsystem wide.

Quoted 9 lines
Cc Laurent Pinchart <[email protected]>
Cc Jani Nikula <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>

From irc:

Quoted 59 lines

---
resending stand-alone for more visibility and a-b gathering.

(quoted diff) +0 -2
-Daniel
---
 Documentation/gpu/introduction.rst | 13 +++++++++++++
 Documentation/gpu/todo.rst         | 13 -------------
 2 files changed, 13 insertions(+), 13 deletions(-)
Documentation/gpu/introduction.rst +13 -0
index fccbe375244d..a94ad6ad1f54 100644
@@ -51,6 +51,19 @@ and "FIXME" where the interface could be cleaned up.
 
 Also read the :ref:`guidelines for the kernel documentation at large <doc_guide>`.
 
+Documentation Requirements for kAPI
+-----------------------------------
+
+All kernel APIs exported to other modules must be documented, including their
+datastructures and at least a short introductory section explaining the overall
+concepts. Documentation should be put into the code itself as kerneldoc comments
+as much as reasonable. Do not blindly document everything, but document only
+what's relevant for driver authors: Internal functions of drm.ko and definitely
+static functions should not have formal kerneldoc comments. Use normal C
+comments if you feel like a comment is warranted. Similar for data structures,
+annotate anything entirely private with ``/* private: */`` comments as per the
+documentation guide.
+
 Getting Started
 ===============
 
Documentation/gpu/todo.rst +0 -13
index e717f280f9ae..db88969a56ee 100644
@@ -301,19 +301,6 @@ In the end no .c file should need to include ``drmP.h`` anymore.
 
 Contact: Daniel Vetter
 
-Add missing kerneldoc for exported functions
---------------------------------------------
-
-The DRM reference documentation is still lacking kerneldoc in a few areas. The
-task would be to clean up interfaces like moving functions around between
-files to better group them and improving the interfaces like dropping return
-values for functions that never fail. Then write kerneldoc for all exported
-functions and an overview section and integrate it all into the drm book.
-
-See https://dri.freedesktop.org/docs/drm/ for what's there already.
-
-Contact: Daniel Vetter
-
 Make panic handling work
 ------------------------
 
Signature · 1 line
2.20.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by
#4 lore raw
Quoted 16 lines · Daniel Vetter
Quoted 4 lines · Daniel Vetter

We've had this already for anything new. With my drm_prime.c cleanup I also think documentations for everything already existing is complete, and we can bake this in as a requirements subsystem wide.

Quoted 9 lines
Cc Laurent Pinchart <[email protected]>
Cc Jani Nikula <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 4 lines

From irc:

Fwiw:

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 1/1
#5 lore raw
In reply to Daniel Vetter

Hi Daniel,

Thank you for the patch.

Quoted 26 lines · Daniel Vetter

We've had this already for anything new. With my drm_prime.c cleanup I also think documentations for everything already existing is complete, and we can bake this in as a requirements subsystem wide.

Cc Laurent Pinchart <[email protected]>
Cc Jani Nikula <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>

---
resending stand-alone for more visibility and a-b gathering.

(quoted diff) +0 -2
-Daniel
---
 Documentation/gpu/introduction.rst | 13 +++++++++++++
 Documentation/gpu/todo.rst         | 13 -------------
 2 files changed, 13 insertions(+), 13 deletions(-)
Documentation/gpu/introduction.rst +0 -0
index fccbe375244d..a94ad6ad1f54 100644

Documentation/gpu/introduction.rst and "FIXME" where the interface could be cleaned up. · line 59

Quoted 9 lines
Documentation/gpu/introduction.rst +6 -0
@@ -51,6 +51,19 @@ and "FIXME" where the interface could be cleaned up.
 
 Also read the :ref:`guidelines for the kernel documentation at large <doc_guide>`.
 
+Documentation Requirements for kAPI
+-----------------------------------
+
+All kernel APIs exported to other modules must be documented, including their
+datastructures and at least a short introductory section explaining the overall
+concepts. Documentation should be put into the code itself as kerneldoc comments

s/should/shall/

Documentation/gpu/introduction.rst and "FIXME" where the interface could be cleaned up. · line 63

Quoted 4 lines
Documentation/gpu/introduction.rst +4 -0
+as much as reasonable. Do not blindly document everything, but document only
+what's relevant for driver authors: Internal functions of drm.ko and definitely
+static functions should not have formal kerneldoc comments. Use normal C
+comments if you feel like a comment is warranted. Similar for data structures,

Should we make it clear here that kerneldoc syntax is perfectly fine but that the comment should start with /* instead of /** ? kerneldoc is a widely understood syntax among kernel developers, so it makes sense to document internal functions (when needed) with the same syntax. The only thing we don't want is to have those functions ending up in the generated documentation.

With this addressed,

Quoted 30 lines
Documentation/gpu/introduction.rst +3 -0
+annotate anything entirely private with ``/* private: */`` comments as per the
+documentation guide.
+
 Getting Started
 ===============
 
Documentation/gpu/todo.rst +0 -13
index e717f280f9ae..db88969a56ee 100644
@@ -301,19 +301,6 @@ In the end no .c file should need to include ``drmP.h`` anymore.
 
 Contact: Daniel Vetter
 
-Add missing kerneldoc for exported functions
---------------------------------------------
-
-The DRM reference documentation is still lacking kerneldoc in a few areas. The
-task would be to clean up interfaces like moving functions around between
-files to better group them and improving the interfaces like dropping return
-values for functions that never fail. Then write kerneldoc for all exported
-functions and an overview section and integrate it all into the drm book.
-
-See https://dri.freedesktop.org/docs/drm/ for what's there already.
-
-Contact: Daniel Vetter
-
 Make panic handling work
 ------------------------
 
Signature · 7 lines
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

PATCH 1/1 drm/doc: Document kapi doc expectations

In reply to Daniel Vetter

We've had this already for anything new. With my drm_prime.c cleanup I also think documentation for everything already existing is complete, and we can bake this in as a requirements subsystem wide.

v2: Improve wording a bit (Laurent), fix typo in commit message (Sam).

---
 Documentation/gpu/introduction.rst | 16 ++++++++++++++++
 Documentation/gpu/todo.rst         | 13 -------------
 2 files changed, 16 insertions(+), 13 deletions(-)
Documentation/gpu/introduction.rst +16 -0
index fccbe375244d..25a56e9c0cfd 100644
@@ -51,6 +51,22 @@ and "FIXME" where the interface could be cleaned up.
 
 Also read the :ref:`guidelines for the kernel documentation at large <doc_guide>`.
 
+Documentation Requirements for kAPI
+-----------------------------------
+
+All kernel APIs exported to other modules must be documented, including their
+datastructures and at least a short introductory section explaining the overall
+concepts. Documentation should be put into the code itself as kerneldoc comments
+as much as reasonable.
+
+Do not blindly document everything, but document only what's relevant for driver
+authors: Internal functions of drm.ko and definitely static functions should not
+have formal kerneldoc comments. Use normal C comments if you feel like a comment
+is warranted. You may use kerneldoc syntax in the comment, but it shall not
+start with a /** kerneldoc marker. Similar for data structures, annotate
+anything entirely private with ``/* private: */`` comments as per the
+documentation guide.
+
 Getting Started
 ===============
 
Documentation/gpu/todo.rst +0 -13
index e717f280f9ae..db88969a56ee 100644
@@ -301,19 +301,6 @@ In the end no .c file should need to include ``drmP.h`` anymore.
 
 Contact: Daniel Vetter
 
-Add missing kerneldoc for exported functions
---------------------------------------------
-
-The DRM reference documentation is still lacking kerneldoc in a few areas. The
-task would be to clean up interfaces like moving functions around between
-files to better group them and improving the interfaces like dropping return
-values for functions that never fail. Then write kerneldoc for all exported
-functions and an overview section and integrate it all into the drm book.
-
-See https://dri.freedesktop.org/docs/drm/ for what's there already.
-
-Contact: Daniel Vetter
-
 Make panic handling work
 ------------------------
 
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by Alex Deucher on v1 1/1
#7 lore raw
Quoted 6 lines · Daniel Vetter

We've had this already for anything new. With my drm_prime.c cleanup I also think documentation for everything already existing is complete, and we can bake this in as a requirements subsystem wide.

v2: Improve wording a bit (Laurent), fix typo in commit message (Sam).

Quoted 7 lines

From irc:

Quoted 66 lines
Cc Laurent Pinchart <[email protected]>
Cc Jani Nikula <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
---
 Documentation/gpu/introduction.rst | 16 ++++++++++++++++
 Documentation/gpu/todo.rst         | 13 -------------
 2 files changed, 16 insertions(+), 13 deletions(-)
Documentation/gpu/introduction.rst +16 -0
index fccbe375244d..25a56e9c0cfd 100644
@@ -51,6 +51,22 @@ and "FIXME" where the interface could be cleaned up.
 
 Also read the :ref:`guidelines for the kernel documentation at large <doc_guide>`.
 
+Documentation Requirements for kAPI
+-----------------------------------
+
+All kernel APIs exported to other modules must be documented, including their
+datastructures and at least a short introductory section explaining the overall
+concepts. Documentation should be put into the code itself as kerneldoc comments
+as much as reasonable.
+
+Do not blindly document everything, but document only what's relevant for driver
+authors: Internal functions of drm.ko and definitely static functions should not
+have formal kerneldoc comments. Use normal C comments if you feel like a comment
+is warranted. You may use kerneldoc syntax in the comment, but it shall not
+start with a /** kerneldoc marker. Similar for data structures, annotate
+anything entirely private with ``/* private: */`` comments as per the
+documentation guide.
+
 Getting Started
 ===============
 
Documentation/gpu/todo.rst +0 -13
index e717f280f9ae..db88969a56ee 100644
@@ -301,19 +301,6 @@ In the end no .c file should need to include ``drmP.h`` anymore.
 
 Contact: Daniel Vetter
 
-Add missing kerneldoc for exported functions
---------------------------------------------
-
-The DRM reference documentation is still lacking kerneldoc in a few areas. The
-task would be to clean up interfaces like moving functions around between
-files to better group them and improving the interfaces like dropping return
-values for functions that never fail. Then write kerneldoc for all exported
-functions and an overview section and integrate it all into the drm book.
-
-See https://dri.freedesktop.org/docs/drm/ for what's there already.
-
-Contact: Daniel Vetter
-
 Make panic handling work
 ------------------------
 
Signature · 1 line
2.20.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw
Quoted 15 lines · Daniel Vetter
Quoted 6 lines · Daniel Vetter

We've had this already for anything new. With my drm_prime.c cleanup I also think documentation for everything already existing is complete, and we can bake this in as a requirements subsystem wide.

v2: Improve wording a bit (Laurent), fix typo in commit message (Sam).

Quoted 7 lines
Quoted 3 lines

From irc:

I guess that's enough acks, applied for 5.4 in drm-misc-next. -Daniel

Quoted 72 lines
Quoted 67 lines
Cc Laurent Pinchart <[email protected]>
Cc Jani Nikula <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
---
 Documentation/gpu/introduction.rst | 16 ++++++++++++++++
 Documentation/gpu/todo.rst         | 13 -------------
 2 files changed, 16 insertions(+), 13 deletions(-)
Documentation/gpu/introduction.rst +16 -0
index fccbe375244d..25a56e9c0cfd 100644
@@ -51,6 +51,22 @@ and "FIXME" where the interface could be cleaned up.
 
 Also read the :ref:`guidelines for the kernel documentation at large <doc_guide>`.
 
+Documentation Requirements for kAPI
+-----------------------------------
+
+All kernel APIs exported to other modules must be documented, including their
+datastructures and at least a short introductory section explaining the overall
+concepts. Documentation should be put into the code itself as kerneldoc comments
+as much as reasonable.
+
+Do not blindly document everything, but document only what's relevant for driver
+authors: Internal functions of drm.ko and definitely static functions should not
+have formal kerneldoc comments. Use normal C comments if you feel like a comment
+is warranted. You may use kerneldoc syntax in the comment, but it shall not
+start with a /** kerneldoc marker. Similar for data structures, annotate
+anything entirely private with ``/* private: */`` comments as per the
+documentation guide.
+
 Getting Started
 ===============
 
Documentation/gpu/todo.rst +0 -13
index e717f280f9ae..db88969a56ee 100644
@@ -301,19 +301,6 @@ In the end no .c file should need to include ``drmP.h`` anymore.
 
 Contact: Daniel Vetter
 
-Add missing kerneldoc for exported functions
---------------------------------------------
-
-The DRM reference documentation is still lacking kerneldoc in a few areas. The
-task would be to clean up interfaces like moving functions around between
-files to better group them and improving the interfaces like dropping return
-values for functions that never fail. Then write kerneldoc for all exported
-functions and an overview section and integrate it all into the drm book.
-
-See https://dri.freedesktop.org/docs/drm/ for what's there already.
-
-Contact: Daniel Vetter
-
 Make panic handling work
 ------------------------
 
Signature · 1 line
2.20.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel