From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 319A23BF699; Mon, 15 Jun 2026 09:19:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781515157; cv=none; b=VH5noG5dY25swZSTuZnvDgPnbwG4skf5U4cFQI247+wq1UPOvdNqFl/xhs8PXJaJmZHAT4a0muCXei3VHpJa7yTJdnP/9ohrR3l0z6HJ7ak0CHOPHLi16JCFmy7nvtnS1xgewi4OSoGW+VuLDsQdfSNkem6DOt26KfrcUDlssCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781515157; c=relaxed/simple; bh=7pnF6vbhipc5/ZDsAUAMs10wUOTE+lh7/ts9Pr31Pwg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kazjCnZNljN5EP/RCRDeKdbVBjT1O8HsqrklMB2BEtz/EUz21xd0sxQUxFLnFqiIMjJdD/XOOmDGy3JoxIZ/SGzEleFY3fTl47N46t2iM91RzYUgsqCmhUWU9KOkQuC4hbCPXFgk0dZzGPGK09lluSxuaw4tijYSYL/PFjRgFZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=AkGYBH5+; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="AkGYBH5+" Received: from killaraus.ideasonboard.com (2001-14ba-70f3-e800--a06.rev.dnainternet.fi [IPv6:2001:14ba:70f3:e800::a06]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8235C1E6; Mon, 15 Jun 2026 11:18:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1781515120; bh=7pnF6vbhipc5/ZDsAUAMs10wUOTE+lh7/ts9Pr31Pwg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AkGYBH5+p+7BRF9FQ3H+qI8DoQKULNnakyPm2K1iTyvEvcalh5iWWwoSIdoHldHmq kFMDiduPjFm9S+Eawnjn0Ep71HnyAmVhM1cgNX5T1uWw/ZjKhLkojp1VdCdC0u764I jkJ+5CkAHGqh7rfKCHkLh8B8V0uRzaTDViFkp9Ac= Date: Mon, 15 Jun 2026 12:19:11 +0300 From: Laurent Pinchart To: Tomi Valkeinen Cc: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Marek Vasut , Kieran Bingham , Philipp Zabel , linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: Re: [PATCH v4 4/7] drm/rcar-du: dsi: Support DSC in the pipeline Message-ID: <20260615091911.GB2821720@killaraus.ideasonboard.com> References: <20260615-rcar-du-dsc-v4-0-93096a1b56a3@ideasonboard.com> <20260615-rcar-du-dsc-v4-4-93096a1b56a3@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260615-rcar-du-dsc-v4-4-93096a1b56a3@ideasonboard.com> Hi Tomi, Thank you for the patch. On Mon, Jun 15, 2026 at 09:28:09AM +0300, Tomi Valkeinen wrote: > Enabling DSI clocks on rcar-du needs some tricks as the DU dot clock is > provided by the DSI. Thus, we call rcar_mipi_dsi_pclk_enable() from the > crtc, when enabling the crtc. > > With DSC (added in upcoming patch) in the pipeline, between the DU and > the DSI, the above call path is broken as the crtc tries to call > rcar_mipi_dsi_pclk_enable() on the DSC. > > To solve this problem, add checks to rcar_du_crtc_atomic_enable() and > rcar_du_crtc_atomic_disable() to detect the DSC via the bridge type, and > skip the DCS bridge when needed. > > Signed-off-by: Tomi Valkeinen > --- > drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 18 ++++++++++++++++++ > drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c | 1 + > 2 files changed, 19 insertions(+) > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c > index 6c07c406f725..f14fd89f9104 100644 > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c > @@ -754,6 +754,15 @@ static void rcar_du_crtc_atomic_enable(struct drm_crtc *crtc, > (BIT(RCAR_DU_OUTPUT_DSI0) | BIT(RCAR_DU_OUTPUT_DSI1)))) { > struct drm_bridge *bridge = rcdu->dsi[rcrtc->index]; > > + /* > + * When we have a DSC block between the DU and the DSI, > + * the "bridge" points to the DSC. Detect the DSC by looking > + * at the bridge type, and skip the DSC if the bridge is not > + * the DSI bridge. > + */ > + if (bridge->type != DRM_MODE_CONNECTOR_DSI) > + bridge = bridge->next_bridge; > + Is there a reason you don't do this in rcar_du_encoder_init() instead ? It would avoid running this code on every enable/disable. > rcar_mipi_dsi_pclk_enable(bridge, state); > } > > @@ -796,6 +805,15 @@ static void rcar_du_crtc_atomic_disable(struct drm_crtc *crtc, > (BIT(RCAR_DU_OUTPUT_DSI0) | BIT(RCAR_DU_OUTPUT_DSI1)))) { > struct drm_bridge *bridge = rcdu->dsi[rcrtc->index]; > > + /* > + * When we have a DSC block between the DU and the DSI, > + * the "bridge" points to the DSC. Detect the DSC by looking > + * at the bridge type, and skip the DSC if the bridge is not > + * the DSI bridge. > + */ > + if (bridge->type != DRM_MODE_CONNECTOR_DSI) > + bridge = bridge->next_bridge; > + > /* > * Disable the DSI clock output, see > * rcar_du_crtc_atomic_enable(). > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c > index aaafee1c060b..f429f03a380c 100644 > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c > @@ -957,6 +957,7 @@ static int rcar_mipi_dsi_host_attach(struct mipi_dsi_host *host, > > /* Initialize the DRM bridge. */ > dsi->bridge.of_node = dsi->dev->of_node; > + dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; > drm_bridge_add(&dsi->bridge); > > return 0; -- Regards, Laurent Pinchart