guidelines.rst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. ==========
  3. Guidelines
  4. ==========
  5. This document describes the general project guidelines that apply to nova-core
  6. and nova-drm.
  7. Language
  8. ========
  9. The Nova project uses the Rust programming language. In this context, all rules
  10. of the Rust for Linux project as documented in
  11. :doc:`../../rust/general-information` apply. Additionally, the following rules
  12. apply.
  13. - Unless technically necessary otherwise (e.g. uAPI), any driver code is written
  14. in Rust.
  15. - Unless technically necessary, unsafe Rust code must be avoided. In case of
  16. technical necessity, unsafe code should be isolated in a separate component
  17. providing a safe API for other driver code to use.
  18. Style
  19. -----
  20. All rules of the Rust for Linux project as documented in
  21. :doc:`../../rust/coding-guidelines` apply.
  22. For a submit checklist, please also see the `Rust for Linux Submit checklist
  23. addendum <https://rust-for-linux.com/contributing#submit-checklist-addendum>`_.
  24. Documentation
  25. =============
  26. The availability of proper documentation is essential in terms of scalability,
  27. accessibility for new contributors and maintainability of a project in general,
  28. but especially for a driver running as complex hardware as Nova is targeting.
  29. Hence, adding documentation of any kind is very much encouraged by the project.
  30. Besides that, there are some minimum requirements.
  31. - Every non-private structure needs at least a brief doc comment explaining the
  32. semantical sense of the structure, as well as potential locking and lifetime
  33. requirements. It is encouraged to have the same minimum documentation for
  34. non-trivial private structures.
  35. - uAPIs must be fully documented with kernel-doc comments; additionally, the
  36. semantical behavior must be explained including potential special or corner
  37. cases.
  38. - The APIs connecting the 1st level driver (nova-core) with 2nd level drivers
  39. must be fully documented. This includes doc comments, potential locking and
  40. lifetime requirements, as well as example code if applicable.
  41. - Abbreviations must be explained when introduced; terminology must be uniquely
  42. defined.
  43. - Register addresses, layouts, shift values and masks must be defined properly;
  44. unless obvious, the semantical sense must be documented. This only applies if
  45. the author is able to obtain the corresponding information.
  46. Acceptance Criteria
  47. ===================
  48. - Patches must only be applied if reviewed by at least one other person on the
  49. mailing list; this also applies for maintainers.