From patchwork Thu Jun 20 13:35:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13705528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B272C27C79 for ; Thu, 20 Jun 2024 13:35:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3060B10E9DF; Thu, 20 Jun 2024 13:35:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="X762k1oG"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0089610E9DF for ; Thu, 20 Jun 2024 13:35:35 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 54078621A6; Thu, 20 Jun 2024 13:35:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E9B9C32786; Thu, 20 Jun 2024 13:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718890535; bh=5tYVYfhQ8AgDhKqY9oLsQ7bOinioICIDD6Nq7WRjn+U=; h=From:To:Cc:Subject:Date:From; b=X762k1oGLZKF7Cl1FWlBDIiH354n9HkPPslE3bLQYYWYSFlSrOikylk6qdVQxm5Cq XxmC5SiKhpEb1rcpJHoHQWmzUjm5P0o0DYgC2+K2/IcTOSySrDHCpE0mjnMm5DzOdo vj/ZvNkO21YCB3dC02Vf6P+kgaJJKVf6tOp97U9dREcgb4MxnlUosaJIWE7y54cGHP t+FA6V5g9zF1hHx+NHsGbucqXrywXop/D60/DvoLdpwe9txWYYHciXBlzdzy1nHgtI MwyQjotlanGi1VMtYkbMoqEZ2+0cdoJjPNBVSDthrzrH2hEw7iDUTTYXrY9Yi2A2eP 9jYw9331jLI5w== From: Maxime Ripard To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Javier Martinez Canillas , Dmitry Baryshkov Subject: [PATCH v2 1/3] drm/todo: Create a TODO item for additional HDMI work Date: Thu, 20 Jun 2024 15:35:29 +0200 Message-ID: <20240620133531.3954622-1-mripard@kernel.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Signed-off-by: Maxime Ripard --- Changes from v1: - Add sound and HDCP --- Documentation/gpu/todo.rst | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 2ea6ffc9b22b..3104ffbd6295 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -633,10 +633,46 @@ long as that supports DMA. Otherwise importing can still needlessly fail. Contact: Thomas Zimmermann , 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 `_ + +The `vc4` driver is a good example for all this. + +Contact: Maxime Ripard + +Level: Intermediate + Better Testing ============== Add unit tests using the Kernel Unit Testing (KUnit) framework From patchwork Thu Jun 20 13:35:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13705529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9A6DC27C79 for ; Thu, 20 Jun 2024 13:35:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC75810E9E2; Thu, 20 Jun 2024 13:35:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="V/7JrKn3"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 697AD10E9E2 for ; Thu, 20 Jun 2024 13:35:38 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E0C4162158; Thu, 20 Jun 2024 13:35:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FEFFC32786; Thu, 20 Jun 2024 13:35:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718890537; bh=+UjIaT0G77GuW93//+8Wq+imdQChxkcK9dBuNQJjFB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/7JrKn3fuCIe+/ukc1k6Wu4v9cD6YBUqkU6ce+PD7TQxh9aAtBERAqrO5V7rB2+r EPPcJrS0Gt0orp2Mr0VX77wmg++j7ZV9NqagVmIUImiBki0jR5QhzOnCWHlu0ywNZU Cmz5BYUsH/usonN1KxRhgPQ66UP5u6jLMkh8GtYvumfUGi6sJPZIEQx1IHjVDdjJ7D AoI0JZaMUDZvOft2ltm6WsBvD763Q3mYWtxIWzzH7coH080WL6zAEsxN4x2j1KQRij t4jqKddN6ugCD59Eag9CnXK5kCfCBVZMOMqXihnzvnqTUV+b3RnUA+ZyM8z1IHgnXH 4kzGDpc9aneVA== From: Maxime Ripard To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Javier Martinez Canillas , Dmitry Baryshkov Subject: [PATCH v2 2/3] drm/todo: Create a TODO item for MIPI-DSI rework Date: Thu, 20 Jun 2024 15:35:30 +0200 Message-ID: <20240620133531.3954622-2-mripard@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240620133531.3954622-1-mripard@kernel.org> References: <20240620133531.3954622-1-mripard@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Signed-off-by: Maxime Ripard --- Documentation/gpu/todo.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 3104ffbd6295..030ef6bec82a 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -633,10 +633,30 @@ long as that supports DMA. Otherwise importing can still needlessly fail. Contact: Thomas Zimmermann , 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 `_ + +Contact: Maxime Ripard , Dmitry Baryshkov + +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 From patchwork Thu Jun 20 13:35:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13705530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23B9AC27C79 for ; Thu, 20 Jun 2024 13:35:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D6D610E9E3; Thu, 20 Jun 2024 13:35:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="s0QPHnFs"; dkim-atps=neutral Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7BEA610E9E3 for ; Thu, 20 Jun 2024 13:35:45 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 39AA7CE2647; Thu, 20 Jun 2024 13:35:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AD8DC2BD10; Thu, 20 Jun 2024 13:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718890540; bh=TcCdFXNutd9vkhZivMLUt3IerlG76eCFBxi4Ss2LB/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s0QPHnFs4+6HMUO/Uo1yZ9tZxMr6n9iZyoUwI70++eCYUpildMPNuWExEAFoAPKSg 7Uu8ZV1APaIYLHdcivEzue5p/+p6tiisYbzfUf2F/AC46MH3CHroObeUcxbOl5cwsr Ka67P15Wu/oJWxkgdgQfnYORURs3VJzXnE6BkAng3y6Uup8CjQNCTQAm6RFVBmpf9I yyKoQ+C+RfU6FoxsMZJK6Zrc19OaP8oSaFL5hYatywitCuCB0LxCN3sFmWO0Nbi3Av qPqIu0Vqox5pBYVUGeMKV7ZqB3xjvZ+ODA43W15hL1ZdiqytrYoLZqX07gcXRrIQer QniA2f0m2vV0A== From: Maxime Ripard To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Javier Martinez Canillas Subject: [PATCH v2 3/3] drm/todo: Add TODO entry for "lints" Date: Thu, 20 Jun 2024 15:35:31 +0200 Message-ID: <20240620133531.3954622-3-mripard@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240620133531.3954622-1-mripard@kernel.org> References: <20240620133531.3954622-1-mripard@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Signed-off-by: Maxime Ripard --- Changes from v1: - Add allow_modeset and cec phys address handling --- Documentation/gpu/todo.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 030ef6bec82a..9e0e2df3a59a 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -724,10 +724,44 @@ doesn't or document it if it does would be of great help. Contact: Maxime Ripard 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 + +Level: Intermediate + Enable trinity for DRM ---------------------- And fix up the fallout. Should be really interesting ...