mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Wilczynski <m.wilczynski@samsung.com>
To: Icenowy Zheng <zhengxingda@iscas.ac.cn>,
	Vinod Koul <vkoul@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Lee Jones <lee@kernel.org>, Andy Yan <andy.yan@rock-chips.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Hal Feng <hal.feng@starfivetech.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney@redhat.com>,
	Heiko Stuebner <heiko@sntech.de>, Conor Dooley <conor@kernel.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Dominique Belhachemi <db@domibel.de>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	mfd@lists.linux.dev, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	linux-riscv@lists.infradead.org, Andy Yan <andyshrk@163.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Maud Spierings <maud_spierings@murena.io>,
	Graham Markall <hello@big-grey.co.uk>
Subject: Re: [PATCH v3 14/19] drm/bridge: starfive: Add JH7110 HDMI controller driver
Date: Mon, 14 Sep 2026 17:47:04 +0200	[thread overview]
Message-ID: <03a707e8-9382-4d48-9bdc-08fbd0131587@samsung.com> (raw)
In-Reply-To: <b9973f9817dc023bb703cc14628fbb5ccca27d33.camel@iscas.ac.cn>



On 9/4/26 15:39, Icenowy Zheng wrote:
> 在 2026-09-04五的 15:27 +0200,Michal Wilczynski写道:
>> Add the HDMI controller (bridge) driver for the StarFive JH7110.
>>
>> This driver binds to the starfive,jh7110-inno-hdmi-controller node.
>> It gets its shared regmap from its parent and its register access,
>> module and bus clocks from voutcrg. It consumes the pixel clock and
>> the
>> PHY from its hdmi_phy sibling.
>>
>> The driver calls the generic inno_hdmi_probe function and passes the
>> shared regmap to it, registering as a DRM bridge. The .enable hook is
>> responsible for setting the PHY's pixel clock rate via clk_set_rate()
>> and powering on the PHY via phy_power_on().
>>
>> The DC8200 has two panels, each exposing a DP and a DPI interface,
>> and a
>> mux in the video output system controller picks which of them drives
>> the
>> HDMI transmitter. Program that mux from the port graph rather than
>> relying on whatever the bootloader left behind, taking the panel from
>> the
>> remote port number and the interface from the remote endpoint number.
>>
>> The generic driver holds the clock it looks up as the register access
>> clock enabled for its lifetime, and derives the DDC divider from that
>> clock's rate, so point it at the system clock. Naming the pixel clock
>> there instead would keep the PHY pre-PLL powered from probe onwards
>> and
>> size the divider from the wrong rate.
>>
>> The PHY can only generate the discrete set of pixel clocks described
>> by
>> its pre-PLL table, so .mode_valid rejects any mode clk_round_rate()
>> cannot satisfy. Without it such a mode would be advertised to
>> userspace
>> and the modeset would appear to succeed while the display stayed
>> blank.
>>
>> .enable returns early when the rate is unsupported or the PHY fails
>> to
>> power on, so track whether the pixel clock was actually enabled and
>> let
>> .disable tear down only what was brought up, otherwise the clock
>> refcount underflows.
>>
>> The clocks and the reset are torn down through devm rather than from
>> .remove, so that they outlive the bridge that inno_hdmi_probe() adds
>> with
>> devm_drm_bridge_add(). Releasing them in .remove runs before devres
>> unwinds and would leave the bridge registered with its clocks already
>> gated.
>>
>> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
>> ---
>>  drivers/gpu/drm/bridge/Kconfig            |  11 ++
>>  drivers/gpu/drm/bridge/Makefile           |   1 +
>>  drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 318
>> ++++++++++++++++++++++++++++++
>>  3 files changed, 330 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/bridge/Kconfig
>> b/drivers/gpu/drm/bridge/Kconfig
>> index
>> 4a57d49b4c6d3ab4b965228835b372d191647197..75b1cf6727d5a32310dcf9fe573
>> 4d95e14eea8fe 100644
>> --- a/drivers/gpu/drm/bridge/Kconfig
>> +++ b/drivers/gpu/drm/bridge/Kconfig

[snip]

>> +
>> +	/* Data mapping: 8-bit RGB on whichever interface is in use.
>> */
>> +	mask = VOUT_HDMI_DPI_DP_SEL | VOUT_HDMI_DP_BIT_DEPTH |
>> +	       VOUT_HDMI_DP_YUV_MODE | VOUT_HDMI_DPI_BIT_DEPTH;
>> +	val = FIELD_PREP(VOUT_HDMI_DPI_DP_SEL, endpoint.id) |
>> +	      FIELD_PREP(VOUT_HDMI_DP_YUV_MODE,
>> VOUT_HDMI_DP_YUV_MODE_RGB) |
>> +	      FIELD_PREP(VOUT_HDMI_DPI_BIT_DEPTH,
>> VOUT_HDMI_DPI_BIT_DEPTH_8BIT);
> 
> Well it looks like the vendor driver never sets DP interface, is it
> tested? I doubt whether the SoC designer messed it up.

