From patchwork Wed Jun 12 14:35:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13695125 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 00D66C27C53 for ; Wed, 12 Jun 2024 14:36:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E842710E87E; Wed, 12 Jun 2024 14:36:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="EzM0HDiD"; 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 9126C10E87E for ; Wed, 12 Jun 2024 14:36:00 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C14D1CE1805; Wed, 12 Jun 2024 14:35:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69AFFC116B1; Wed, 12 Jun 2024 14:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718202956; bh=YkTkobD98YgdF9Ps4HcWB86UJKfgpoXQvm65qO4nc2o=; h=From:To:Cc:Subject:Date:From; b=EzM0HDiDd1wDKTb4k5ZVmkrls8wJA1E+TUWioaMeZUEVf0tRNv9oOdVXLfzpDhZ20 ycCorzwERYhJGbJwBkizNBcgjh/UuDTnvmdKVl1hW32rS56nJTjMniMcbJPNgQ1m0q EgAFymm/zqJLFaIVh6PDxPMX9+h9pmVWLW+AtO+EFThoM6J5XLdjT8j6IqwTqW/li1 s85GXa2DddMWNK3J1YEDtEdBEYjHWceSPm1esBBWW3wdyKio7A8M2S7j64J0kMBKWF o8MYpGXeWh8x8Z8PZQWjMnIqmYDmPwdnZHCn0dxJuXD6wDCdGA8VEno3lPDp9E2YVG CsWlmg3wUbnUA== From: Maxime Ripard To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Javier Martinez Canillas , Dmitry Baryshkov Subject: [PATCH 1/3] drm/todo: Create a TODO item for additional HDMI work Date: Wed, 12 Jun 2024 16:35:51 +0200 Message-ID: <20240612143553.915966-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 --- Documentation/gpu/todo.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 2ea6ffc9b22b..52fd8672fb6d 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -633,10 +633,39 @@ 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. + +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 Wed Jun 12 14:35:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13695126 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 203A1C27C53 for ; Wed, 12 Jun 2024 14:36:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C42C10E87F; Wed, 12 Jun 2024 14:36:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="unZ9u/A2"; 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 1C1AC10E87F for ; Wed, 12 Jun 2024 14:36:01 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 41FDB6149A; Wed, 12 Jun 2024 14:36:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92AABC116B1; Wed, 12 Jun 2024 14:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718202961; bh=E+6iiKAAyXlMtZ6T33s52aNTX7qMp5w1njSRTRjCFRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=unZ9u/A2gAPxyG2gYGd5SCKrwH5hRc+cB66rkoGdLp+mScStcXUGd8PDCjtD+ef9P 3314N1SX9tEKZU5rfIp03z2ZYUiIB20r2Dk+IAZ1aqFhEAoQirdk4uJX6ob0QQVTfO qiK6ehXaZ3LMVjxqGq9T+COzX5HSyg0/6FW1daPG+nrhLUYpXYPcOLjABwJDylj7YP M/t1xOdqiTSwsIwDfdXBxMbO48HYGJykWCob6b0+Aoc0JUvgluGBlTKO9P3ma1t2mp ntbcBRYqIbvUGcQGK7Q3kG+2A4iTt464YO+NUbzM0yeO+OTNi/7oMBn1ToUglM5yL+ V7u5A/ObjgK6w== From: Maxime Ripard To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Javier Martinez Canillas , Dmitry Baryshkov Subject: [PATCH 2/3] drm/todo: Create a TODO item for MIPI-DSI rework Date: Wed, 12 Jun 2024 16:35:52 +0200 Message-ID: <20240612143553.915966-2-mripard@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612143553.915966-1-mripard@kernel.org> References: <20240612143553.915966-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 52fd8672fb6d..94139c652663 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 Wed Jun 12 14:35:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13695127 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 BC730C27C7B for ; Wed, 12 Jun 2024 14:36:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E4AC10E882; Wed, 12 Jun 2024 14:36:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="FihvLG7d"; 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 D514910E885 for ; Wed, 12 Jun 2024 14:36:04 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3BEE96149A; Wed, 12 Jun 2024 14:36:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F429C116B1; Wed, 12 Jun 2024 14:36:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718202963; bh=8jXXcz13JWAMyrSat3JZapAIgAzavaJjrX08KmBSB0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FihvLG7djIuFRi472NFmjmCuA+vxvPwJ8H1c99aIXchmD43d9g6rGqrHiOAVQ4hId wJR1sup9xPzBEjvdeGYdMWDGcQNJ+80rZ1FWhekWMjp4RPDkOW3bMHevnSPqtrDG6J AArBNPWUTDACTVlHt5qJjlevk/qZCxMfVJ3x+2rCN4sid9KI67BmU+n5d46jraOqX4 0r+XXkVZAIng3Z2tCJohHIiQkgiimI2S2Z7+K4DC2l/oqLwOyNpWjrkgqw7YzUy+fg fwnaAsqJEJ+4+e3GPSsHQnkvNSe2M2XjuyyLmrtuW1/lcCG+ZVUgBc4i6dbd8Mfvu4 6LwAdWbwsgK4A== From: Maxime Ripard To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Javier Martinez Canillas Subject: [PATCH 3/3] drm/todo: Add TODO entry for "lints" Date: Wed, 12 Jun 2024 16:35:53 +0200 Message-ID: <20240612143553.915966-3-mripard@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612143553.915966-1-mripard@kernel.org> References: <20240612143553.915966-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 --- Documentation/gpu/todo.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 94139c652663..16a9a24b33a6 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -717,10 +717,38 @@ 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 + +Contact: Maxime Ripard + +Level: Intermediate + Enable trinity for DRM ---------------------- And fix up the fallout. Should be really interesting ...