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>,
	Byron Stanoszek <gandalf@winds.org>
Cc: "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>,
	"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>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"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>,
	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,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Maud Spierings" <maud_spierings@murena.io>,
	"Graham Markall" <hello@big-grey.co.uk>,
	"Chaoyi Chen" <chaoyi.chen@rock-chips.com>,
	"Joshua Peisach" <jpeisach@ubuntu.com>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Subject: Re: [PATCH v4 00/20] drm: starfive: jh7110: Enable display subsystem
Date: Fri, 25 Sep 2026 22:09:10 +0200	[thread overview]
Message-ID: <0c29c063-0b09-4710-8bf8-1d9adee4eb53@samsung.com> (raw)
In-Reply-To: <cdb63b93c4a8857ac61b17902369086e9a278dd3.camel@iscas.ac.cn>

Hi Bryan and Icenowy,

On 9/20/26 09:35, Icenowy Zheng wrote:
> 在 2026-09-20日的 02:09 -0400,Byron Stanoszek写道:
>> On Tue, 15 Sep 2026, Michal Wilczynski wrote:
>>
>>> This series enables the display subsystem on the StarFive JH7110.
>>
>> Hi Michal,
>>
>> I tested your v4 patch series on my VisionFive2 1.3B with kernel 7.3-
>> rc3 today
>> and it works very well, except for 2 issues. Note, to make the screen
>> refresh
>> properly, I am using the noncoherent cache fixes from
>> https://protect2.fireeye.com/v1/url?k=3d78ed45-62e3d45a-3d79660a-000babdfecba-dbc6e750c3338bb9&q=1&e=d9589fcd-304c-4065-91c9-c5043969df15&u=https%3A%2F%2Fgithub.com%2Fganboing-jh7110%2Flinux%2Fcommits%2Fganboing-jh7110-cache-fix-v1%2F
>> (specifically commits 3683d97, ef93e2c, 277db0b, and 26ce3e6) in
>> addition to
>> your patch.
>>
>> Issue 1: I have a Dell U2711 monitor which has limited HDMI 1.3
>> capability, so
>> I invented my own Xorg mode to get a good frame rate:
>>
>> "2560x1440_40.22"  162.00  2560 2608 2640 2720  1440 1443 1448 1481
>> +hsync -vsync
>>
>> With this mode and your new driver, I started getting rows of black
>> pixels
>> flickering in the upper-left corner of my LCD screen. These weren't
>> there back
>> when I was running the same mode under the Keith Zhao driver from
>> StarFive
>> (drm/verisilicon v5 plus a bunch of patches for dma cache coherency)
>> (
>> https://patchwork.kernel.org/project/dri-devel/cover/20241120061848.196754-1-keith.zhao@starfivetech.com
>> /).
>>
>> The glitches I saw suggested the sync polarity was being set
>> incorrectly; the
>> number of glitched rows was exactly the vsync pulse width plus 1
>> (i.e.
>> "1440 1443 1448 1481" produced 6 bad rows, "1440 1443 1456 1481"
>> produced 14,
>> "1440 1441 1442 1481" produced 2, and so forth).
>>
>> I did a register dump between the two drivers and found that,
>> although the
>> DC8200 HSYNC and VSYNC registers were identical between the two
>> versions, the
>> hsync and vsync bits on the inno hdmi tx were swapped between the
>> two. When I
>> manually set the VIDEO_TIMING_CTL register from 0x09 to 0x05
>> (matching the
>> output of Keith's driver), the glitches went away.
>>
>> Keith Zhao driver:
>>
>> === DC8200 display 0 ===
>> DC   PANEL_CONFIG               0x1418 = 0x00001111
>> DC   HSIZE                      0x1430 = 0x0AA00A00
>> DC   HSYNC                      0x1438 = 0x45280A30
>> DC   VSIZE                      0x1440 = 0x05C905A0
>> DC   VSYNC                      0x1448 = 0xC2D405A3
>> DC   DPI_CONFIG                 0x14B8 = 0x00000005
>> DC   FB_CONFIG                  0x1518 = 0x14000000
>> DC   FB_ADDRESS                 0x1400 = 0x71200000
>> DC   FB_STRIDE                  0x1408 = 0x00002800
>> DC   FB_SIZE                    0x1810 = 0x02D00A00
>> DC   FB_CONFIG_EX               0x1CC0 = 0x00002000
>> DC   PANEL_START                0x1CCC = 0x00000001
>> DC   DP_CONFIG                  0x1CD0 = 0x0000000A
>> DC   FB_WATER_MARK              0x1CE8 = 0x00000000
>> DC   PANEL_CONFIG_EX            0x2518 = 0x00000000
>>
>> === INNO HDMI TX video timing ===
>> HDMI VIDEO_TIMING_CTL           0x08   = 0x05
>> HDMI EXT_HTOTAL_L               0x09   = 0xA0
>> HDMI EXT_HTOTAL_H               0x0A   = 0x0A
>> HDMI EXT_HBLANK_L               0x0B   = 0xA0
>> HDMI EXT_HBLANK_H               0x0C   = 0x00
>> HDMI EXT_HDELAY_L               0x0D   = 0x70
>> HDMI EXT_HDELAY_H               0x0E   = 0x00
>> HDMI EXT_HDURATION_L            0x0F   = 0x20
>> HDMI EXT_HDURATION_H            0x10   = 0x00
>> HDMI EXT_VTOTAL_L               0x11   = 0xC9
>> HDMI EXT_VTOTAL_H               0x12   = 0x05
>> HDMI EXT_VBLANK                 0x13   = 0x29
>> HDMI EXT_VDELAY                 0x14   = 0x26
>> HDMI EXT_VDURATION              0x15   = 0x05
>>
>> Your driver (showing only the changed values):
>>
>> DC   DP_CONFIG                  0x1CD0 = 0x00000000
>> DC   PANEL_CONFIG_EX            0x2518 = 0x00000001
>> HDMI VIDEO_TIMING_CTL           0x08   = 0x09
>>
>> Specifically the bit#s are different between the two drivers:
>>
>> inno_hdmi-starfive.h (Keith Zhao):     inno-hdmi.c (generic):
>>    v_HSYNC_POLARITY_SF(n)  ((n) << 2)     v_HSYNC_POLARITY  bit 3
>>    v_VSYNC_POLARITY_SF(n)  ((n) << 3)     v_VSYNC_POLARITY  bit 2
>>
>> "_SF" suggests this change is specific to StarFive. The correct
>> positions are
>> HSYNC=bit 2 and VSYNC=bit 3 for the JH7110.
> 
> In fact it's not SF specific, [1] pg.13 (full manual page 979) also
> shows the same for RK.
> 
> It could be an error from Rockchip developers since the beginning.

Yeah I agree; Maud Spierings reported similar issue and Dominuque
Belhachemi also figured that v_HSYNC_POLARITY and v_VSYNC_POLARITY are
simply swapped in
inno-hdmi.c.

As Icenowy stated Rockhip TRM also confirms this. I intend to send a fix
as part of this series (as suggested by Maud).

> 
> [1]
> https://protect2.fireeye.com/v1/url?k=ba283351-e5b30a4e-ba29b81e-000babdfecba-1b86e6ec0e74b45d&q=1&e=d9589fcd-304c-4065-91c9-c5043969df15&u=https%3A%2F%2Fgithub.com%2FDeciHD%2Frockchip_docs%2Fblob%2Fmain%2Frk3128%2FTRM-chapter-24-hdmi-tx.pdf
> 
> Thanks,
> Icenowy
> 
>>
>> I'm guessing that your 42-mode test passed because most CEA modes are
>> +hsync
>> +vsync, and this wouldn't show any difference if the two bits were
>> transposed.
>>
>> Once the sync polarity is sorted, I'd be happy to give a Tested-by:
>> on the
>> series.
>>
>>   --
>>
>> Issue 2: This is more a feature request than an issue. Originally, I
>> tried
>> running this Xorg modeline, which worked well under Keith's driver:
>>
>> "2560x1440_49.90"  201.00  2560 2608 2640 2720  1440 1443 1448 1481
>> +hsync -vsync
>>
>> However, your driver would not accept this pixel clock. I then
>> noticed you have
>> a pre-PLL table of fixed clocks. Is there any chance you can change
>> the code to
>> compute the pre-PLL on the fly like how Keith does it, rather than
>> use a table?

I can add the entry, hopefully you can let me know in the v5 whether it
works for you.

inno_hdmi_phy_pre_pll_determine_rate() returns -EINVAL for any rate not
in the table, and .mode_valid is built entirely on that:

rounded = clk_round_rate(ctrl->clks[CLK_PCLK].clk, pixelclk);
if (rounded != pixelclk)
      return MODE_NOCLOCK;

If the PHY computes dividers on demand, clk_round_rate() starts
succeeding for almost every rate .mode_valid stops rejecting anything
and we're back to advertising modes the PHY can't drive  the
blank screen bug patch 11 exists to fix.

To keep the rejection you'd have to replace the table with a real
constraint model.

The fracdiv values doesn't seem to be cleanly derivable and the Rockchip
has the datasheet and still chose a table. 


>>
>> Thanks for all your great work!
>>
>> Best regards,
>>   -Byron
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> https://protect2.fireeye.com/v1/url?k=46fbedc2-1960d4dd-46fa668d-000babdfecba-e6e7fb64f005c1b3&q=1&e=d9589fcd-304c-4065-91c9-c5043969df15&u=http%3A%2F%2Flists.infradead.org%2Fmailman%2Flistinfo%2Flinux-riscv

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

  reply	other threads:[~2026-09-25 20:09 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260915153213eucas1p148f013af239a334fc78cdc249c0f8a61@eucas1p1.samsung.com>
2026-09-15 15:32 ` Michal Wilczynski
     [not found]   ` <CGME20260915153214eucas1p2b548f3236ef98fb0cbf320e397420125@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy Michal Wilczynski
2026-09-17  6:51       ` Krzysztof Kozlowski
2026-09-18  0:34         ` Joshua Peisach
2026-09-18  6:16           ` Krzysztof Kozlowski
2026-09-18  6:21             ` Icenowy Zheng
2026-09-18  6:41               ` Krzysztof Kozlowski
2026-09-25 21:27             ` Michal Wilczynski
2026-09-25 21:05         ` Michal Wilczynski
     [not found]   ` <CGME20260915153216eucas1p2388b49e6b4c064ea49639d21f987e05e@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 02/20] dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller Michal Wilczynski
     [not found]   ` <CGME20260915153218eucas1p278c4870936afe1aaa52438660418f8c8@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 03/20] dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem Michal Wilczynski
2026-09-17  6:54       ` Krzysztof Kozlowski
     [not found]   ` <CGME20260915153220eucas1p1f5b0e03015500d9d66db8993426c8734@eucas1p1.samsung.com>
2026-09-15 15:32     ` [PATCH v4 04/20] dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon Michal Wilczynski
2026-09-17  6:55       ` Krzysztof Kozlowski
     [not found]   ` <CGME20260915153222eucas1p213b95b05ea7eb9a18700af8888ef5a44@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 05/20] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200 Michal Wilczynski
