Skip to contentSkip to conversation

drm/doc: Document KUnit expectations

PATCH Applied Maxime Ripard 6 participants 7 messages Jan 13, 2025 – Feb 26, 2025

Subsystems (3)
lore
Share & tools
lore

Maxime Ripard

author maintainer
#0 lore raw

PATCH 1/1 drm/doc: Document KUnit expectations

The DRM and KMS frameworks and helpers gain more and more kunit coverage, so let's document what our expectations are.

---

I'm not too sure where those guidelines should be placed. Is it the best place?

---
 Documentation/gpu/drm-internals.rst | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/gpu/drm-internals.rst +7 -0
index cb9ae282771c..94f93fd3b8a0 100644
@@ -206,10 +206,17 @@ follows:
 	The configuration included in ``.kunitconfig`` should be as generic as
 	possible.
 	``CONFIG_VIRTIO_UML`` and ``CONFIG_UML_PCI_OVER_VIRTIO`` are not
 	included in it because they are only required for User Mode Linux.
 
+KUnit Coverage Rules
+~~~~~~~~~~~~~~~~~~~~
+
+KUnit support is gradually added to the DRM framework and helpers. There's no
+general requirement for the framework and helpers to have KUnit tests at the
+moment. However, patches that are affecting a function or helper already
+covered by KUnit tests must provide tests if the change calls for one.
 
 Legacy Support Code
 ===================
 
 The section very briefly covers some of the old legacy support code
Signature · 1 line
2.47.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Maxime Ripard

The DRM and KMS frameworks and helpers gain more and more kunit coverage, so let's document what our expectations are.

Seems fair.

---

On a related note, I was recently pinged again about the framebuffer kunit tests causing warning backtraces on successful runs. I don't know what to tell people, we kind of ended at an impasse [1]. Most tests don't emit warnings, some do, and I'm still as reluctant as ever to recommend folks to ignore warnings when running tests. We can agree to disagree, but it doesn't really move things forward.

BR,
Jani.

[1] https://lore.kernel.org/r/[email protected]

Quoted 31 lines

---

I'm not too sure where those guidelines should be placed. Is it the best place?

---
 Documentation/gpu/drm-internals.rst | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/gpu/drm-internals.rst +7 -0
index cb9ae282771c..94f93fd3b8a0 100644
@@ -206,10 +206,17 @@ follows:
 	The configuration included in ``.kunitconfig`` should be as generic as
 	possible.
 	``CONFIG_VIRTIO_UML`` and ``CONFIG_UML_PCI_OVER_VIRTIO`` are not
 	included in it because they are only required for User Mode Linux.
 
+KUnit Coverage Rules
+~~~~~~~~~~~~~~~~~~~~
+
+KUnit support is gradually added to the DRM framework and helpers. There's no
+general requirement for the framework and helpers to have KUnit tests at the
+moment. However, patches that are affecting a function or helper already
+covered by KUnit tests must provide tests if the change calls for one.
 
 Legacy Support Code
 ===================
 
 The section very briefly covers some of the old legacy support code
Signature · 1 line
Jani Nikula, Intel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Maxime Ripard
Quoted 8 lines · Maxime Ripard

The DRM and KMS frameworks and helpers gain more and more kunit coverage, so let's document what our expectations are.

---

Seems a reasonable expection to me.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
Acked-by
#3 lore raw
Quoted 8 lines · Javier Martinez Canillas
Quoted 6 lines · Maxime Ripard

The DRM and KMS frameworks and helpers gain more and more kunit coverage, so let's document what our expectations are.

Quoted 6 lines
Quoted 2 lines

---

Seems a reasonable expection to me.

I think some more acks from folks working on Kunit tests would be great, but that aside I think this accurately summarizes the discussion we had a while back.
-Sima

Signature · 3 lines
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Acked-by on v1 1/1
#4 lore raw
In reply to Maxime Ripard
Quoted 26 lines · Maxime Ripard

The DRM and KMS frameworks and helpers gain more and more kunit coverage, so let's document what our expectations are.

---

I'm not too sure where those guidelines should be placed. Is it the best place?

---
  Documentation/gpu/drm-internals.rst | 7 +++++++
  1 file changed, 7 insertions(+)
Documentation/gpu/drm-internals.rst +2 -0
index cb9ae282771c..94f93fd3b8a0 100644
@@ -206,10 +206,17 @@ follows:
  	The configuration included in ``.kunitconfig`` should be as generic as
  	possible.
  	``CONFIG_VIRTIO_UML`` and ``CONFIG_UML_PCI_OVER_VIRTIO`` are not
  	included in it because they are only required for User Mode Linux.
 
+KUnit Coverage Rules
+~~~~~~~~~~~~~~~~~~~~

Documentation/gpu/drm-internals.rst follows: · line 222

Quoted 10 lines
Documentation/gpu/drm-internals.rst +5 -0
+
+KUnit support is gradually added to the DRM framework and helpers. There's no
+general requirement for the framework and helpers to have KUnit tests at the
+moment. However, patches that are affecting a function or helper already
+covered by KUnit tests must provide tests if the change calls for one.
 
  Legacy Support Code
  ===================
 
  The section very briefly covers some of the old legacy support code

Regards,

Tvrtko

Acked-by on v1 1/1
#5 lore raw
In reply to Maxime Ripard

Hi Maxime,

Quoted 22 lines · Maxime Ripard

The DRM and KMS frameworks and helpers gain more and more kunit coverage, so let's document what our expectations are.

---

I'm not too sure where those guidelines should be placed. Is it the best place?

---
  Documentation/gpu/drm-internals.rst | 7 +++++++
  1 file changed, 7 insertions(+)
Documentation/gpu/drm-internals.rst +0 -0
index cb9ae282771c..94f93fd3b8a0 100644
@@ -206,10 +206,17 @@ follows:
  	The configuration included in ``.kunitconfig`` should be as generic as
  	possible.
  	``CONFIG_VIRTIO_UML`` and ``CONFIG_UML_PCI_OVER_VIRTIO`` are not

Documentation/gpu/drm-internals.rst follows: · line 218

Quoted 10 lines
Documentation/gpu/drm-internals.rst +7 -0
  	included in it because they are only required for User Mode Linux.
 
+KUnit Coverage Rules
+~~~~~~~~~~~~~~~~~~~~
+
+KUnit support is gradually added to the DRM framework and helpers. There's no
+general requirement for the framework and helpers to have KUnit tests at the
+moment. However, patches that are affecting a function or helper already
+covered by KUnit tests must provide tests if the change calls for one.
 

Best Regards,
- Maíra

Quoted 4 lines
Documentation/gpu/drm-internals.rst +0 -0
  Legacy Support Code
  ===================
 
  The section very briefly covers some of the old legacy support code
author maintainer Applied
#6 lore raw
In reply to Maxime Ripard
Quoted 4 lines · Maxime Ripard

The DRM and KMS frameworks and helpers gain more and more kunit coverage, so let's document what our expectations are.

Applied to misc/kernel.git (drm-misc-next).

Thanks!
Maxime