Skip to contentSkip to conversation

drm/todo: Create a TODO item for additional HDMI work

PATCH New Maxime Ripard 1 participant 3 messages Jun 20, 2024

Subsystems (3)
lore
Share & tools
lore

Maxime Ripard

author maintainer
#0 lore raw

PATCH v2 1/3 drm/todo: Create a TODO item for additional HDMI work

We recently added some infrastructure to deal with HDMI but we're still lacking a couple of things. Add a TODO entry with the remaining items.

Cc Dmitry Baryshkov <[email protected]>

---

Changes from v1:
- Add sound and HDCP

---
 Documentation/gpu/todo.rst | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
Documentation/gpu/todo.rst +36 -0
index 2ea6ffc9b22b..3104ffbd6295 100644
@@ -633,10 +633,46 @@ long as that supports DMA. Otherwise importing can still needlessly fail.
 
 Contact: Thomas Zimmermann <[email protected]>, Daniel Vetter
 
 Level: Advanced
 
+Improve HDMI Infrastructure
+---------------------------
+
+We have a bunch of helpers to handle HDMI and reduce the boilerplate in
+drivers. Support so far includes HDMI 1.4 support, but we need to extend
+it with:
+
+  - CEC handling support. CEC requires a bit of integration into every
+    HDMI driver to set the device physical address according to the EDID
+    in `.get_modes`, and to clear/reset it in the hotplug detection
+    path. We should create the ``drm_atomic_helper_connector_hdmi_get_modes()``
+    and ``drm_atomic_helper_connector_hdmi_handle_hotplug()`` helpers to handle
+    this properly, and convert drivers to use them.
+
+  - In order to support HDMI 2.0 properly, the scrambler parameters need
+    to be moved into the state. This includes figuring out in
+    drm_atomic_helper_connector_hdmi_check() if the scrambler and TMDS ratio
+    need to be changed, and make the
+    ``drm_atomic_helper_connector_hdmi_handle_hotplug()`` helper reset the
+    scrambler status when the device is plugged and unplugged.
+
+  - We need to support YUV420 too.
+
+  - Make the audio support somewhat generic too. The lowest hanging fruits
+    would be to provide helpers for `get_eld`, to handle hotplug and compute
+    ACR, N, and CTS parameters.
+
+  - Handling HDCP in a generic manner would be a good idea too.
+    See `[PATCH v10 00/10] drm/hdcp: Pull HDCP auth/exchange/check into helpers <https://lore.kernel.org/dri-devel/[email protected]/>`_
+
+The `vc4` driver is a good example for all this.
+
+Contact: Maxime Ripard <[email protected]>
+
+Level: Intermediate
+
 
 Better Testing
 ==============
 
 Add unit tests using the Kernel Unit Testing (KUnit) framework
Signature · 1 line
2.45.2
author maintainer
#1 lore raw

PATCH v2 2/3 drm/todo: Create a TODO item for MIPI-DSI rework

The MIPI-DSI infrastructure and setup we have so far is limited and doesn't provide a good way to address some corner-cases.

Add a TODO entry to document what is needed.

Cc Dmitry Baryshkov <[email protected]>
---
 Documentation/gpu/todo.rst | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
Documentation/gpu/todo.rst +20 -0
index 3104ffbd6295..030ef6bec82a 100644
@@ -633,10 +633,30 @@ long as that supports DMA. Otherwise importing can still needlessly fail.
 
 Contact: Thomas Zimmermann <[email protected]>, Daniel Vetter
 
 Level: Advanced
 
+Improve MIPI-DSI infrastructure
+-------------------------------
+
+The MIPI-DSI infrastructure in KMS supports MIPI-DSI devices in part
+through a dedicated bus (`drm_mipi_dsi.c`) and in part through ad-hoc
+calls in drivers, especially to handle the power state of the bus.
+
+This is an oddity as far as the device model is concerned, but is also
+an issue when multiple devices are chained (like bridges) and have
+different requirements.
+
+It would be a good idea to move all the power state handling out of KMS
+and into the bus support itself.
+
+See `[RFC PATCH 03/10] drm/mipi-dsi: add API for manual control over the DSI link power state <https://lore.kernel.org/dri-devel/[email protected]/>`_
+
+Contact: Maxime Ripard <[email protected]>, Dmitry Baryshkov <[email protected]>
+
+Level: Advanced
+
 Improve HDMI Infrastructure
 ---------------------------
 
 We have a bunch of helpers to handle HDMI and reduce the boilerplate in
 drivers. Support so far includes HDMI 1.4 support, but we need to extend
Signature · 1 line
2.45.2
author maintainer
#2 lore raw

PATCH v2 3/3 drm/todo: Add TODO entry for "lints"

In reply to Maxime Ripard

Having lints would prove beneficial to prevent the same dark patterns from reoccuring over and over again in drivers.

Add a TODO entry for that.

---

Changes from v1:
- Add allow_modeset and cec phys address handling

---
 Documentation/gpu/todo.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
Documentation/gpu/todo.rst +34 -0
index 030ef6bec82a..9e0e2df3a59a 100644
@@ -724,10 +724,44 @@ doesn't or document it if it does would be of great help.
 
 Contact: Maxime Ripard <[email protected]>
 
 Level: Intermediate
 
+Create lints for KMS drivers
+----------------------------
+
+Over time, we've accumulated a list of dark patterns in KMS drivers that
+should be avoided. However, none of them are published anywhere, and not
+all reviewers are aware of them. It creates a situation where we have
+more drivers with problematic / deprecated code, even though we know
+that they shouldn't.
+
+We should create a set of coccinelle scripts that match these patterns,
+and make new drivers run that list. And possibly integrate them in CI.
+
+These patterns include:
+
+  - Drivers using kzalloc() or devm_kzalloc() to allocate their memory,
+    instead of drmm_kzalloc().
+
+  - Drivers not protecting their device resources (MMIO, clocks,
+    regulators, etc.) by drm_dev_enter() and drm_dev_exit().
+
+  - Drivers using drm_dev_unregister() instead of drm_dev_unplug().
+
+  - Drivers not calling drm_atomic_helper_shutdown() at shutdown
+
+  - Drivers using drm_dp_cec_set_edid(), cec_get_edid_phys_addr(), or
+    cec_s_phys_addr_from_edid() instead of drm_dp_cec_attach() or
+    cec_s_phys_addr().
+
+  - Drivers setting drm_atomic_state->allow_modeset manually.
+
+Contact: Maxime Ripard <[email protected]>
+
+Level: Intermediate
+
 Enable trinity for DRM
 ----------------------
 
 And fix up the fallout. Should be really interesting ...
 
Signature · 1 line
2.45.2