[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <h555ivhoyfykmw44xch6y3bwlqtewgqks33j4rqw4zkcbdkxih@y4pori4lff6h>
Date: Mon, 28 Jul 2025 18:43:47 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Otto Pflüger <otto.pflueger@...cue.de>
Cc: David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Orson Zhai <orsonzhai@...il.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Chunyan Zhang <zhang.lyra@...il.com>,
Kevin Tang <kevin.tang@...soc.com>, dri-devel@...ts.freedesktop.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/12] drm: sprd: register a DSI bridge and move init
code to pre_enable
On Sat, Jul 19, 2025 at 02:09:41PM +0200, Otto Pflüger wrote:
> If a panel needs to send DSI commands during initialization, it sets the
> prepare_prev_first flag, which allows the DSI host to initialize itself
> before the panel's prepare function is called. To support this, the DSI
> host must register a bridge and perform the necessary initialization
> steps in its pre_enable function.
>
> Implement this for the Unisoc DSI driver by moving the initialization
> code from the encoder callbacks to a bridge and simplify the remaining
> encoder-related code which no longer needs any callbacks.
>
> Signed-off-by: Otto Pflüger <otto.pflueger@...cue.de>
> ---
> drivers/gpu/drm/sprd/Kconfig | 2 +
> drivers/gpu/drm/sprd/sprd_dsi.c | 143 +++++++++++++++++++++++++---------------
> drivers/gpu/drm/sprd/sprd_dsi.h | 4 ++
> 3 files changed, 97 insertions(+), 52 deletions(-)
>
> diff --git a/drivers/gpu/drm/sprd/Kconfig b/drivers/gpu/drm/sprd/Kconfig
> index e22b780fe82248296a7153d02269faf8cd63294f..1afcdbf6f0ee3304f2297835241c9bb10d422154 100644
> --- a/drivers/gpu/drm/sprd/Kconfig
> +++ b/drivers/gpu/drm/sprd/Kconfig
> @@ -2,6 +2,8 @@ config DRM_SPRD
> tristate "DRM Support for Unisoc SoCs Platform"
> depends on ARCH_SPRD || COMPILE_TEST
> depends on DRM && OF
> + select DRM_BRIDGE_CONNECTOR
> + select DRM_DISPLAY_HELPER
> select DRM_GEM_DMA_HELPER
> select DRM_KMS_HELPER
> select DRM_MIPI_DSI
> diff --git a/drivers/gpu/drm/sprd/sprd_dsi.c b/drivers/gpu/drm/sprd/sprd_dsi.c
> index 23b0e1dc547a5023ee6ad7d5e1c49e2cec986bf0..43fff12d73f12619da57606a3c4785924e2c1507 100644
> --- a/drivers/gpu/drm/sprd/sprd_dsi.c
> +++ b/drivers/gpu/drm/sprd/sprd_dsi.c
> @@ -11,8 +11,10 @@
>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_bridge.h>
> +#include <drm/drm_bridge_connector.h>
> #include <drm/drm_of.h>
> #include <drm/drm_probe_helper.h>
> +#include <drm/drm_simple_kms_helper.h>
>
> #include "sprd_drm.h"
> #include "sprd_dpu.h"
> @@ -778,19 +780,53 @@ static void sprd_dphy_fini(struct dsi_context *ctx)
> dsi_reg_up(ctx, PHY_INTERFACE_CTRL, RF_PHY_RESET_N, RF_PHY_RESET_N);
> }
>
> -static void sprd_dsi_encoder_mode_set(struct drm_encoder *encoder,
> - struct drm_display_mode *mode,
> - struct drm_display_mode *adj_mode)
> +static int sprd_dsi_encoder_init(struct sprd_dsi *dsi,
> + struct device *dev)
> +{
> + struct drm_encoder *encoder = &dsi->encoder;
> + u32 crtc_mask;
> + int ret;
> +
> + crtc_mask = drm_of_find_possible_crtcs(dsi->drm, dev->of_node);
> + if (!crtc_mask) {
> + drm_err(dsi->drm, "failed to find crtc mask\n");
> + return -EINVAL;
> + }
> +
> + drm_dbg(dsi->drm, "find possible crtcs: 0x%08x\n", crtc_mask);
> +
> + encoder->possible_crtcs = crtc_mask;
> + ret = drm_simple_encoder_init(dsi->drm, encoder, DRM_MODE_ENCODER_DSI);
The drm_simple_* components are being deprecated. Please open-code
corresponding functionality.
> + if (ret) {
> + drm_err(dsi->drm, "failed to init dsi encoder\n");
> + return ret;
> + }
> +
> + return 0;
> +}
> +
--
With best wishes
Dmitry
Powered by blists - more mailing lists