The DP interface is documented in the TRM and I've also tested it so it
does work indeed. Here is my test branch if you would like to see for
youself.

[1] - https://github.com/mwilczy/linux/commit/7efcba3b0be30734087c79f5773cae19245924db


[snip]

> 
>> +}
>> +
>> +/*
>> + * This table is now only used for the generic .mode_valid check.
>> + * The real validation happens in the PHY driver's .round_rate.
>> + */
>> +static struct inno_hdmi_phy_config stf_hdmi_phy_configs[] = {
>> +	{ 297000000, 0x00, 0x00 },
>> +	{ ~0UL, 0x00, 0x00 }, /* Sentinel */
>> +};
> 
> If it's just such a upper bound, why don't just override the function
> as a bound check?

Yeah actually patch 10 implements mode_valid callback, so it's better to
remove this stub altogether, previously this was done satisfy the probe
check reasons - v4 will add patch that makes this table optional in
inno-hdmi driver.

> 
> Or... should the real table be used here? I start to wonder whether
> this is related to Maud's failure on the Framework panel.

Maud panel needed another entry in PHY pre-PLL table. Patch 17 in v3
adds this entry.

There is a new issue reported by Maud, I will answer that in a separate
thread.

> 
> Thanks,
> Icenowy
> 
>> +
>> +static const struct inno_hdmi_plat_ops stf_inno_hdmi_plat_ops = {
>> +	.enable = inno_hdmi_starfive_enable,
>> +	.disable = inno_hdmi_starfive_disable,
>> +	.mode_valid = inno_hdmi_starfive_mode_valid,
>> +};
>> +
>> +static const struct inno_hdmi_plat_data stf_inno_hdmi_plat_data = {
>> +	.ops = &stf_inno_hdmi_plat_ops,
>> +	.phy_configs = stf_hdmi_phy_configs,
>> +	.default_phy_config = &stf_hdmi_phy_configs[0],
>> +};
>> +
>> +static const struct of_device_id starfive_hdmi_controller_dt_ids[] =
>> {
>> +	{ .compatible = "starfive,jh7110-inno-hdmi-controller",
>> +	  .data = &stf_inno_hdmi_plat_data },
>> +	{}
>> +};
>> +MODULE_DEVICE_TABLE(of, starfive_hdmi_controller_dt_ids);
>> +
>> +struct platform_driver starfive_inno_hdmi_controller_driver = {
>> +	.probe = starfive_inno_hdmi_controller_probe,
>> +	.driver = {
>> +		.name = "starfive-inno-hdmi-controller",
>> +		.of_match_table = starfive_hdmi_controller_dt_ids,
>> +	},
>> +};
>> +module_platform_driver(starfive_inno_hdmi_controller_driver);
>> +
>> +MODULE_AUTHOR("Michal Wilczynski <m.wilczynski@samsung.com>");
>> +MODULE_DESCRIPTION("StarFive INNO HDMI Controller Driver");
>> +MODULE_LICENSE("GPL");
> 
> 

Best regards,
-- 
Michal Wilczynski <m.wilczynski@samsung.com>

  reply	other threads:[~2026-09-14 15:47 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260904132708eucas1p1adfa26ef0fe5109eca63a3aeadf74915@eucas1p1.samsung.com>
2026-09-04 13:27 ` [PATCH v3 00/19] drm: starfive: jh7110: Enable display subsystem Michal Wilczynski
     [not found]   ` <CGME20260904132710eucas1p276bacb1cda0a62d7f29066bd66660fea@eucas1p2.samsung.com>
2026-09-04 13:27     ` [PATCH v3 01/19] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy Michal Wilczynski
     [not found]   ` <CGME20260904132712eucas1p167f9527c4728af56f811d06832b43c36@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 02/19] dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller Michal Wilczynski
     [not found]   ` <CGME20260904132714eucas1p1ddf12edea05cdeda7969f229ca90bd26@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 03/19] dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem Michal Wilczynski
     [not found]   ` <CGME20260904132716eucas1p2d093509db255e62e6bd546e734f04e63@eucas1p2.samsung.com>
2026-09-04 13:27     ` [PATCH v3 04/19] dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon Michal Wilczynski
2026-09-10  8:18       ` Krzysztof Kozlowski
2026-09-14 21:43         ` Michal Wilczynski
     [not found]   ` <CGME20260904132718eucas1p1b25abe6cd0562e47dfeb75f8877e47b0@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 05/19] dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem Michal Wilczynski
2026-09-10  8:21       ` Krzysztof Kozlowski
     [not found]   ` <CGME20260904132719eucas1p1c900149ffa1b8771aca238e6441482ee@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 06/19] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200 Michal Wilczynski