2026-09-18  5:58       ` Icenowy Zheng
     [not found]   ` <CGME20260915153224eucas1p1c19b20f6af600b1c3228a9a8f4bb4490@eucas1p1.samsung.com>
2026-09-15 15:32     ` [PATCH v4 06/20] dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem Michal Wilczynski
2026-09-24 15:30       ` Rob Herring (Arm)
     [not found]   ` <CGME20260915153226eucas1p1d69e9e853b4b5cfb1d42c2c585b57f95@eucas1p1.samsung.com>
2026-09-15 15:32     ` [PATCH v4 07/20] drm/bridge: inno-hdmi: Split probe out of bind Michal Wilczynski
     [not found]   ` <CGME20260915153227eucas1p2c51b87dc8da5d9dfacd6db6bb7d6774e@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 08/20] drm/bridge: inno-hdmi: Allow the register map to come from a parent Michal Wilczynski
     [not found]   ` <CGME20260915153229eucas1p2d1b02b6f3871d6b536f678b9ea293c1c@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 09/20] drm/bridge: inno-hdmi: Add .disable platform operation Michal Wilczynski
     [not found]   ` <CGME20260915153231eucas1p1e106fee2d6f7db2aa8bb93d18d0f5dc1@eucas1p1.samsung.com>
2026-09-15 15:32     ` [PATCH v4 10/20] drm/bridge: inno-hdmi: Add .mode_valid " Michal Wilczynski
     [not found]   ` <CGME20260915153233eucas1p2e26a6953a31c5f836aeaed03a4ae325e@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 11/20] drm/bridge: inno-hdmi: Make the PHY configuration table optional Michal Wilczynski
     [not found]   ` <CGME20260915153234eucas1p221dd53b5f1bccb6228c0a5a7d0be8394@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 12/20] soc: starfive: Add jh7110-hdmi-subsystem driver Michal Wilczynski
     [not found]   ` <CGME20260915153236eucas1p1712930425e569f894c870299f245e99f@eucas1p1.samsung.com>
2026-09-15 15:32     ` [PATCH v4 13/20] soc: starfive: Add jh7110-vout-subsystem driver Michal Wilczynski
     [not found]   ` <CGME20260915153238eucas1p29917a31d10ce1aa55c1dcb44b62180f9@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 14/20] clk: starfive: jh7110-vout: Allow pixel clock rate propagation Michal Wilczynski
     [not found]   ` <CGME20260915153241eucas1p292a3312a0ca8aed99cc416c0e01c3b66@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 15/20] drm/bridge: starfive: Add JH7110 HDMI controller driver Michal Wilczynski
     [not found]   ` <CGME20260915153242eucas1p1394a6a5e272f106b9cab2a0f709ddeb8@eucas1p1.samsung.com>
2026-09-15 15:32     ` [PATCH v4 16/20] phy: Add common Innosilicon HDMI PHY helpers Michal Wilczynski
     [not found]   ` <CGME20260915153244eucas1p180f69e8f957a5c615d3c6a59a1c205b2@eucas1p1.samsung.com>
2026-09-15 15:32     ` [PATCH v4 17/20] phy: rockchip: inno-hdmi: Use the common Innosilicon " Michal Wilczynski
     [not found]   ` <CGME20260915153246eucas1p289987fd8757c89ff865c99b6465708a8@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 18/20] phy: starfive: Add jh7110-inno-hdmi-phy driver Michal Wilczynski
2026-09-26  3:31       ` Dominique Belhachemi
     [not found]   ` <CGME20260915153248eucas1p27d8d2c9fa536bbd951e0102b04416dad@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 19/20] riscv: dts: starfive: jh7110: Update DT for display subsystem Michal Wilczynski
     [not found]   ` <CGME20260915153250eucas1p2132ca4040b3c35a3aed471cb816b7857@eucas1p2.samsung.com>
2026-09-15 15:32     ` [PATCH v4 20/20] MAINTAINERS: Add StarFive JH7110 display subsystem entry Michal Wilczynski
2026-09-16  0:45   ` [PATCH v4 00/20] drm: starfive: jh7110: Enable display subsystem Joshua Peisach
2026-09-17 17:22     ` Michal Wilczynski
2026-09-18 15:32       ` Joshua Peisach
2026-09-20  6:09   ` Byron Stanoszek
2026-09-20  7:35     ` Icenowy Zheng
2026-09-25 20:09       ` Michal Wilczynski [this message]
2026-09-25 13:55   ` (subset) " Brian Masney

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=0c29c063-0b09-4710-8bf8-1d9adee4eb53@samsung.com \
    --to=m.wilczynski@samsung.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=alex@ghiti.fr \
    --cc=andrzej.hajda@intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bmasney+clk@redhat.com \
    --cc=chaoyi.chen@rock-chips.com \
    --cc=conor+dt@kernel.org \
    --cc=db@domibel.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gandalf@winds.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=jpeisach@ubuntu.com \
    --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=tzimmermann@suse.de \
    --cc=u.kleine-koenig@baylibre.com \
    --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®