2026-09-10  8:34       ` Krzysztof Kozlowski
2026-09-14 19:37         ` Michal Wilczynski
     [not found]   ` <CGME20260904132721eucas1p2e5f5bb9d907e641c4488908403b9d52f@eucas1p2.samsung.com>
2026-09-04 13:27     ` [PATCH v3 07/19] drm/bridge: inno-hdmi: Split probe out of bind Michal Wilczynski
     [not found]   ` <CGME20260904132723eucas1p14cdff81f7ccdc02ec811179c5d401d69@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 08/19] drm/bridge: inno-hdmi: Allow the register map to come from a parent Michal Wilczynski
     [not found]   ` <CGME20260904132725eucas1p19c8f66b7844108641dec1d2c39989dd5@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 09/19] drm/bridge: inno-hdmi: Add .disable platform operation Michal Wilczynski
     [not found]   ` <CGME20260904132727eucas1p241a5ba1517b5c6a2efde7bb2fdebf299@eucas1p2.samsung.com>
2026-09-04 13:27     ` [PATCH v3 10/19] drm/bridge: inno-hdmi: Add .mode_valid " Michal Wilczynski
     [not found]   ` <CGME20260904132729eucas1p1bd78eb90feaf90b6265c13fc7bf43ada@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 11/19] soc: starfive: Add jh7110-hdmi-subsystem driver Michal Wilczynski
2026-09-07  8:23       ` Uwe Kleine-König
2026-09-14 21:46         ` Michal Wilczynski
     [not found]   ` <CGME20260904132731eucas1p182c607567520f7c6f482a9c85ab64ece@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 12/19] soc: starfive: Add jh7110-vout-subsystem driver Michal Wilczynski
     [not found]   ` <CGME20260904132733eucas1p1a6529cb2ea97bc75c9cd190d1ba901c0@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 13/19] clk: starfive: jh7110-vout: Allow pixel clock rate propagation Michal Wilczynski
     [not found]   ` <CGME20260904132735eucas1p2c898afe4a4c6e957a7b9eedff321a6dc@eucas1p2.samsung.com>
2026-09-04 13:27     ` [PATCH v3 14/19] drm/bridge: starfive: Add JH7110 HDMI controller driver Michal Wilczynski
2026-09-04 13:39       ` Icenowy Zheng
2026-09-14 15:47         ` Michal Wilczynski [this message]
2026-09-07  3:51       ` Chaoyi Chen
2026-09-14 21:48         ` Michal Wilczynski
     [not found]   ` <CGME20260904132737eucas1p240d02860355b180ff9c5e8e4c6941ec0@eucas1p2.samsung.com>
2026-09-04 13:27     ` [PATCH v3 15/19] phy: Add common Innosilicon HDMI PHY helpers Michal Wilczynski
2026-09-07  3:16       ` Chaoyi Chen
     [not found]   ` <CGME20260904132739eucas1p223161c8aa461d6ad18786635ab3c9de4@eucas1p2.samsung.com>
2026-09-04 13:27     ` [PATCH v3 16/19] phy: rockchip: inno-hdmi: Use the common Innosilicon " Michal Wilczynski
2026-09-07  3:20       ` Chaoyi Chen
     [not found]   ` <CGME20260904132741eucas1p1a60fc27f22cb79ef94aeb637334124f2@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 17/19] phy: starfive: Add jh7110-inno-hdmi-phy driver Michal Wilczynski
     [not found]   ` <CGME20260904132743eucas1p1e02218d3fb38af95c3dd4bfa24904cab@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 18/19] riscv: dts: starfive: jh7110: Update DT for display subsystem Michal Wilczynski
2026-09-10  8:37       ` Krzysztof Kozlowski
2026-09-14 19:38         ` Michal Wilczynski
     [not found]   ` <CGME20260904132745eucas1p1cd078aae0c24302622db6e2e0f617c31@eucas1p1.samsung.com>
2026-09-04 13:27     ` [PATCH v3 19/19] MAINTAINERS: Add StarFive JH7110 display subsystem entry Michal Wilczynski
2026-09-04 15:13   ` [PATCH v3 00/19] drm: starfive: jh7110: Enable display subsystem Joshua Peisach
2026-09-14 21:02     ` Michal Wilczynski
2026-09-05  5:21   ` Maud Spierings
     [not found]     ` <CAAvaLCzU_-JdPHSSQS2HxGnrkRk+u_QOZ91SmxcC+nouubCtXA@mail.gmail.com>
2026-09-14 15:50       ` Michal Wilczynski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03a707e8-9382-4d48-9bdc-08fbd0131587@samsung.com \
    --to=m.wilczynski@samsung.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=alex@ghiti.fr \
    --cc=andrzej.hajda@intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=andyshrk@163.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bmasney+clk@redhat.com \
    --cc=bmasney@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=db@domibel.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hal.feng@starfivetech.com \
    --cc=heiko@sntech.de \
    --cc=hello@big-grey.co.uk \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@esmil.dk \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=m.szyprowski@samsung.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maud_spierings@murena.io \
    --cc=mfd@lists.linux.dev \
    --cc=mripard@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=vkoul@kernel.org \
    --cc=zhengxingda@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®