mbox series

[v2,00/91] drm/vc4: Support BCM2711 Display Pipeline

Message ID cover.d1e741d37e43e1ba2d2ecd93fc81d42a6df99d14.1587742492.git-series.maxime@cerno.tech (mailing list archive)
Headers show
Series drm/vc4: Support BCM2711 Display Pipeline | expand

Message

Maxime Ripard April 24, 2020, 3:33 p.m. UTC
Hi everyone,

Here's a (pretty long) series to introduce support in the VC4 DRM driver
for the display pipeline found in the BCM2711 (and thus the RaspberryPi 4).

The main differences are that there's two HDMI controllers and that there's
more pixelvalve now. Those pixelvalve come with a mux in the HVS that still
have only 3 FIFOs. Both of those differences are breaking a bunch of
expectations in the driver, so we first need a good bunch of cleanup and
reworks to introduce support for the new controllers.

Similarly, the HDMI controller has all its registers shuffled and split in
multiple controllers now, so we need a bunch of changes to support this as
well.

Only the HDMI support is enabled for now (even though the DPI output has
been tested too). There's a couple of rough edges still that should be
addressed in the next versions:
  - After a modeset, it's likely that the pixels will be shifted by one.
  - Dual output doesn't work
  - The transposer (and thus writeback) doesn't work either and conflicts
    with the output mux too.

Let me know if you have any comments
Maxime

Cc: bcm-kernel-feedback-list@broadcom.com
Cc: devicetree@vger.kernel.org
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-i2c@vger.kernel.org
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Wolfram Sang <wsa@the-dreams.de>

Changes from v1:
  - Rebased on top of 5.7-rc1
  - Run checkpatch
  - Added audio support
  - Fixed some HDMI timeouts
  - Swiched to clk_hw_register_gate_parent_data
  - Reorder Kconfig symbols in drivers/i2c/busses
  - Make the firmware clocks a child of the firmware node
  - Switch DVP clock driver to clk_hw interface
  - constify raspberrypi_clk_data in raspberrypi_clock_property
  - Don't mark firmware clocks as IGNORE_UNUSED
  - Change from reset_ms to reset_us in reset-simple, and add a bit more
    comments
  - Remove generic clk patch to test if a NULL pointer is returned
  - Removed misleading message in the is_prepared renaming patch commit
    message
  - Constify HDMI controller variants
  - Fix a bug in the allocation size of the clk data array
  - Added a mention in the DT binding conversion patches about the breakage
  - Merged a few fixes from kbuild
  - Fixed a few bisection and CEC build issues
  - Collected Acked-by and Reviewed-by
  - Change Dave email address to raspberrypi.com

Dave Stevenson (6):
  drm/vc4: Add support for the BCM2711 HVS5
  drm/vc4: plane: Improve LBM usage
  drm/vc4: hdmi: Use reg-names to retrieve the HDMI audio registers
  drm/vc4: hdmi: Reset audio infoframe on encoder_enable if previously streaming
  drm/vc4: hdmi: Set the b-frame marker to the match ALSA's default.
  drm/vc4: hdmi: Add audio-related callbacks

Florian Fainelli (1):
  dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML

Maxime Ripard (84):
  i2c: brcmstb: Allow to compile it on BCM2835
  dt-bindings: clock: Add a binding for the RPi Firmware clocks
  firmware: rpi: Only create clocks device if we don't have a node for it
  clk: bcm: rpi: Allow the driver to be probed by DT
  clk: bcm: rpi: Statically init clk_init_data
  clk: bcm: rpi: Use clk_hw_register for pllb_arm
  clk: bcm: rpi: Remove global pllb_arm clock pointer
  clk: bcm: rpi: Make sure pllb_arm is removed
  clk: bcm: rpi: Remove pllb_arm_lookup global pointer
  clk: bcm: rpi: Switch to clk_hw_register_clkdev
  clk: bcm: rpi: Make sure the clkdev lookup is removed
  clk: bcm: rpi: Create a data structure for the clocks
  clk: bcm: rpi: Add clock id to data
  clk: bcm: rpi: Pass the clocks data to the firmware function
  clk: bcm: rpi: Rename is_prepared function
  clk: bcm: rpi: Split pllb clock hooks
  clk: bcm: rpi: Make the PLLB registration function return a clk_hw
  clk: bcm: rpi: Add DT provider for the clocks
  clk: bcm: rpi: Discover the firmware clocks
  ARM: dts: bcm2711: Add firmware clocks node
  reset: Move reset-simple header out of drivers/reset
  reset: simple: Add reset callback
  dt-bindings: clock: Add BCM2711 DVP binding
  clk: bcm: Add BCM2711 DVP driver
  ARM: dts: bcm2711: Add HDMI DVP
  dt-bindings: display: Convert VC4 bindings to schemas
  dt-bindings: display: vc4: dpi: Add missing clock-names property
  dt-bindings: display: vc4: dsi: Add missing clock properties
  dt-bindings: display: vc4: hdmi: Add missing clock-names property
  dt-bindings: display: vc4: Document BCM2711 VC5
  drm/vc4: drv: Add include guards
  drm/vc4: drv: Support BCM2711
  dt-bindings: display: Add support for the BCM2711 HVS
  drm/vc4: hvs: Boost the core clock during modeset
  drm/vc4: plane: Move planes creation to its own function
  drm/vc4: plane: Move additional planes creation to driver
  drm/vc4: plane: Register all the planes at once
  drm/vc4: plane: Create overlays for any CRTC
  drm/vc4: plane: Create more planes
  drm/vc4: crtc: Rename SoC data structures
  drm/vc4: crtc: Move crtc state to common header
  drm/vc4: crtc: Deal with different number of pixel per clock
  drm/vc4: crtc: Use a shared interrupt
  drm/vc4: crtc: Turn static const variable into a define
  drm/vc4: crtc: Move the cob allocation outside of bind
  drm/vc4: crtc: Rename HVS channel to output
  drm/vc4: crtc: Use local chan variable
  drm/vc4: crtc: Enable and disable the PV in atomic_enable / disable
  drm/vc4: crtc: Assign output to channel automatically
  drm/vc4: crtc: Add FIFO depth to vc4_crtc_data
  drm/vc4: crtc: Add function to compute FIFO level bits
  drm/vc4: crtc: Rename HDMI encoder type to HDMI0
  drm/vc4: crtc: Add HDMI1 encoder type
  drm/vc4: crtc: Remove redundant call to drm_crtc_enable_color_mgmt
  drm/vc4: crtc: Disable color management for HVS5
  dt-bindings: display: vc4: pv: Add BCM2711 pixel valves
  drm/vc4: crtc: Add BCM2711 pixelvalves
  drm/vc4: hdmi: Use debugfs private field
  drm/vc4: hdmi: Move structure to header
  drm/vc4: hdmi: rework connectors and encoders
  drm/vc4: hdmi: Remove DDC argument to connector_init
  drm/vc4: hdmi: Rename hdmi to vc4_hdmi
  drm/vc4: hdmi: Move accessors to vc4_hdmi
  drm/vc4: hdmi: Use local vc4_hdmi directly
  drm/vc4: hdmi: Add container_of macros for encoders and connectors
  drm/vc4: hdmi: Pass vc4_hdmi to CEC code
  drm/vc4: hdmi: Remove vc4_dev hdmi pointer
  drm/vc4: hdmi: Remove vc4_hdmi_connector
  drm/vc4: hdmi: Introduce resource init and variant
  drm/vc4: hdmi: Implement a register layout abstraction
  drm/vc4: hdmi: Add reset callback
  drm/vc4: hdmi: Add PHY init and disable function
  drm/vc4: hdmi: Add PHY RNG enable / disable function
  drm/vc4: hdmi: Add a CSC setup callback
  drm/vc4: hdmi: Store the encoder type in the variant structure
  drm/vc4: hdmi: Deal with multiple debugfs files
  drm/vc4: hdmi: Move CEC init to its own function
  drm/vc4: hdmi: Add CEC support flag
  drm/vc4: hdmi: Remove unused CEC_CLOCK_DIV define
  drm/vc4: hdmi: Rename drm_encoder pointer in mode_valid
  drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate
  drm/vc4: hdmi: Support the BCM2711 HDMI controllers
  dt-bindings: display: vc4: hdmi: Add BCM2711 HDMI controllers bindings
  ARM: dts: bcm2711: Enable the display pipeline

 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.txt  |   14 +-
 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml |   59 +++-
 Documentation/devicetree/bindings/clock/brcm,bcm2711-dvp.yaml               |   47 ++-
 Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt                  |  174 +--------
 Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml            |  109 +++++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-dpi.yaml             |   72 +++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-dsi0.yaml            |   84 ++++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-hdmi.yaml            |   80 ++++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-hvs.yaml             |   53 ++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-pixelvalve0.yaml     |   45 ++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-txp.yaml             |   37 ++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-v3d.yaml             |   42 ++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-vc4.yaml             |   35 ++-
 Documentation/devicetree/bindings/display/brcm,bcm2835-vec.yaml             |   44 ++-
 MAINTAINERS                                                                 |    2 +-
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts                                       |   51 ++-
 arch/arm/boot/dts/bcm2711.dtsi                                              |  130 +++++-
 drivers/clk/bcm/Kconfig                                                     |    1 +-
 drivers/clk/bcm/Makefile                                                    |    1 +-
 drivers/clk/bcm/clk-bcm2711-dvp.c                                           |  127 ++++++-
 drivers/clk/bcm/clk-raspberrypi.c                                           |  280 +++++++++----
 drivers/firmware/raspberrypi.c                                              |   17 +-
 drivers/gpu/drm/vc4/Makefile                                                |    1 +-
 drivers/gpu/drm/vc4/vc4_crtc.c                                              |  328 +++++++++------
 drivers/gpu/drm/vc4/vc4_drv.c                                               |    5 +-
 drivers/gpu/drm/vc4/vc4_drv.h                                               |   58 ++-
 drivers/gpu/drm/vc4/vc4_hdmi.c                                              | 1536 ++++++++++++++++++++++++++++++++++++++++++------------------------------
 drivers/gpu/drm/vc4/vc4_hdmi.h                                              |  179 ++++++++-
 drivers/gpu/drm/vc4/vc4_hdmi_phy.c                                          |  508 ++++++++++++++++++++++++-
 drivers/gpu/drm/vc4/vc4_hdmi_regs.h                                         |  451 +++++++++++++++++++++-
 drivers/gpu/drm/vc4/vc4_hvs.c                                               |   25 +-
 drivers/gpu/drm/vc4/vc4_kms.c                                               |  181 +++++++-
 drivers/gpu/drm/vc4/vc4_plane.c                                             |  271 +++++++++----
 drivers/gpu/drm/vc4/vc4_regs.h                                              |  173 +++-----
 drivers/i2c/busses/Kconfig                                                  |    4 +-
 drivers/reset/reset-simple.c                                                |   27 +-
 drivers/reset/reset-simple.h                                                |   41 +--
 drivers/reset/reset-socfpga.c                                               |    3 +-
 drivers/reset/reset-sunxi.c                                                 |    3 +-
 drivers/reset/reset-uniphier-glue.c                                         |    3 +-
 include/linux/reset/reset-simple.h                                          |   47 ++-
 include/soc/bcm2835/raspberrypi-firmware.h                                  |    5 +-
 42 files changed, 4109 insertions(+), 1244 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.txt
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
 create mode 100644 Documentation/devicetree/bindings/clock/brcm,bcm2711-dvp.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-dpi.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-dsi0.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-hdmi.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-hvs.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-pixelvalve0.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-txp.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-v3d.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-vc4.yaml
 create mode 100644 Documentation/devicetree/bindings/display/brcm,bcm2835-vec.yaml
 create mode 100644 drivers/clk/bcm/clk-bcm2711-dvp.c
 create mode 100644 drivers/gpu/drm/vc4/vc4_hdmi.h
 create mode 100644 drivers/gpu/drm/vc4/vc4_hdmi_phy.c
 create mode 100644 drivers/gpu/drm/vc4/vc4_hdmi_regs.h
 delete mode 100644 drivers/reset/reset-simple.h
 create mode 100644 include/linux/reset/reset-simple.h

base-commit: cb3692197b5da2fb898335eec1640db14d92e52e

Comments

Jian-Hong Pan April 27, 2020, 7:23 a.m. UTC | #1
Hi Maxime,

Thanks for your V2 patch series!  I'm testing it.

This patch series is applied upon mainline kernel 5.7-rc2 cleanly and built.
System can boot into console text mode, but no graphic UI.

Get the error in vc5_hdmi_phy_init(), and full dmesg is at [1]:

[    5.587543] vc4_hdmi fef00700.hdmi: Unknown register ID 46
[    5.587700] debugfs: Directory 'fef00700.hdmi' with parent 'vc4-hdmi' already present!
[    5.588070] vc4_hdmi fef00700.hdmi: vc4-hdmi-hifi <-> fef00700.hdmi mapping ok
[    5.588076] vc4_hdmi fef00700.hdmi: ASoC: no DMI vendor name!
[    5.588263] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
[    5.588299] vc4_hdmi fef05700.hdmi: Unknown register ID 46
[    5.588373] debugfs: Directory 'vc4-hdmi' with parent 'asoc' already present!
[    5.588673] vc4_hdmi fef05700.hdmi: vc4-hdmi-hifi <-> fef05700.hdmi mapping ok
[    5.588677] vc4_hdmi fef05700.hdmi: ASoC: no DMI vendor name!
[    5.588809] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
[    5.588854] vc4-drm gpu: bound fe806000.vec (ops vc4_vec_ops)
[    5.588897] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
[    5.588934] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    5.588990] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
[    5.589030] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
[    5.589074] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
[    5.589106] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
[    5.589145] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
[    5.589294] checking generic (3e513000 6d8c00) vs hw (0 ffffffffffffffff)
[    5.589297] fb0: switching to vc4drmfb from simple
[    5.589433] Console: switching to colour dummy device 80x25
[    5.589481] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    5.589816] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
[    5.601079] ------------[ cut here ]------------
[    5.601095] WARNING: CPU: 2 PID: 127 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:413 vc5_hdmi_phy_init+0x7ac/0x2078
[    5.601097] Modules linked in:
[    5.601103] CPU: 2 PID: 127 Comm: kworker/2:1 Not tainted 5.7.0-rc2-00091-ga181df59a930 #7
[    5.601105] Hardware name: Raspberry Pi 4 Model B (DT)
[    5.601112] Workqueue: events deferred_probe_work_func
[    5.601116] pstate: 20000005 (nzCv daif -PAN -UAO)
[    5.601119] pc : vc5_hdmi_phy_init+0x7ac/0x2078
[    5.601123] lr : vc4_hdmi_encoder_enable+0x1b8/0x1ac0
[    5.601124] sp : ffff80001217b410
[    5.601126] x29: ffff80001217b410 x28: ffff0000ec6370f0 
[    5.601129] x27: ffff0000f650d400 x26: 000000008a500000 
[    5.601132] x25: ffff8000113b4ac0 x24: 0000000000002060 
[    5.601135] x23: 000000000a500000 x22: 0000000000000300 
[    5.601137] x21: 0000000008d9ee20 x20: ffff0000ec535080 
[    5.601140] x19: 000000010989e7c0 x18: 0000000000000000 
[    5.601142] x17: 0000000000000001 x16: 0000000000005207 
[    5.601145] x15: 00004932ad293c92 x14: 0000000000000137 
[    5.601147] x13: ffff800010015000 x12: 0000000000000001 
[    5.601150] x11: 0000000000000001 x10: 0000000000000000 
[    5.601152] x9 : 0000000000000000 x8 : ffff800010015038 
[    5.601154] x7 : 0000000000000001 x6 : ffff80001217b368 
[    5.601157] x5 : 0000000000000000 x4 : 000000000000004c 
[    5.601159] x3 : 0000000000000000 x2 : ffff8000113b4ac0 
[    5.601162] x1 : ffff8000120c5f44 x0 : 00000000dc8984ff 
[    5.601164] Call trace:
[    5.601169]  vc5_hdmi_phy_init+0x7ac/0x2078
[    5.601172]  vc4_hdmi_encoder_enable+0x1b8/0x1ac0
[    5.601176]  drm_atomic_helper_commit_modeset_enables+0x224/0x248
[    5.601179]  vc4_atomic_complete_commit+0x400/0x558
[    5.601182]  vc4_atomic_commit+0x1e0/0x200
[    5.601185]  drm_atomic_commit+0x4c/0x60
[    5.601190]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238
[    5.601192]  drm_client_modeset_commit_locked+0x5c/0x198
[    5.601195]  drm_client_modeset_commit+0x30/0x58
[    5.601201]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xe0
[    5.601204]  drm_fb_helper_set_par+0x30/0x68
[    5.601208]  fbcon_init+0x3d4/0x598
[    5.601212]  visual_init+0xb0/0x108
[    5.601214]  do_bind_con_driver+0x1d0/0x3a8
[    5.601217]  do_take_over_console+0x144/0x208
[    5.601219]  do_fbcon_takeover+0x68/0xd8
[    5.601222]  fbcon_fb_registered+0x100/0x118
[    5.601226]  register_framebuffer+0x1f4/0x338
[    5.601229]  __drm_fb_helper_initial_config_and_unlock+0x2f8/0x4a0
[    5.601232]  drm_fbdev_client_hotplug+0xd4/0x1b0
[    5.601235]  drm_fbdev_generic_setup+0xb0/0x130
[    5.601238]  vc4_drm_bind+0x184/0x1a0
[    5.601241]  try_to_bring_up_master+0x168/0x1c8
[    5.601244]  __component_add+0xa4/0x170
[    5.601246]  component_add+0x14/0x20
[    5.601248]  vc4_vec_dev_probe+0x20/0x30
[    5.601252]  platform_drv_probe+0x54/0xa8
[    5.601254]  really_probe+0xd8/0x320
[    5.601256]  driver_probe_device+0x58/0xf0
[    5.601258]  __device_attach_driver+0x84/0xc8
[    5.601263]  bus_for_each_drv+0x78/0xc8
[    5.601265]  __device_attach+0xe4/0x140
[    5.601267]  device_initial_probe+0x14/0x20
[    5.601269]  bus_probe_device+0x9c/0xa8
[    5.601271]  deferred_probe_work_func+0x74/0xb0
[    5.601276]  process_one_work+0x1bc/0x338
[    5.601279]  worker_thread+0x1f8/0x428
[    5.601282]  kthread+0x138/0x158
[    5.601286]  ret_from_fork+0x10/0x1c
[    5.601288] ---[ end trace cfba0996218c3f3d ]---

[1]: https://gist.github.com/starnight/2236cf350737e3b0e9f05135fc7c910e

Jian-Hong Pan
Maxime Ripard April 28, 2020, 4:21 p.m. UTC | #2
Hi,

On Mon, Apr 27, 2020 at 03:23:42PM +0800, Jian-Hong Pan wrote:
> Hi Maxime,
> 
> Thanks for your V2 patch series!  I'm testing it.
> 
> This patch series is applied upon mainline kernel 5.7-rc2 cleanly and built.
> System can boot into console text mode, but no graphic UI.
> 
> Get the error in vc5_hdmi_phy_init(), and full dmesg is at [1]:
> 
> [    5.587543] vc4_hdmi fef00700.hdmi: Unknown register ID 46
> [    5.587700] debugfs: Directory 'fef00700.hdmi' with parent 'vc4-hdmi' already present!
> [    5.588070] vc4_hdmi fef00700.hdmi: vc4-hdmi-hifi <-> fef00700.hdmi mapping ok
> [    5.588076] vc4_hdmi fef00700.hdmi: ASoC: no DMI vendor name!
> [    5.588263] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
> [    5.588299] vc4_hdmi fef05700.hdmi: Unknown register ID 46
> [    5.588373] debugfs: Directory 'vc4-hdmi' with parent 'asoc' already present!
> [    5.588673] vc4_hdmi fef05700.hdmi: vc4-hdmi-hifi <-> fef05700.hdmi mapping ok
> [    5.588677] vc4_hdmi fef05700.hdmi: ASoC: no DMI vendor name!
> [    5.588809] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
> [    5.588854] vc4-drm gpu: bound fe806000.vec (ops vc4_vec_ops)
> [    5.588897] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
> [    5.588934] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
> [    5.588990] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
> [    5.589030] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
> [    5.589074] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
> [    5.589106] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
> [    5.589145] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
> [    5.589294] checking generic (3e513000 6d8c00) vs hw (0 ffffffffffffffff)
> [    5.589297] fb0: switching to vc4drmfb from simple
> [    5.589433] Console: switching to colour dummy device 80x25
> [    5.589481] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> [    5.589816] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
> [    5.601079] ------------[ cut here ]------------
> [    5.601095] WARNING: CPU: 2 PID: 127 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:413 vc5_hdmi_phy_init+0x7ac/0x2078
> [    5.601097] Modules linked in:
> [    5.601103] CPU: 2 PID: 127 Comm: kworker/2:1 Not tainted 5.7.0-rc2-00091-ga181df59a930 #7
> [    5.601105] Hardware name: Raspberry Pi 4 Model B (DT)
> [    5.601112] Workqueue: events deferred_probe_work_func
> [    5.601116] pstate: 20000005 (nzCv daif -PAN -UAO)
> [    5.601119] pc : vc5_hdmi_phy_init+0x7ac/0x2078
> [    5.601123] lr : vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> [    5.601124] sp : ffff80001217b410
> [    5.601126] x29: ffff80001217b410 x28: ffff0000ec6370f0 
> [    5.601129] x27: ffff0000f650d400 x26: 000000008a500000 
> [    5.601132] x25: ffff8000113b4ac0 x24: 0000000000002060 
> [    5.601135] x23: 000000000a500000 x22: 0000000000000300 
> [    5.601137] x21: 0000000008d9ee20 x20: ffff0000ec535080 
> [    5.601140] x19: 000000010989e7c0 x18: 0000000000000000 
> [    5.601142] x17: 0000000000000001 x16: 0000000000005207 
> [    5.601145] x15: 00004932ad293c92 x14: 0000000000000137 
> [    5.601147] x13: ffff800010015000 x12: 0000000000000001 
> [    5.601150] x11: 0000000000000001 x10: 0000000000000000 
> [    5.601152] x9 : 0000000000000000 x8 : ffff800010015038 
> [    5.601154] x7 : 0000000000000001 x6 : ffff80001217b368 
> [    5.601157] x5 : 0000000000000000 x4 : 000000000000004c 
> [    5.601159] x3 : 0000000000000000 x2 : ffff8000113b4ac0 
> [    5.601162] x1 : ffff8000120c5f44 x0 : 00000000dc8984ff 
> [    5.601164] Call trace:
> [    5.601169]  vc5_hdmi_phy_init+0x7ac/0x2078
> [    5.601172]  vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> [    5.601176]  drm_atomic_helper_commit_modeset_enables+0x224/0x248
> [    5.601179]  vc4_atomic_complete_commit+0x400/0x558
> [    5.601182]  vc4_atomic_commit+0x1e0/0x200
> [    5.601185]  drm_atomic_commit+0x4c/0x60
> [    5.601190]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238
> [    5.601192]  drm_client_modeset_commit_locked+0x5c/0x198
> [    5.601195]  drm_client_modeset_commit+0x30/0x58
> [    5.601201]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xe0
> [    5.601204]  drm_fb_helper_set_par+0x30/0x68
> [    5.601208]  fbcon_init+0x3d4/0x598
> [    5.601212]  visual_init+0xb0/0x108
> [    5.601214]  do_bind_con_driver+0x1d0/0x3a8
> [    5.601217]  do_take_over_console+0x144/0x208
> [    5.601219]  do_fbcon_takeover+0x68/0xd8
> [    5.601222]  fbcon_fb_registered+0x100/0x118
> [    5.601226]  register_framebuffer+0x1f4/0x338
> [    5.601229]  __drm_fb_helper_initial_config_and_unlock+0x2f8/0x4a0
> [    5.601232]  drm_fbdev_client_hotplug+0xd4/0x1b0
> [    5.601235]  drm_fbdev_generic_setup+0xb0/0x130
> [    5.601238]  vc4_drm_bind+0x184/0x1a0
> [    5.601241]  try_to_bring_up_master+0x168/0x1c8
> [    5.601244]  __component_add+0xa4/0x170
> [    5.601246]  component_add+0x14/0x20
> [    5.601248]  vc4_vec_dev_probe+0x20/0x30
> [    5.601252]  platform_drv_probe+0x54/0xa8
> [    5.601254]  really_probe+0xd8/0x320
> [    5.601256]  driver_probe_device+0x58/0xf0
> [    5.601258]  __device_attach_driver+0x84/0xc8
> [    5.601263]  bus_for_each_drv+0x78/0xc8
> [    5.601265]  __device_attach+0xe4/0x140
> [    5.601267]  device_initial_probe+0x14/0x20
> [    5.601269]  bus_probe_device+0x9c/0xa8
> [    5.601271]  deferred_probe_work_func+0x74/0xb0
> [    5.601276]  process_one_work+0x1bc/0x338
> [    5.601279]  worker_thread+0x1f8/0x428
> [    5.601282]  kthread+0x138/0x158
> [    5.601286]  ret_from_fork+0x10/0x1c
> [    5.601288] ---[ end trace cfba0996218c3f3d ]---

Thanks for testing!

Do you have a bit more details regarding your setup? Was it connected to an
external display? If so, do you know the resolution it was trying to setup?

Thanks!
Maxime
Jian-Hong Pan May 4, 2020, 6:35 a.m. UTC | #3
Maxime Ripard <maxime@cerno.tech> 於 2020年4月29日 週三 上午12:21寫道:
>
> Hi,
>
> On Mon, Apr 27, 2020 at 03:23:42PM +0800, Jian-Hong Pan wrote:
> > Hi Maxime,
> >
> > Thanks for your V2 patch series!  I'm testing it.
> >
> > This patch series is applied upon mainline kernel 5.7-rc2 cleanly and built.
> > System can boot into console text mode, but no graphic UI.
> >
> > Get the error in vc5_hdmi_phy_init(), and full dmesg is at [1]:
> >
> > [    5.587543] vc4_hdmi fef00700.hdmi: Unknown register ID 46
> > [    5.587700] debugfs: Directory 'fef00700.hdmi' with parent 'vc4-hdmi' already present!
> > [    5.588070] vc4_hdmi fef00700.hdmi: vc4-hdmi-hifi <-> fef00700.hdmi mapping ok
> > [    5.588076] vc4_hdmi fef00700.hdmi: ASoC: no DMI vendor name!
> > [    5.588263] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
> > [    5.588299] vc4_hdmi fef05700.hdmi: Unknown register ID 46
> > [    5.588373] debugfs: Directory 'vc4-hdmi' with parent 'asoc' already present!
> > [    5.588673] vc4_hdmi fef05700.hdmi: vc4-hdmi-hifi <-> fef05700.hdmi mapping ok
> > [    5.588677] vc4_hdmi fef05700.hdmi: ASoC: no DMI vendor name!
> > [    5.588809] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
> > [    5.588854] vc4-drm gpu: bound fe806000.vec (ops vc4_vec_ops)
> > [    5.588897] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
> > [    5.588934] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
> > [    5.588990] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
> > [    5.589030] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
> > [    5.589074] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
> > [    5.589106] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
> > [    5.589145] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
> > [    5.589294] checking generic (3e513000 6d8c00) vs hw (0 ffffffffffffffff)
> > [    5.589297] fb0: switching to vc4drmfb from simple
> > [    5.589433] Console: switching to colour dummy device 80x25
> > [    5.589481] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> > [    5.589816] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
> > [    5.601079] ------------[ cut here ]------------
> > [    5.601095] WARNING: CPU: 2 PID: 127 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:413 vc5_hdmi_phy_init+0x7ac/0x2078
> > [    5.601097] Modules linked in:
> > [    5.601103] CPU: 2 PID: 127 Comm: kworker/2:1 Not tainted 5.7.0-rc2-00091-ga181df59a930 #7
> > [    5.601105] Hardware name: Raspberry Pi 4 Model B (DT)
> > [    5.601112] Workqueue: events deferred_probe_work_func
> > [    5.601116] pstate: 20000005 (nzCv daif -PAN -UAO)
> > [    5.601119] pc : vc5_hdmi_phy_init+0x7ac/0x2078
> > [    5.601123] lr : vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > [    5.601124] sp : ffff80001217b410
> > [    5.601126] x29: ffff80001217b410 x28: ffff0000ec6370f0
> > [    5.601129] x27: ffff0000f650d400 x26: 000000008a500000
> > [    5.601132] x25: ffff8000113b4ac0 x24: 0000000000002060
> > [    5.601135] x23: 000000000a500000 x22: 0000000000000300
> > [    5.601137] x21: 0000000008d9ee20 x20: ffff0000ec535080
> > [    5.601140] x19: 000000010989e7c0 x18: 0000000000000000
> > [    5.601142] x17: 0000000000000001 x16: 0000000000005207
> > [    5.601145] x15: 00004932ad293c92 x14: 0000000000000137
> > [    5.601147] x13: ffff800010015000 x12: 0000000000000001
> > [    5.601150] x11: 0000000000000001 x10: 0000000000000000
> > [    5.601152] x9 : 0000000000000000 x8 : ffff800010015038
> > [    5.601154] x7 : 0000000000000001 x6 : ffff80001217b368
> > [    5.601157] x5 : 0000000000000000 x4 : 000000000000004c
> > [    5.601159] x3 : 0000000000000000 x2 : ffff8000113b4ac0
> > [    5.601162] x1 : ffff8000120c5f44 x0 : 00000000dc8984ff
> > [    5.601164] Call trace:
> > [    5.601169]  vc5_hdmi_phy_init+0x7ac/0x2078
> > [    5.601172]  vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > [    5.601176]  drm_atomic_helper_commit_modeset_enables+0x224/0x248
> > [    5.601179]  vc4_atomic_complete_commit+0x400/0x558
> > [    5.601182]  vc4_atomic_commit+0x1e0/0x200
> > [    5.601185]  drm_atomic_commit+0x4c/0x60
> > [    5.601190]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238
> > [    5.601192]  drm_client_modeset_commit_locked+0x5c/0x198
> > [    5.601195]  drm_client_modeset_commit+0x30/0x58
> > [    5.601201]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xe0
> > [    5.601204]  drm_fb_helper_set_par+0x30/0x68
> > [    5.601208]  fbcon_init+0x3d4/0x598
> > [    5.601212]  visual_init+0xb0/0x108
> > [    5.601214]  do_bind_con_driver+0x1d0/0x3a8
> > [    5.601217]  do_take_over_console+0x144/0x208
> > [    5.601219]  do_fbcon_takeover+0x68/0xd8
> > [    5.601222]  fbcon_fb_registered+0x100/0x118
> > [    5.601226]  register_framebuffer+0x1f4/0x338
> > [    5.601229]  __drm_fb_helper_initial_config_and_unlock+0x2f8/0x4a0
> > [    5.601232]  drm_fbdev_client_hotplug+0xd4/0x1b0
> > [    5.601235]  drm_fbdev_generic_setup+0xb0/0x130
> > [    5.601238]  vc4_drm_bind+0x184/0x1a0
> > [    5.601241]  try_to_bring_up_master+0x168/0x1c8
> > [    5.601244]  __component_add+0xa4/0x170
> > [    5.601246]  component_add+0x14/0x20
> > [    5.601248]  vc4_vec_dev_probe+0x20/0x30
> > [    5.601252]  platform_drv_probe+0x54/0xa8
> > [    5.601254]  really_probe+0xd8/0x320
> > [    5.601256]  driver_probe_device+0x58/0xf0
> > [    5.601258]  __device_attach_driver+0x84/0xc8
> > [    5.601263]  bus_for_each_drv+0x78/0xc8
> > [    5.601265]  __device_attach+0xe4/0x140
> > [    5.601267]  device_initial_probe+0x14/0x20
> > [    5.601269]  bus_probe_device+0x9c/0xa8
> > [    5.601271]  deferred_probe_work_func+0x74/0xb0
> > [    5.601276]  process_one_work+0x1bc/0x338
> > [    5.601279]  worker_thread+0x1f8/0x428
> > [    5.601282]  kthread+0x138/0x158
> > [    5.601286]  ret_from_fork+0x10/0x1c
> > [    5.601288] ---[ end trace cfba0996218c3f3d ]---
>
> Thanks for testing!
>
> Do you have a bit more details regarding your setup? Was it connected to an
> external display?

Yes, the HDMI cable is connected to HDMI0 port on RPi 4.

> If so, do you know the resolution it was trying to setup?

According to the log, I think it is 1920x1080:
Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
HDMI-1 connected
Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
HDMI-2 disconnected
Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
Composite-1 disconnected
Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Using
exact sizes for initial modes
Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
HDMI-1 using initial mode 1920x1080 +0+0

https://gist.github.com/starnight/45e1468bfa0426a54d2fb4a9269cfb94

Regards,
Jian-Hong Pan
Maxime Ripard May 7, 2020, 5:21 p.m. UTC | #4
On Mon, May 04, 2020 at 02:35:08PM +0800, Jian-Hong Pan wrote:
> Maxime Ripard <maxime@cerno.tech> 於 2020年4月29日 週三 上午12:21寫道:
> >
> > Hi,
> >
> > On Mon, Apr 27, 2020 at 03:23:42PM +0800, Jian-Hong Pan wrote:
> > > Hi Maxime,
> > >
> > > Thanks for your V2 patch series!  I'm testing it.
> > >
> > > This patch series is applied upon mainline kernel 5.7-rc2 cleanly and built.
> > > System can boot into console text mode, but no graphic UI.
> > >
> > > Get the error in vc5_hdmi_phy_init(), and full dmesg is at [1]:
> > >
> > > [    5.587543] vc4_hdmi fef00700.hdmi: Unknown register ID 46
> > > [    5.587700] debugfs: Directory 'fef00700.hdmi' with parent 'vc4-hdmi' already present!
> > > [    5.588070] vc4_hdmi fef00700.hdmi: vc4-hdmi-hifi <-> fef00700.hdmi mapping ok
> > > [    5.588076] vc4_hdmi fef00700.hdmi: ASoC: no DMI vendor name!
> > > [    5.588263] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
> > > [    5.588299] vc4_hdmi fef05700.hdmi: Unknown register ID 46
> > > [    5.588373] debugfs: Directory 'vc4-hdmi' with parent 'asoc' already present!
> > > [    5.588673] vc4_hdmi fef05700.hdmi: vc4-hdmi-hifi <-> fef05700.hdmi mapping ok
> > > [    5.588677] vc4_hdmi fef05700.hdmi: ASoC: no DMI vendor name!
> > > [    5.588809] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
> > > [    5.588854] vc4-drm gpu: bound fe806000.vec (ops vc4_vec_ops)
> > > [    5.588897] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
> > > [    5.588934] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
> > > [    5.588990] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
> > > [    5.589030] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
> > > [    5.589074] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
> > > [    5.589106] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
> > > [    5.589145] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
> > > [    5.589294] checking generic (3e513000 6d8c00) vs hw (0 ffffffffffffffff)
> > > [    5.589297] fb0: switching to vc4drmfb from simple
> > > [    5.589433] Console: switching to colour dummy device 80x25
> > > [    5.589481] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> > > [    5.589816] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
> > > [    5.601079] ------------[ cut here ]------------
> > > [    5.601095] WARNING: CPU: 2 PID: 127 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:413 vc5_hdmi_phy_init+0x7ac/0x2078
> > > [    5.601097] Modules linked in:
> > > [    5.601103] CPU: 2 PID: 127 Comm: kworker/2:1 Not tainted 5.7.0-rc2-00091-ga181df59a930 #7
> > > [    5.601105] Hardware name: Raspberry Pi 4 Model B (DT)
> > > [    5.601112] Workqueue: events deferred_probe_work_func
> > > [    5.601116] pstate: 20000005 (nzCv daif -PAN -UAO)
> > > [    5.601119] pc : vc5_hdmi_phy_init+0x7ac/0x2078
> > > [    5.601123] lr : vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > [    5.601124] sp : ffff80001217b410
> > > [    5.601126] x29: ffff80001217b410 x28: ffff0000ec6370f0
> > > [    5.601129] x27: ffff0000f650d400 x26: 000000008a500000
> > > [    5.601132] x25: ffff8000113b4ac0 x24: 0000000000002060
> > > [    5.601135] x23: 000000000a500000 x22: 0000000000000300
> > > [    5.601137] x21: 0000000008d9ee20 x20: ffff0000ec535080
> > > [    5.601140] x19: 000000010989e7c0 x18: 0000000000000000
> > > [    5.601142] x17: 0000000000000001 x16: 0000000000005207
> > > [    5.601145] x15: 00004932ad293c92 x14: 0000000000000137
> > > [    5.601147] x13: ffff800010015000 x12: 0000000000000001
> > > [    5.601150] x11: 0000000000000001 x10: 0000000000000000
> > > [    5.601152] x9 : 0000000000000000 x8 : ffff800010015038
> > > [    5.601154] x7 : 0000000000000001 x6 : ffff80001217b368
> > > [    5.601157] x5 : 0000000000000000 x4 : 000000000000004c
> > > [    5.601159] x3 : 0000000000000000 x2 : ffff8000113b4ac0
> > > [    5.601162] x1 : ffff8000120c5f44 x0 : 00000000dc8984ff
> > > [    5.601164] Call trace:
> > > [    5.601169]  vc5_hdmi_phy_init+0x7ac/0x2078
> > > [    5.601172]  vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > [    5.601176]  drm_atomic_helper_commit_modeset_enables+0x224/0x248
> > > [    5.601179]  vc4_atomic_complete_commit+0x400/0x558
> > > [    5.601182]  vc4_atomic_commit+0x1e0/0x200
> > > [    5.601185]  drm_atomic_commit+0x4c/0x60
> > > [    5.601190]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238
> > > [    5.601192]  drm_client_modeset_commit_locked+0x5c/0x198
> > > [    5.601195]  drm_client_modeset_commit+0x30/0x58
> > > [    5.601201]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xe0
> > > [    5.601204]  drm_fb_helper_set_par+0x30/0x68
> > > [    5.601208]  fbcon_init+0x3d4/0x598
> > > [    5.601212]  visual_init+0xb0/0x108
> > > [    5.601214]  do_bind_con_driver+0x1d0/0x3a8
> > > [    5.601217]  do_take_over_console+0x144/0x208
> > > [    5.601219]  do_fbcon_takeover+0x68/0xd8
> > > [    5.601222]  fbcon_fb_registered+0x100/0x118
> > > [    5.601226]  register_framebuffer+0x1f4/0x338
> > > [    5.601229]  __drm_fb_helper_initial_config_and_unlock+0x2f8/0x4a0
> > > [    5.601232]  drm_fbdev_client_hotplug+0xd4/0x1b0
> > > [    5.601235]  drm_fbdev_generic_setup+0xb0/0x130
> > > [    5.601238]  vc4_drm_bind+0x184/0x1a0
> > > [    5.601241]  try_to_bring_up_master+0x168/0x1c8
> > > [    5.601244]  __component_add+0xa4/0x170
> > > [    5.601246]  component_add+0x14/0x20
> > > [    5.601248]  vc4_vec_dev_probe+0x20/0x30
> > > [    5.601252]  platform_drv_probe+0x54/0xa8
> > > [    5.601254]  really_probe+0xd8/0x320
> > > [    5.601256]  driver_probe_device+0x58/0xf0
> > > [    5.601258]  __device_attach_driver+0x84/0xc8
> > > [    5.601263]  bus_for_each_drv+0x78/0xc8
> > > [    5.601265]  __device_attach+0xe4/0x140
> > > [    5.601267]  device_initial_probe+0x14/0x20
> > > [    5.601269]  bus_probe_device+0x9c/0xa8
> > > [    5.601271]  deferred_probe_work_func+0x74/0xb0
> > > [    5.601276]  process_one_work+0x1bc/0x338
> > > [    5.601279]  worker_thread+0x1f8/0x428
> > > [    5.601282]  kthread+0x138/0x158
> > > [    5.601286]  ret_from_fork+0x10/0x1c
> > > [    5.601288] ---[ end trace cfba0996218c3f3d ]---
> >
> > Thanks for testing!
> >
> > Do you have a bit more details regarding your setup? Was it connected to an
> > external display?
> 
> Yes, the HDMI cable is connected to HDMI0 port on RPi 4.
> 
> > If so, do you know the resolution it was trying to setup?
> 
> According to the log, I think it is 1920x1080:
> Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> HDMI-1 connected
> Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> HDMI-2 disconnected
> Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> Composite-1 disconnected
> Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Using
> exact sizes for initial modes
> Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> HDMI-1 using initial mode 1920x1080 +0+0
> 
> https://gist.github.com/starnight/45e1468bfa0426a54d2fb4a9269cfb94

It looks to be fairly standard then, and I'm testing on the same resolution so
it should be alright.

Given from your log, it looks like you're running as arm64 though, while I stuck
with arm32, so it could be the explanation.

Can you share your config.txt and .config so that I can try to reproduce it
here?

Thanks!
Maxime
Jian-Hong Pan May 8, 2020, 6:20 a.m. UTC | #5
Maxime Ripard <maxime@cerno.tech> 於 2020年5月8日 週五 上午1:22寫道:
>
> On Mon, May 04, 2020 at 02:35:08PM +0800, Jian-Hong Pan wrote:
> > Maxime Ripard <maxime@cerno.tech> 於 2020年4月29日 週三 上午12:21寫道:
> > >
> > > Hi,
> > >
> > > On Mon, Apr 27, 2020 at 03:23:42PM +0800, Jian-Hong Pan wrote:
> > > > Hi Maxime,
> > > >
> > > > Thanks for your V2 patch series!  I'm testing it.
> > > >
> > > > This patch series is applied upon mainline kernel 5.7-rc2 cleanly and built.
> > > > System can boot into console text mode, but no graphic UI.
> > > >
> > > > Get the error in vc5_hdmi_phy_init(), and full dmesg is at [1]:
> > > >
> > > > [    5.587543] vc4_hdmi fef00700.hdmi: Unknown register ID 46
> > > > [    5.587700] debugfs: Directory 'fef00700.hdmi' with parent 'vc4-hdmi' already present!
> > > > [    5.588070] vc4_hdmi fef00700.hdmi: vc4-hdmi-hifi <-> fef00700.hdmi mapping ok
> > > > [    5.588076] vc4_hdmi fef00700.hdmi: ASoC: no DMI vendor name!
> > > > [    5.588263] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
> > > > [    5.588299] vc4_hdmi fef05700.hdmi: Unknown register ID 46
> > > > [    5.588373] debugfs: Directory 'vc4-hdmi' with parent 'asoc' already present!
> > > > [    5.588673] vc4_hdmi fef05700.hdmi: vc4-hdmi-hifi <-> fef05700.hdmi mapping ok
> > > > [    5.588677] vc4_hdmi fef05700.hdmi: ASoC: no DMI vendor name!
> > > > [    5.588809] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
> > > > [    5.588854] vc4-drm gpu: bound fe806000.vec (ops vc4_vec_ops)
> > > > [    5.588897] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
> > > > [    5.588934] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
> > > > [    5.588990] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
> > > > [    5.589030] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
> > > > [    5.589074] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
> > > > [    5.589106] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
> > > > [    5.589145] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
> > > > [    5.589294] checking generic (3e513000 6d8c00) vs hw (0 ffffffffffffffff)
> > > > [    5.589297] fb0: switching to vc4drmfb from simple
> > > > [    5.589433] Console: switching to colour dummy device 80x25
> > > > [    5.589481] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> > > > [    5.589816] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
> > > > [    5.601079] ------------[ cut here ]------------
> > > > [    5.601095] WARNING: CPU: 2 PID: 127 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:413 vc5_hdmi_phy_init+0x7ac/0x2078
> > > > [    5.601097] Modules linked in:
> > > > [    5.601103] CPU: 2 PID: 127 Comm: kworker/2:1 Not tainted 5.7.0-rc2-00091-ga181df59a930 #7
> > > > [    5.601105] Hardware name: Raspberry Pi 4 Model B (DT)
> > > > [    5.601112] Workqueue: events deferred_probe_work_func
> > > > [    5.601116] pstate: 20000005 (nzCv daif -PAN -UAO)
> > > > [    5.601119] pc : vc5_hdmi_phy_init+0x7ac/0x2078
> > > > [    5.601123] lr : vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > > [    5.601124] sp : ffff80001217b410
> > > > [    5.601126] x29: ffff80001217b410 x28: ffff0000ec6370f0
> > > > [    5.601129] x27: ffff0000f650d400 x26: 000000008a500000
> > > > [    5.601132] x25: ffff8000113b4ac0 x24: 0000000000002060
> > > > [    5.601135] x23: 000000000a500000 x22: 0000000000000300
> > > > [    5.601137] x21: 0000000008d9ee20 x20: ffff0000ec535080
> > > > [    5.601140] x19: 000000010989e7c0 x18: 0000000000000000
> > > > [    5.601142] x17: 0000000000000001 x16: 0000000000005207
> > > > [    5.601145] x15: 00004932ad293c92 x14: 0000000000000137
> > > > [    5.601147] x13: ffff800010015000 x12: 0000000000000001
> > > > [    5.601150] x11: 0000000000000001 x10: 0000000000000000
> > > > [    5.601152] x9 : 0000000000000000 x8 : ffff800010015038
> > > > [    5.601154] x7 : 0000000000000001 x6 : ffff80001217b368
> > > > [    5.601157] x5 : 0000000000000000 x4 : 000000000000004c
> > > > [    5.601159] x3 : 0000000000000000 x2 : ffff8000113b4ac0
> > > > [    5.601162] x1 : ffff8000120c5f44 x0 : 00000000dc8984ff
> > > > [    5.601164] Call trace:
> > > > [    5.601169]  vc5_hdmi_phy_init+0x7ac/0x2078
> > > > [    5.601172]  vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > > [    5.601176]  drm_atomic_helper_commit_modeset_enables+0x224/0x248
> > > > [    5.601179]  vc4_atomic_complete_commit+0x400/0x558
> > > > [    5.601182]  vc4_atomic_commit+0x1e0/0x200
> > > > [    5.601185]  drm_atomic_commit+0x4c/0x60
> > > > [    5.601190]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238
> > > > [    5.601192]  drm_client_modeset_commit_locked+0x5c/0x198
> > > > [    5.601195]  drm_client_modeset_commit+0x30/0x58
> > > > [    5.601201]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xe0
> > > > [    5.601204]  drm_fb_helper_set_par+0x30/0x68
> > > > [    5.601208]  fbcon_init+0x3d4/0x598
> > > > [    5.601212]  visual_init+0xb0/0x108
> > > > [    5.601214]  do_bind_con_driver+0x1d0/0x3a8
> > > > [    5.601217]  do_take_over_console+0x144/0x208
> > > > [    5.601219]  do_fbcon_takeover+0x68/0xd8
> > > > [    5.601222]  fbcon_fb_registered+0x100/0x118
> > > > [    5.601226]  register_framebuffer+0x1f4/0x338
> > > > [    5.601229]  __drm_fb_helper_initial_config_and_unlock+0x2f8/0x4a0
> > > > [    5.601232]  drm_fbdev_client_hotplug+0xd4/0x1b0
> > > > [    5.601235]  drm_fbdev_generic_setup+0xb0/0x130
> > > > [    5.601238]  vc4_drm_bind+0x184/0x1a0
> > > > [    5.601241]  try_to_bring_up_master+0x168/0x1c8
> > > > [    5.601244]  __component_add+0xa4/0x170
> > > > [    5.601246]  component_add+0x14/0x20
> > > > [    5.601248]  vc4_vec_dev_probe+0x20/0x30
> > > > [    5.601252]  platform_drv_probe+0x54/0xa8
> > > > [    5.601254]  really_probe+0xd8/0x320
> > > > [    5.601256]  driver_probe_device+0x58/0xf0
> > > > [    5.601258]  __device_attach_driver+0x84/0xc8
> > > > [    5.601263]  bus_for_each_drv+0x78/0xc8
> > > > [    5.601265]  __device_attach+0xe4/0x140
> > > > [    5.601267]  device_initial_probe+0x14/0x20
> > > > [    5.601269]  bus_probe_device+0x9c/0xa8
> > > > [    5.601271]  deferred_probe_work_func+0x74/0xb0
> > > > [    5.601276]  process_one_work+0x1bc/0x338
> > > > [    5.601279]  worker_thread+0x1f8/0x428
> > > > [    5.601282]  kthread+0x138/0x158
> > > > [    5.601286]  ret_from_fork+0x10/0x1c
> > > > [    5.601288] ---[ end trace cfba0996218c3f3d ]---
> > >
> > > Thanks for testing!
> > >
> > > Do you have a bit more details regarding your setup? Was it connected to an
> > > external display?
> >
> > Yes, the HDMI cable is connected to HDMI0 port on RPi 4.
> >
> > > If so, do you know the resolution it was trying to setup?
> >
> > According to the log, I think it is 1920x1080:
> > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > HDMI-1 connected
> > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > HDMI-2 disconnected
> > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > Composite-1 disconnected
> > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Using
> > exact sizes for initial modes
> > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > HDMI-1 using initial mode 1920x1080 +0+0
> >
> > https://gist.github.com/starnight/45e1468bfa0426a54d2fb4a9269cfb94
>
> It looks to be fairly standard then, and I'm testing on the same resolution so
> it should be alright.
>
> Given from your log, it looks like you're running as arm64 though, while I stuck
> with arm32, so it could be the explanation.

Yes, I build it as arm64.

> Can you share your config.txt and .config so that I can try to reproduce it
> here?

Here is the config
https://gist.github.com/starnight/320b757441b6769c36160704b401c98b

Thanks,
Jian-Hong Pan
Jian-Hong Pan May 11, 2020, 3:12 a.m. UTC | #6
Jian-Hong Pan <jian-hong@endlessm.com> 於 2020年5月8日 週五 下午2:20寫道:
>
> Maxime Ripard <maxime@cerno.tech> 於 2020年5月8日 週五 上午1:22寫道:
> >
> > On Mon, May 04, 2020 at 02:35:08PM +0800, Jian-Hong Pan wrote:
> > > Maxime Ripard <maxime@cerno.tech> 於 2020年4月29日 週三 上午12:21寫道:
> > > >
> > > > Hi,
> > > >
> > > > On Mon, Apr 27, 2020 at 03:23:42PM +0800, Jian-Hong Pan wrote:
> > > > > Hi Maxime,
> > > > >
> > > > > Thanks for your V2 patch series!  I'm testing it.
> > > > >
> > > > > This patch series is applied upon mainline kernel 5.7-rc2 cleanly and built.
> > > > > System can boot into console text mode, but no graphic UI.
> > > > >
> > > > > Get the error in vc5_hdmi_phy_init(), and full dmesg is at [1]:
> > > > >
> > > > > [    5.587543] vc4_hdmi fef00700.hdmi: Unknown register ID 46
> > > > > [    5.587700] debugfs: Directory 'fef00700.hdmi' with parent 'vc4-hdmi' already present!
> > > > > [    5.588070] vc4_hdmi fef00700.hdmi: vc4-hdmi-hifi <-> fef00700.hdmi mapping ok
> > > > > [    5.588076] vc4_hdmi fef00700.hdmi: ASoC: no DMI vendor name!
> > > > > [    5.588263] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
> > > > > [    5.588299] vc4_hdmi fef05700.hdmi: Unknown register ID 46
> > > > > [    5.588373] debugfs: Directory 'vc4-hdmi' with parent 'asoc' already present!
> > > > > [    5.588673] vc4_hdmi fef05700.hdmi: vc4-hdmi-hifi <-> fef05700.hdmi mapping ok
> > > > > [    5.588677] vc4_hdmi fef05700.hdmi: ASoC: no DMI vendor name!
> > > > > [    5.588809] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
> > > > > [    5.588854] vc4-drm gpu: bound fe806000.vec (ops vc4_vec_ops)
> > > > > [    5.588897] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
> > > > > [    5.588934] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
> > > > > [    5.588990] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
> > > > > [    5.589030] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
> > > > > [    5.589074] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
> > > > > [    5.589106] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
> > > > > [    5.589145] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
> > > > > [    5.589294] checking generic (3e513000 6d8c00) vs hw (0 ffffffffffffffff)
> > > > > [    5.589297] fb0: switching to vc4drmfb from simple
> > > > > [    5.589433] Console: switching to colour dummy device 80x25
> > > > > [    5.589481] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> > > > > [    5.589816] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
> > > > > [    5.601079] ------------[ cut here ]------------
> > > > > [    5.601095] WARNING: CPU: 2 PID: 127 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:413 vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > [    5.601097] Modules linked in:
> > > > > [    5.601103] CPU: 2 PID: 127 Comm: kworker/2:1 Not tainted 5.7.0-rc2-00091-ga181df59a930 #7
> > > > > [    5.601105] Hardware name: Raspberry Pi 4 Model B (DT)
> > > > > [    5.601112] Workqueue: events deferred_probe_work_func
> > > > > [    5.601116] pstate: 20000005 (nzCv daif -PAN -UAO)
> > > > > [    5.601119] pc : vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > [    5.601123] lr : vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > > > [    5.601124] sp : ffff80001217b410
> > > > > [    5.601126] x29: ffff80001217b410 x28: ffff0000ec6370f0
> > > > > [    5.601129] x27: ffff0000f650d400 x26: 000000008a500000
> > > > > [    5.601132] x25: ffff8000113b4ac0 x24: 0000000000002060
> > > > > [    5.601135] x23: 000000000a500000 x22: 0000000000000300
> > > > > [    5.601137] x21: 0000000008d9ee20 x20: ffff0000ec535080
> > > > > [    5.601140] x19: 000000010989e7c0 x18: 0000000000000000
> > > > > [    5.601142] x17: 0000000000000001 x16: 0000000000005207
> > > > > [    5.601145] x15: 00004932ad293c92 x14: 0000000000000137
> > > > > [    5.601147] x13: ffff800010015000 x12: 0000000000000001
> > > > > [    5.601150] x11: 0000000000000001 x10: 0000000000000000
> > > > > [    5.601152] x9 : 0000000000000000 x8 : ffff800010015038
> > > > > [    5.601154] x7 : 0000000000000001 x6 : ffff80001217b368
> > > > > [    5.601157] x5 : 0000000000000000 x4 : 000000000000004c
> > > > > [    5.601159] x3 : 0000000000000000 x2 : ffff8000113b4ac0
> > > > > [    5.601162] x1 : ffff8000120c5f44 x0 : 00000000dc8984ff
> > > > > [    5.601164] Call trace:
> > > > > [    5.601169]  vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > [    5.601172]  vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > > > [    5.601176]  drm_atomic_helper_commit_modeset_enables+0x224/0x248
> > > > > [    5.601179]  vc4_atomic_complete_commit+0x400/0x558
> > > > > [    5.601182]  vc4_atomic_commit+0x1e0/0x200
> > > > > [    5.601185]  drm_atomic_commit+0x4c/0x60
> > > > > [    5.601190]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238
> > > > > [    5.601192]  drm_client_modeset_commit_locked+0x5c/0x198
> > > > > [    5.601195]  drm_client_modeset_commit+0x30/0x58
> > > > > [    5.601201]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xe0
> > > > > [    5.601204]  drm_fb_helper_set_par+0x30/0x68
> > > > > [    5.601208]  fbcon_init+0x3d4/0x598
> > > > > [    5.601212]  visual_init+0xb0/0x108
> > > > > [    5.601214]  do_bind_con_driver+0x1d0/0x3a8
> > > > > [    5.601217]  do_take_over_console+0x144/0x208
> > > > > [    5.601219]  do_fbcon_takeover+0x68/0xd8
> > > > > [    5.601222]  fbcon_fb_registered+0x100/0x118
> > > > > [    5.601226]  register_framebuffer+0x1f4/0x338
> > > > > [    5.601229]  __drm_fb_helper_initial_config_and_unlock+0x2f8/0x4a0
> > > > > [    5.601232]  drm_fbdev_client_hotplug+0xd4/0x1b0
> > > > > [    5.601235]  drm_fbdev_generic_setup+0xb0/0x130
> > > > > [    5.601238]  vc4_drm_bind+0x184/0x1a0
> > > > > [    5.601241]  try_to_bring_up_master+0x168/0x1c8
> > > > > [    5.601244]  __component_add+0xa4/0x170
> > > > > [    5.601246]  component_add+0x14/0x20
> > > > > [    5.601248]  vc4_vec_dev_probe+0x20/0x30
> > > > > [    5.601252]  platform_drv_probe+0x54/0xa8
> > > > > [    5.601254]  really_probe+0xd8/0x320
> > > > > [    5.601256]  driver_probe_device+0x58/0xf0
> > > > > [    5.601258]  __device_attach_driver+0x84/0xc8
> > > > > [    5.601263]  bus_for_each_drv+0x78/0xc8
> > > > > [    5.601265]  __device_attach+0xe4/0x140
> > > > > [    5.601267]  device_initial_probe+0x14/0x20
> > > > > [    5.601269]  bus_probe_device+0x9c/0xa8
> > > > > [    5.601271]  deferred_probe_work_func+0x74/0xb0
> > > > > [    5.601276]  process_one_work+0x1bc/0x338
> > > > > [    5.601279]  worker_thread+0x1f8/0x428
> > > > > [    5.601282]  kthread+0x138/0x158
> > > > > [    5.601286]  ret_from_fork+0x10/0x1c
> > > > > [    5.601288] ---[ end trace cfba0996218c3f3d ]---
> > > >
> > > > Thanks for testing!
> > > >
> > > > Do you have a bit more details regarding your setup? Was it connected to an
> > > > external display?
> > >
> > > Yes, the HDMI cable is connected to HDMI0 port on RPi 4.
> > >
> > > > If so, do you know the resolution it was trying to setup?
> > >
> > > According to the log, I think it is 1920x1080:
> > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > HDMI-1 connected
> > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > HDMI-2 disconnected
> > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > Composite-1 disconnected
> > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Using
> > > exact sizes for initial modes
> > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > HDMI-1 using initial mode 1920x1080 +0+0
> > >
> > > https://gist.github.com/starnight/45e1468bfa0426a54d2fb4a9269cfb94
> >
> > It looks to be fairly standard then, and I'm testing on the same resolution so
> > it should be alright.
> >
> > Given from your log, it looks like you're running as arm64 though, while I stuck
> > with arm32, so it could be the explanation.
>
> Yes, I build it as arm64.
>
> > Can you share your config.txt and .config so that I can try to reproduce it
> > here?
>
> Here is the config
> https://gist.github.com/starnight/320b757441b6769c36160704b401c98b

Here is the only one line in config.txt:
enable_uart=1

Actually, we make the Raspberry Pi's firmware bring up U-Boot, then
U-Boot boots kernel.

Jian-Hong Pan
Maxime Ripard May 25, 2020, 11:11 a.m. UTC | #7
Hi,

On Mon, May 11, 2020 at 11:12:05AM +0800, Jian-Hong Pan wrote:
> Jian-Hong Pan <jian-hong@endlessm.com> 於 2020年5月8日 週五 下午2:20寫道:
> >
> > Maxime Ripard <maxime@cerno.tech> 於 2020年5月8日 週五 上午1:22寫道:
> > >
> > > On Mon, May 04, 2020 at 02:35:08PM +0800, Jian-Hong Pan wrote:
> > > > Maxime Ripard <maxime@cerno.tech> 於 2020年4月29日 週三 上午12:21寫道:
> > > > >
> > > > > Hi,
> > > > >
> > > > > On Mon, Apr 27, 2020 at 03:23:42PM +0800, Jian-Hong Pan wrote:
> > > > > > Hi Maxime,
> > > > > >
> > > > > > Thanks for your V2 patch series!  I'm testing it.
> > > > > >
> > > > > > This patch series is applied upon mainline kernel 5.7-rc2 cleanly and built.
> > > > > > System can boot into console text mode, but no graphic UI.
> > > > > >
> > > > > > Get the error in vc5_hdmi_phy_init(), and full dmesg is at [1]:
> > > > > >
> > > > > > [    5.587543] vc4_hdmi fef00700.hdmi: Unknown register ID 46
> > > > > > [    5.587700] debugfs: Directory 'fef00700.hdmi' with parent 'vc4-hdmi' already present!
> > > > > > [    5.588070] vc4_hdmi fef00700.hdmi: vc4-hdmi-hifi <-> fef00700.hdmi mapping ok
> > > > > > [    5.588076] vc4_hdmi fef00700.hdmi: ASoC: no DMI vendor name!
> > > > > > [    5.588263] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
> > > > > > [    5.588299] vc4_hdmi fef05700.hdmi: Unknown register ID 46
> > > > > > [    5.588373] debugfs: Directory 'vc4-hdmi' with parent 'asoc' already present!
> > > > > > [    5.588673] vc4_hdmi fef05700.hdmi: vc4-hdmi-hifi <-> fef05700.hdmi mapping ok
> > > > > > [    5.588677] vc4_hdmi fef05700.hdmi: ASoC: no DMI vendor name!
> > > > > > [    5.588809] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
> > > > > > [    5.588854] vc4-drm gpu: bound fe806000.vec (ops vc4_vec_ops)
> > > > > > [    5.588897] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
> > > > > > [    5.588934] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
> > > > > > [    5.588990] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589030] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589074] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589106] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589145] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589294] checking generic (3e513000 6d8c00) vs hw (0 ffffffffffffffff)
> > > > > > [    5.589297] fb0: switching to vc4drmfb from simple
> > > > > > [    5.589433] Console: switching to colour dummy device 80x25
> > > > > > [    5.589481] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> > > > > > [    5.589816] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
> > > > > > [    5.601079] ------------[ cut here ]------------
> > > > > > [    5.601095] WARNING: CPU: 2 PID: 127 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:413 vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > > [    5.601097] Modules linked in:
> > > > > > [    5.601103] CPU: 2 PID: 127 Comm: kworker/2:1 Not tainted 5.7.0-rc2-00091-ga181df59a930 #7
> > > > > > [    5.601105] Hardware name: Raspberry Pi 4 Model B (DT)
> > > > > > [    5.601112] Workqueue: events deferred_probe_work_func
> > > > > > [    5.601116] pstate: 20000005 (nzCv daif -PAN -UAO)
> > > > > > [    5.601119] pc : vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > > [    5.601123] lr : vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > > > > [    5.601124] sp : ffff80001217b410
> > > > > > [    5.601126] x29: ffff80001217b410 x28: ffff0000ec6370f0
> > > > > > [    5.601129] x27: ffff0000f650d400 x26: 000000008a500000
> > > > > > [    5.601132] x25: ffff8000113b4ac0 x24: 0000000000002060
> > > > > > [    5.601135] x23: 000000000a500000 x22: 0000000000000300
> > > > > > [    5.601137] x21: 0000000008d9ee20 x20: ffff0000ec535080
> > > > > > [    5.601140] x19: 000000010989e7c0 x18: 0000000000000000
> > > > > > [    5.601142] x17: 0000000000000001 x16: 0000000000005207
> > > > > > [    5.601145] x15: 00004932ad293c92 x14: 0000000000000137
> > > > > > [    5.601147] x13: ffff800010015000 x12: 0000000000000001
> > > > > > [    5.601150] x11: 0000000000000001 x10: 0000000000000000
> > > > > > [    5.601152] x9 : 0000000000000000 x8 : ffff800010015038
> > > > > > [    5.601154] x7 : 0000000000000001 x6 : ffff80001217b368
> > > > > > [    5.601157] x5 : 0000000000000000 x4 : 000000000000004c
> > > > > > [    5.601159] x3 : 0000000000000000 x2 : ffff8000113b4ac0
> > > > > > [    5.601162] x1 : ffff8000120c5f44 x0 : 00000000dc8984ff
> > > > > > [    5.601164] Call trace:
> > > > > > [    5.601169]  vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > > [    5.601172]  vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > > > > [    5.601176]  drm_atomic_helper_commit_modeset_enables+0x224/0x248
> > > > > > [    5.601179]  vc4_atomic_complete_commit+0x400/0x558
> > > > > > [    5.601182]  vc4_atomic_commit+0x1e0/0x200
> > > > > > [    5.601185]  drm_atomic_commit+0x4c/0x60
> > > > > > [    5.601190]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238
> > > > > > [    5.601192]  drm_client_modeset_commit_locked+0x5c/0x198
> > > > > > [    5.601195]  drm_client_modeset_commit+0x30/0x58
> > > > > > [    5.601201]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xe0
> > > > > > [    5.601204]  drm_fb_helper_set_par+0x30/0x68
> > > > > > [    5.601208]  fbcon_init+0x3d4/0x598
> > > > > > [    5.601212]  visual_init+0xb0/0x108
> > > > > > [    5.601214]  do_bind_con_driver+0x1d0/0x3a8
> > > > > > [    5.601217]  do_take_over_console+0x144/0x208
> > > > > > [    5.601219]  do_fbcon_takeover+0x68/0xd8
> > > > > > [    5.601222]  fbcon_fb_registered+0x100/0x118
> > > > > > [    5.601226]  register_framebuffer+0x1f4/0x338
> > > > > > [    5.601229]  __drm_fb_helper_initial_config_and_unlock+0x2f8/0x4a0
> > > > > > [    5.601232]  drm_fbdev_client_hotplug+0xd4/0x1b0
> > > > > > [    5.601235]  drm_fbdev_generic_setup+0xb0/0x130
> > > > > > [    5.601238]  vc4_drm_bind+0x184/0x1a0
> > > > > > [    5.601241]  try_to_bring_up_master+0x168/0x1c8
> > > > > > [    5.601244]  __component_add+0xa4/0x170
> > > > > > [    5.601246]  component_add+0x14/0x20
> > > > > > [    5.601248]  vc4_vec_dev_probe+0x20/0x30
> > > > > > [    5.601252]  platform_drv_probe+0x54/0xa8
> > > > > > [    5.601254]  really_probe+0xd8/0x320
> > > > > > [    5.601256]  driver_probe_device+0x58/0xf0
> > > > > > [    5.601258]  __device_attach_driver+0x84/0xc8
> > > > > > [    5.601263]  bus_for_each_drv+0x78/0xc8
> > > > > > [    5.601265]  __device_attach+0xe4/0x140
> > > > > > [    5.601267]  device_initial_probe+0x14/0x20
> > > > > > [    5.601269]  bus_probe_device+0x9c/0xa8
> > > > > > [    5.601271]  deferred_probe_work_func+0x74/0xb0
> > > > > > [    5.601276]  process_one_work+0x1bc/0x338
> > > > > > [    5.601279]  worker_thread+0x1f8/0x428
> > > > > > [    5.601282]  kthread+0x138/0x158
> > > > > > [    5.601286]  ret_from_fork+0x10/0x1c
> > > > > > [    5.601288] ---[ end trace cfba0996218c3f3d ]---
> > > > >
> > > > > Thanks for testing!
> > > > >
> > > > > Do you have a bit more details regarding your setup? Was it connected to an
> > > > > external display?
> > > >
> > > > Yes, the HDMI cable is connected to HDMI0 port on RPi 4.
> > > >
> > > > > If so, do you know the resolution it was trying to setup?
> > > >
> > > > According to the log, I think it is 1920x1080:
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > > HDMI-1 connected
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > > HDMI-2 disconnected
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > > Composite-1 disconnected
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Using
> > > > exact sizes for initial modes
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > > HDMI-1 using initial mode 1920x1080 +0+0
> > > >
> > > > https://gist.github.com/starnight/45e1468bfa0426a54d2fb4a9269cfb94
> > >
> > > It looks to be fairly standard then, and I'm testing on the same resolution so
> > > it should be alright.
> > >
> > > Given from your log, it looks like you're running as arm64 though, while I stuck
> > > with arm32, so it could be the explanation.
> >
> > Yes, I build it as arm64.
> >
> > > Can you share your config.txt and .config so that I can try to reproduce it
> > > here?
> >
> > Here is the config
> > https://gist.github.com/starnight/320b757441b6769c36160704b401c98b
> 
> Here is the only one line in config.txt:
> enable_uart=1
> 
> Actually, we make the Raspberry Pi's firmware bring up U-Boot, then
> U-Boot boots kernel.

I gave it a try today, and it seems that you also need arm_64bit=1 in the
config.txt, but then the communication with the firmware doesn't work anymore
and the kernel just falls apart.

I'll give it a try with U-boot

Maxime
Maxime Ripard May 26, 2020, 10:20 a.m. UTC | #8
Hi,

On Mon, May 11, 2020 at 11:12:05AM +0800, Jian-Hong Pan wrote:
> Jian-Hong Pan <jian-hong@endlessm.com> 於 2020年5月8日 週五 下午2:20寫道:
> >
> > Maxime Ripard <maxime@cerno.tech> 於 2020年5月8日 週五 上午1:22寫道:
> > >
> > > On Mon, May 04, 2020 at 02:35:08PM +0800, Jian-Hong Pan wrote:
> > > > Maxime Ripard <maxime@cerno.tech> 於 2020年4月29日 週三 上午12:21寫道:
> > > > >
> > > > > Hi,
> > > > >
> > > > > On Mon, Apr 27, 2020 at 03:23:42PM +0800, Jian-Hong Pan wrote:
> > > > > > Hi Maxime,
> > > > > >
> > > > > > Thanks for your V2 patch series!  I'm testing it.
> > > > > >
> > > > > > This patch series is applied upon mainline kernel 5.7-rc2 cleanly and built.
> > > > > > System can boot into console text mode, but no graphic UI.
> > > > > >
> > > > > > Get the error in vc5_hdmi_phy_init(), and full dmesg is at [1]:
> > > > > >
> > > > > > [    5.587543] vc4_hdmi fef00700.hdmi: Unknown register ID 46
> > > > > > [    5.587700] debugfs: Directory 'fef00700.hdmi' with parent 'vc4-hdmi' already present!
> > > > > > [    5.588070] vc4_hdmi fef00700.hdmi: vc4-hdmi-hifi <-> fef00700.hdmi mapping ok
> > > > > > [    5.588076] vc4_hdmi fef00700.hdmi: ASoC: no DMI vendor name!
> > > > > > [    5.588263] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
> > > > > > [    5.588299] vc4_hdmi fef05700.hdmi: Unknown register ID 46
> > > > > > [    5.588373] debugfs: Directory 'vc4-hdmi' with parent 'asoc' already present!
> > > > > > [    5.588673] vc4_hdmi fef05700.hdmi: vc4-hdmi-hifi <-> fef05700.hdmi mapping ok
> > > > > > [    5.588677] vc4_hdmi fef05700.hdmi: ASoC: no DMI vendor name!
> > > > > > [    5.588809] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
> > > > > > [    5.588854] vc4-drm gpu: bound fe806000.vec (ops vc4_vec_ops)
> > > > > > [    5.588897] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
> > > > > > [    5.588934] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
> > > > > > [    5.588990] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589030] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589074] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589106] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589145] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
> > > > > > [    5.589294] checking generic (3e513000 6d8c00) vs hw (0 ffffffffffffffff)
> > > > > > [    5.589297] fb0: switching to vc4drmfb from simple
> > > > > > [    5.589433] Console: switching to colour dummy device 80x25
> > > > > > [    5.589481] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> > > > > > [    5.589816] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
> > > > > > [    5.601079] ------------[ cut here ]------------
> > > > > > [    5.601095] WARNING: CPU: 2 PID: 127 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:413 vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > > [    5.601097] Modules linked in:
> > > > > > [    5.601103] CPU: 2 PID: 127 Comm: kworker/2:1 Not tainted 5.7.0-rc2-00091-ga181df59a930 #7
> > > > > > [    5.601105] Hardware name: Raspberry Pi 4 Model B (DT)
> > > > > > [    5.601112] Workqueue: events deferred_probe_work_func
> > > > > > [    5.601116] pstate: 20000005 (nzCv daif -PAN -UAO)
> > > > > > [    5.601119] pc : vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > > [    5.601123] lr : vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > > > > [    5.601124] sp : ffff80001217b410
> > > > > > [    5.601126] x29: ffff80001217b410 x28: ffff0000ec6370f0
> > > > > > [    5.601129] x27: ffff0000f650d400 x26: 000000008a500000
> > > > > > [    5.601132] x25: ffff8000113b4ac0 x24: 0000000000002060
> > > > > > [    5.601135] x23: 000000000a500000 x22: 0000000000000300
> > > > > > [    5.601137] x21: 0000000008d9ee20 x20: ffff0000ec535080
> > > > > > [    5.601140] x19: 000000010989e7c0 x18: 0000000000000000
> > > > > > [    5.601142] x17: 0000000000000001 x16: 0000000000005207
> > > > > > [    5.601145] x15: 00004932ad293c92 x14: 0000000000000137
> > > > > > [    5.601147] x13: ffff800010015000 x12: 0000000000000001
> > > > > > [    5.601150] x11: 0000000000000001 x10: 0000000000000000
> > > > > > [    5.601152] x9 : 0000000000000000 x8 : ffff800010015038
> > > > > > [    5.601154] x7 : 0000000000000001 x6 : ffff80001217b368
> > > > > > [    5.601157] x5 : 0000000000000000 x4 : 000000000000004c
> > > > > > [    5.601159] x3 : 0000000000000000 x2 : ffff8000113b4ac0
> > > > > > [    5.601162] x1 : ffff8000120c5f44 x0 : 00000000dc8984ff
> > > > > > [    5.601164] Call trace:
> > > > > > [    5.601169]  vc5_hdmi_phy_init+0x7ac/0x2078
> > > > > > [    5.601172]  vc4_hdmi_encoder_enable+0x1b8/0x1ac0
> > > > > > [    5.601176]  drm_atomic_helper_commit_modeset_enables+0x224/0x248
> > > > > > [    5.601179]  vc4_atomic_complete_commit+0x400/0x558
> > > > > > [    5.601182]  vc4_atomic_commit+0x1e0/0x200
> > > > > > [    5.601185]  drm_atomic_commit+0x4c/0x60
> > > > > > [    5.601190]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238
> > > > > > [    5.601192]  drm_client_modeset_commit_locked+0x5c/0x198
> > > > > > [    5.601195]  drm_client_modeset_commit+0x30/0x58
> > > > > > [    5.601201]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xe0
> > > > > > [    5.601204]  drm_fb_helper_set_par+0x30/0x68
> > > > > > [    5.601208]  fbcon_init+0x3d4/0x598
> > > > > > [    5.601212]  visual_init+0xb0/0x108
> > > > > > [    5.601214]  do_bind_con_driver+0x1d0/0x3a8
> > > > > > [    5.601217]  do_take_over_console+0x144/0x208
> > > > > > [    5.601219]  do_fbcon_takeover+0x68/0xd8
> > > > > > [    5.601222]  fbcon_fb_registered+0x100/0x118
> > > > > > [    5.601226]  register_framebuffer+0x1f4/0x338
> > > > > > [    5.601229]  __drm_fb_helper_initial_config_and_unlock+0x2f8/0x4a0
> > > > > > [    5.601232]  drm_fbdev_client_hotplug+0xd4/0x1b0
> > > > > > [    5.601235]  drm_fbdev_generic_setup+0xb0/0x130
> > > > > > [    5.601238]  vc4_drm_bind+0x184/0x1a0
> > > > > > [    5.601241]  try_to_bring_up_master+0x168/0x1c8
> > > > > > [    5.601244]  __component_add+0xa4/0x170
> > > > > > [    5.601246]  component_add+0x14/0x20
> > > > > > [    5.601248]  vc4_vec_dev_probe+0x20/0x30
> > > > > > [    5.601252]  platform_drv_probe+0x54/0xa8
> > > > > > [    5.601254]  really_probe+0xd8/0x320
> > > > > > [    5.601256]  driver_probe_device+0x58/0xf0
> > > > > > [    5.601258]  __device_attach_driver+0x84/0xc8
> > > > > > [    5.601263]  bus_for_each_drv+0x78/0xc8
> > > > > > [    5.601265]  __device_attach+0xe4/0x140
> > > > > > [    5.601267]  device_initial_probe+0x14/0x20
> > > > > > [    5.601269]  bus_probe_device+0x9c/0xa8
> > > > > > [    5.601271]  deferred_probe_work_func+0x74/0xb0
> > > > > > [    5.601276]  process_one_work+0x1bc/0x338
> > > > > > [    5.601279]  worker_thread+0x1f8/0x428
> > > > > > [    5.601282]  kthread+0x138/0x158
> > > > > > [    5.601286]  ret_from_fork+0x10/0x1c
> > > > > > [    5.601288] ---[ end trace cfba0996218c3f3d ]---
> > > > >
> > > > > Thanks for testing!
> > > > >
> > > > > Do you have a bit more details regarding your setup? Was it connected to an
> > > > > external display?
> > > >
> > > > Yes, the HDMI cable is connected to HDMI0 port on RPi 4.
> > > >
> > > > > If so, do you know the resolution it was trying to setup?
> > > >
> > > > According to the log, I think it is 1920x1080:
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > > HDMI-1 connected
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > > HDMI-2 disconnected
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > > Composite-1 disconnected
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Using
> > > > exact sizes for initial modes
> > > > Apr 27 15:37:25 endless gdm-Xorg-:0[1960]: (II) modeset(0): Output
> > > > HDMI-1 using initial mode 1920x1080 +0+0
> > > >
> > > > https://gist.github.com/starnight/45e1468bfa0426a54d2fb4a9269cfb94
> > >
> > > It looks to be fairly standard then, and I'm testing on the same resolution so
> > > it should be alright.
> > >
> > > Given from your log, it looks like you're running as arm64 though, while I stuck
> > > with arm32, so it could be the explanation.
> >
> > Yes, I build it as arm64.
> >
> > > Can you share your config.txt and .config so that I can try to reproduce it
> > > here?
> >
> > Here is the config
> > https://gist.github.com/starnight/320b757441b6769c36160704b401c98b
> 
> Here is the only one line in config.txt:
> enable_uart=1
> 
> Actually, we make the Raspberry Pi's firmware bring up U-Boot, then
> U-Boot boots kernel.

I gave it a try with U-Boot with my latest work and couldn't reproduce it, so it
seems that I fixed it along the way

Maxime
Daniel Drake May 27, 2020, 3:49 a.m. UTC | #9
Hi Maxime,

On Tue, May 26, 2020 at 6:20 PM Maxime Ripard <maxime@cerno.tech> wrote:
> I gave it a try with U-Boot with my latest work and couldn't reproduce it, so it
> seems that I fixed it along the way

Is your latest work available in a git branch anywhere that we could
test directly?

Thanks
Daniel
Maxime Ripard May 27, 2020, 9:13 a.m. UTC | #10
Hi Daniel,

On Wed, May 27, 2020 at 11:49:36AM +0800, Daniel Drake wrote:
> Hi Maxime,
> 
> On Tue, May 26, 2020 at 6:20 PM Maxime Ripard <maxime@cerno.tech> wrote:
> > I gave it a try with U-Boot with my latest work and couldn't reproduce it, so it
> > seems that I fixed it along the way
> 
> Is your latest work available in a git branch anywhere that we could
> test directly?

I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
want.

Maxime
Daniel Drake May 27, 2020, 9:15 a.m. UTC | #11
On Wed, May 27, 2020 at 5:13 PM Maxime Ripard <maxime@cerno.tech> wrote:
> I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
> want.

That would be great, although given the potentially inconsistent
results we've been seeing so far it would be great if you could
additionally push a git branch somewhere.
That way we can have higher confidence that we are applying exactly
the same patches to the same base etc.

Thanks
Daniel
Maxime Ripard May 28, 2020, 7:30 a.m. UTC | #12
Hi Daniel,

On Wed, May 27, 2020 at 05:15:12PM +0800, Daniel Drake wrote:
> On Wed, May 27, 2020 at 5:13 PM Maxime Ripard <maxime@cerno.tech> wrote:
> > I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
> > want.
> 
> That would be great, although given the potentially inconsistent
> results we've been seeing so far it would be great if you could
> additionally push a git branch somewhere.
> That way we can have higher confidence that we are applying exactly
> the same patches to the same base etc.

So I sent a new iteration yesterday, and of course forgot to cc you... Sorry for
that.

I've pushed my current branch here:
https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git/log/?h=rpi4-kms

Maxime
Jian-Hong Pan June 1, 2020, 7:58 a.m. UTC | #13
Maxime Ripard <maxime@cerno.tech> 於 2020年5月28日 週四 下午3:30寫道:
>
> Hi Daniel,
>
> On Wed, May 27, 2020 at 05:15:12PM +0800, Daniel Drake wrote:
> > On Wed, May 27, 2020 at 5:13 PM Maxime Ripard <maxime@cerno.tech> wrote:
> > > I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
> > > want.
> >
> > That would be great, although given the potentially inconsistent
> > results we've been seeing so far it would be great if you could
> > additionally push a git branch somewhere.
> > That way we can have higher confidence that we are applying exactly
> > the same patches to the same base etc.
>
> So I sent a new iteration yesterday, and of course forgot to cc you... Sorry for
> that.
>
> I've pushed my current branch here:
> https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git/log/?h=rpi4-kms

Thanks to Maxime!

I have tried your repository on branch rpi4-kms.  The DRM VC4 is used!
But got some issues:
1. Some weird error message in dmesg.  Not sure it is related, or not
[    5.219321] [drm:vc5_hdmi_init_resources] *ERROR* Failed to get
HDMI state machine clock
https://gist.github.com/starnight/3f317dca121065a361cf08e91225e389

2. The screen flashes suddenly sometimes.

3. The higher resolutions, like 1920x1080 ... are lost after hot
re-plug HDMI cable (HDMI0)

Jian-Hong Pan
Maxime Ripard June 2, 2020, 11:04 a.m. UTC | #14
Hi,

On Mon, Jun 01, 2020 at 03:58:26PM +0800, Jian-Hong Pan wrote:
> Maxime Ripard <maxime@cerno.tech> 於 2020年5月28日 週四 下午3:30寫道:
> >
> > Hi Daniel,
> >
> > On Wed, May 27, 2020 at 05:15:12PM +0800, Daniel Drake wrote:
> > > On Wed, May 27, 2020 at 5:13 PM Maxime Ripard <maxime@cerno.tech> wrote:
> > > > I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
> > > > want.
> > >
> > > That would be great, although given the potentially inconsistent
> > > results we've been seeing so far it would be great if you could
> > > additionally push a git branch somewhere.
> > > That way we can have higher confidence that we are applying exactly
> > > the same patches to the same base etc.
> >
> > So I sent a new iteration yesterday, and of course forgot to cc you... Sorry for
> > that.
> >
> > I've pushed my current branch here:
> > https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git/log/?h=rpi4-kms
> 
> Thanks to Maxime!
> 
> I have tried your repository on branch rpi4-kms.  The DRM VC4 is used!
> But got some issues:
> 1. Some weird error message in dmesg.  Not sure it is related, or not
> [    5.219321] [drm:vc5_hdmi_init_resources] *ERROR* Failed to get
> HDMI state machine clock
> https://gist.github.com/starnight/3f317dca121065a361cf08e91225e389

That's a deferred probing. The first time the HDMI driver is being
probed, the firmware clock driver has not been probed yet. It's making
another attempt later on, which succeeds.

> 2. The screen flashes suddenly sometimes.
> 
> 3. The higher resolutions, like 1920x1080 ... are lost after hot
> re-plug HDMI cable (HDMI0)

I'm not sure on how to exactly reproduce those issues (or what they are)
though, can you expand on this?

Maxime
Jian-Hong Pan June 5, 2020, 8:44 a.m. UTC | #15
Maxime Ripard <maxime@cerno.tech> 於 2020年6月2日 週二 下午7:04寫道:
>
> Hi,
>
> On Mon, Jun 01, 2020 at 03:58:26PM +0800, Jian-Hong Pan wrote:
> > Maxime Ripard <maxime@cerno.tech> 於 2020年5月28日 週四 下午3:30寫道:
> > >
> > > Hi Daniel,
> > >
> > > On Wed, May 27, 2020 at 05:15:12PM +0800, Daniel Drake wrote:
> > > > On Wed, May 27, 2020 at 5:13 PM Maxime Ripard <maxime@cerno.tech> wrote:
> > > > > I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
> > > > > want.
> > > >
> > > > That would be great, although given the potentially inconsistent
> > > > results we've been seeing so far it would be great if you could
> > > > additionally push a git branch somewhere.
> > > > That way we can have higher confidence that we are applying exactly
> > > > the same patches to the same base etc.
> > >
> > > So I sent a new iteration yesterday, and of course forgot to cc you... Sorry for
> > > that.
> > >
> > > I've pushed my current branch here:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git/log/?h=rpi4-kms
> >
> > Thanks to Maxime!
> >
> > I have tried your repository on branch rpi4-kms.  The DRM VC4 is used!
> > But got some issues:
> > 1. Some weird error message in dmesg.  Not sure it is related, or not
> > [    5.219321] [drm:vc5_hdmi_init_resources] *ERROR* Failed to get
> > HDMI state machine clock
> > https://gist.github.com/starnight/3f317dca121065a361cf08e91225e389
>
> That's a deferred probing. The first time the HDMI driver is being
> probed, the firmware clock driver has not been probed yet. It's making
> another attempt later on, which succeeds.
>
> > 2. The screen flashes suddenly sometimes.

I append drm.debug=0x3 to boot command.  Whenever, the screen flashes,
I notice the logs like this:

Jun 01 15:22:40 endless kernel: [drm:drm_calc_timestamping_constants]
crtc 64: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
Jun 01 15:22:40 endless kernel: [drm:drm_calc_timestamping_constants]
crtc 64: clock 148500 kHz framedur 16666666 linedur 14814
Jun 01 15:22:40 endless kernel: [drm:drm_vblank_enable] enabling
vblank on crtc 3, ret: 0
Jun 01 15:22:40 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 159 (2)
Jun 01 15:22:40 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 154 (1)
Jun 01 15:22:40 endless kernel: [drm:vblank_disable_fn] disabling
vblank on crtc 3
Jun 01 15:22:42 endless kernel: [drm:drm_ioctl] pid=584, dev=0xe200,
auth=1, DRM_IOCTL_MODE_CURSOR
Jun 01 15:22:42 endless kernel: [drm:drm_ioctl] pid=584, dev=0xe200,
auth=1, DRM_IOCTL_MODE_CURSOR2
Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_get] OBJ ID: 159 (1)
Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_get] OBJ ID: 154 (1)
Jun 01 15:22:42 endless kernel: [drm:drm_calc_timestamping_constants]
crtc 64: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
Jun 01 15:22:42 endless kernel: [drm:drm_calc_timestamping_constants]
crtc 64: clock 148500 kHz framedur 16666666 linedur 14814
Jun 01 15:22:42 endless kernel: [drm:drm_vblank_enable] enabling
vblank on crtc 3, ret: 0
Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 159 (2)
Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 154 (2)

Here is the full log
https://gist.github.com/starnight/85d641819839eddc7a55ca7173990a56

> > 3. The higher resolutions, like 1920x1080 ... are lost after hot
> > re-plug HDMI cable (HDMI0)

I should explain this in more detail.  Here are the steps to reproduce
this issue:
1. Before unplug the HDMI cable from HDMI0 port.
$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x
axis y axis) 521mm x 293mm
   1920x1080     60.00*+  50.00    59.94
   1920x1080i    60.00    50.00    59.94
   1680x1050     59.88
   1280x1024     75.02    60.02
   1440x900      59.90
   1280x960      60.00
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1440x576      50.00
   1024x768      75.03    70.07    60.00
   1440x480      60.00    59.94
   832x624       74.55
   800x600       72.19    75.00    60.32    56.25
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08
HDMI-2 disconnected (normal left inverted right x axis y axis)

2. Unplug the HDMI cable from HDMI0 port.
3. Plug the HDMI cable to **HDMI1** port.
$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
HDMI-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 connected primary 1920x1080+0+0 (normal left inverted right x
axis y axis) 521mm x 293mm
   1920x1080     60.00*+  50.00    59.94
   1920x1080i    60.00    50.00    59.94
   1680x1050     59.88
   1280x1024     75.02    60.02
   1440x900      59.90
   1280x960      60.00
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1440x576      50.00
   1024x768      75.03    70.07    60.00
   1440x480      60.00    59.94
   832x624       74.55
   800x600       72.19    75.00    60.32    56.25
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08

4. Unplug the HDMI cable from **HDMI1** port.
5. Plug the HDMI cable back to HDMI0 port.
$ xrandr
Screen 0: minimum 320 x 200, current 1368 x 768, maximum 2048 x 2048
HDMI-1 connected primary 1368x768+0+0 (normal left inverted right x
axis y axis) 0mm x 0mm
   1368x768      59.88*
   1360x768      59.80
   1280x800      59.81
   1152x864      60.00
   1280x720      59.86
   1024x768      60.00
   1024x576      59.90
   960x540       59.63
   800x600       60.32
   800x450       59.82
   700x450       59.88
   640x480       59.94
   684x384       59.88    59.85
   680x384       59.80    59.96
   640x400       59.88    59.98
   576x432       60.06
   640x360       59.86    59.83
   512x384       60.00
   512x288       60.00    59.92
   480x270       59.63    59.82
   400x300       60.32
   320x240       60.05
HDMI-2 disconnected (normal left inverted right x axis y axis)

Jian-Hong Pan

> I'm not sure on how to exactly reproduce those issues (or what they are)
> though, can you expand on this?
>
> Maxime
Maxime Ripard June 29, 2020, 2:21 p.m. UTC | #16
Hi!

On Fri, Jun 05, 2020 at 04:44:51PM +0800, Jian-Hong Pan wrote:
> Maxime Ripard <maxime@cerno.tech> 於 2020年6月2日 週二 下午7:04寫道:
> >
> > Hi,
> >
> > On Mon, Jun 01, 2020 at 03:58:26PM +0800, Jian-Hong Pan wrote:
> > > Maxime Ripard <maxime@cerno.tech> 於 2020年5月28日 週四 下午3:30寫道:
> > > >
> > > > Hi Daniel,
> > > >
> > > > On Wed, May 27, 2020 at 05:15:12PM +0800, Daniel Drake wrote:
> > > > > On Wed, May 27, 2020 at 5:13 PM Maxime Ripard <maxime@cerno.tech> wrote:
> > > > > > I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
> > > > > > want.
> > > > >
> > > > > That would be great, although given the potentially inconsistent
> > > > > results we've been seeing so far it would be great if you could
> > > > > additionally push a git branch somewhere.
> > > > > That way we can have higher confidence that we are applying exactly
> > > > > the same patches to the same base etc.
> > > >
> > > > So I sent a new iteration yesterday, and of course forgot to cc you... Sorry for
> > > > that.
> > > >
> > > > I've pushed my current branch here:
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git/log/?h=rpi4-kms
> > >
> > > Thanks to Maxime!
> > >
> > > I have tried your repository on branch rpi4-kms.  The DRM VC4 is used!
> > > But got some issues:
> > > 1. Some weird error message in dmesg.  Not sure it is related, or not
> > > [    5.219321] [drm:vc5_hdmi_init_resources] *ERROR* Failed to get
> > > HDMI state machine clock
> > > https://gist.github.com/starnight/3f317dca121065a361cf08e91225e389
> >
> > That's a deferred probing. The first time the HDMI driver is being
> > probed, the firmware clock driver has not been probed yet. It's making
> > another attempt later on, which succeeds.
> >
> > > 2. The screen flashes suddenly sometimes.
> 
> I append drm.debug=0x3 to boot command.  Whenever, the screen flashes,
> I notice the logs like this:
> 
> Jun 01 15:22:40 endless kernel: [drm:drm_calc_timestamping_constants]
> crtc 64: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
> Jun 01 15:22:40 endless kernel: [drm:drm_calc_timestamping_constants]
> crtc 64: clock 148500 kHz framedur 16666666 linedur 14814
> Jun 01 15:22:40 endless kernel: [drm:drm_vblank_enable] enabling
> vblank on crtc 3, ret: 0
> Jun 01 15:22:40 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 159 (2)
> Jun 01 15:22:40 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 154 (1)
> Jun 01 15:22:40 endless kernel: [drm:vblank_disable_fn] disabling
> vblank on crtc 3
> Jun 01 15:22:42 endless kernel: [drm:drm_ioctl] pid=584, dev=0xe200,
> auth=1, DRM_IOCTL_MODE_CURSOR
> Jun 01 15:22:42 endless kernel: [drm:drm_ioctl] pid=584, dev=0xe200,
> auth=1, DRM_IOCTL_MODE_CURSOR2
> Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_get] OBJ ID: 159 (1)
> Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_get] OBJ ID: 154 (1)
> Jun 01 15:22:42 endless kernel: [drm:drm_calc_timestamping_constants]
> crtc 64: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
> Jun 01 15:22:42 endless kernel: [drm:drm_calc_timestamping_constants]
> crtc 64: clock 148500 kHz framedur 16666666 linedur 14814
> Jun 01 15:22:42 endless kernel: [drm:drm_vblank_enable] enabling
> vblank on crtc 3, ret: 0
> Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 159 (2)
> Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 154 (2)
> 
> Here is the full log
> https://gist.github.com/starnight/85d641819839eddc7a55ca7173990a56
> 
> > > 3. The higher resolutions, like 1920x1080 ... are lost after hot
> > > re-plug HDMI cable (HDMI0)
> 
> I should explain this in more detail.  Here are the steps to reproduce
> this issue:
> 1. Before unplug the HDMI cable from HDMI0 port.
> $ xrandr
> Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
> HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x
> axis y axis) 521mm x 293mm
>    1920x1080     60.00*+  50.00    59.94
>    1920x1080i    60.00    50.00    59.94
>    1680x1050     59.88
>    1280x1024     75.02    60.02
>    1440x900      59.90
>    1280x960      60.00
>    1152x864      75.00
>    1280x720      60.00    50.00    59.94
>    1440x576      50.00
>    1024x768      75.03    70.07    60.00
>    1440x480      60.00    59.94
>    832x624       74.55
>    800x600       72.19    75.00    60.32    56.25
>    720x576       50.00
>    720x480       60.00    59.94
>    640x480       75.00    72.81    66.67    60.00    59.94
>    720x400       70.08
> HDMI-2 disconnected (normal left inverted right x axis y axis)
> 
> 2. Unplug the HDMI cable from HDMI0 port.
> 3. Plug the HDMI cable to **HDMI1** port.
> $ xrandr
> Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
> HDMI-1 disconnected (normal left inverted right x axis y axis)
> HDMI-2 connected primary 1920x1080+0+0 (normal left inverted right x
> axis y axis) 521mm x 293mm
>    1920x1080     60.00*+  50.00    59.94
>    1920x1080i    60.00    50.00    59.94
>    1680x1050     59.88
>    1280x1024     75.02    60.02
>    1440x900      59.90
>    1280x960      60.00
>    1152x864      75.00
>    1280x720      60.00    50.00    59.94
>    1440x576      50.00
>    1024x768      75.03    70.07    60.00
>    1440x480      60.00    59.94
>    832x624       74.55
>    800x600       72.19    75.00    60.32    56.25
>    720x576       50.00
>    720x480       60.00    59.94
>    640x480       75.00    72.81    66.67    60.00    59.94
>    720x400       70.08
> 
> 4. Unplug the HDMI cable from **HDMI1** port.
> 5. Plug the HDMI cable back to HDMI0 port.
> $ xrandr
> Screen 0: minimum 320 x 200, current 1368 x 768, maximum 2048 x 2048
> HDMI-1 connected primary 1368x768+0+0 (normal left inverted right x
> axis y axis) 0mm x 0mm
>    1368x768      59.88*
>    1360x768      59.80
>    1280x800      59.81
>    1152x864      60.00
>    1280x720      59.86
>    1024x768      60.00
>    1024x576      59.90
>    960x540       59.63
>    800x600       60.32
>    800x450       59.82
>    700x450       59.88
>    640x480       59.94
>    684x384       59.88    59.85
>    680x384       59.80    59.96
>    640x400       59.88    59.98
>    576x432       60.06
>    640x360       59.86    59.83
>    512x384       60.00
>    512x288       60.00    59.92
>    480x270       59.63    59.82
>    400x300       60.32
>    320x240       60.05
> HDMI-2 disconnected (normal left inverted right x axis y axis)

Sorry for getting back at it so late. I just tested with modetest only
and my current branch and it seems to behave properly. Did you had to
run X to get that issue, or is it just how you noticed it?

Also, was that with the branch based on 5.7 I pushed on my git tree on
kernel.org or some earlier revision of the series?

Thanks!
Maxime
Jian-Hong Pan June 30, 2020, 8:26 a.m. UTC | #17
Maxime Ripard <maxime@cerno.tech> 於 2020年6月29日 週一 下午10:21寫道:
>
> Hi!
>
> On Fri, Jun 05, 2020 at 04:44:51PM +0800, Jian-Hong Pan wrote:
> > Maxime Ripard <maxime@cerno.tech> 於 2020年6月2日 週二 下午7:04寫道:
> > >
> > > Hi,
> > >
> > > On Mon, Jun 01, 2020 at 03:58:26PM +0800, Jian-Hong Pan wrote:
> > > > Maxime Ripard <maxime@cerno.tech> 於 2020年5月28日 週四 下午3:30寫道:
> > > > >
> > > > > Hi Daniel,
> > > > >
> > > > > On Wed, May 27, 2020 at 05:15:12PM +0800, Daniel Drake wrote:
> > > > > > On Wed, May 27, 2020 at 5:13 PM Maxime Ripard <maxime@cerno.tech> wrote:
> > > > > > > I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
> > > > > > > want.
> > > > > >
> > > > > > That would be great, although given the potentially inconsistent
> > > > > > results we've been seeing so far it would be great if you could
> > > > > > additionally push a git branch somewhere.
> > > > > > That way we can have higher confidence that we are applying exactly
> > > > > > the same patches to the same base etc.
> > > > >
> > > > > So I sent a new iteration yesterday, and of course forgot to cc you... Sorry for
> > > > > that.
> > > > >
> > > > > I've pushed my current branch here:
> > > > > https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git/log/?h=rpi4-kms
> > > >
> > > > Thanks to Maxime!
> > > >
> > > > I have tried your repository on branch rpi4-kms.  The DRM VC4 is used!
> > > > But got some issues:
> > > > 1. Some weird error message in dmesg.  Not sure it is related, or not
> > > > [    5.219321] [drm:vc5_hdmi_init_resources] *ERROR* Failed to get
> > > > HDMI state machine clock
> > > > https://gist.github.com/starnight/3f317dca121065a361cf08e91225e389
> > >
> > > That's a deferred probing. The first time the HDMI driver is being
> > > probed, the firmware clock driver has not been probed yet. It's making
> > > another attempt later on, which succeeds.
> > >
> > > > 2. The screen flashes suddenly sometimes.
> >
> > I append drm.debug=0x3 to boot command.  Whenever, the screen flashes,
> > I notice the logs like this:
> >
> > Jun 01 15:22:40 endless kernel: [drm:drm_calc_timestamping_constants]
> > crtc 64: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
> > Jun 01 15:22:40 endless kernel: [drm:drm_calc_timestamping_constants]
> > crtc 64: clock 148500 kHz framedur 16666666 linedur 14814
> > Jun 01 15:22:40 endless kernel: [drm:drm_vblank_enable] enabling
> > vblank on crtc 3, ret: 0
> > Jun 01 15:22:40 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 159 (2)
> > Jun 01 15:22:40 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 154 (1)
> > Jun 01 15:22:40 endless kernel: [drm:vblank_disable_fn] disabling
> > vblank on crtc 3
> > Jun 01 15:22:42 endless kernel: [drm:drm_ioctl] pid=584, dev=0xe200,
> > auth=1, DRM_IOCTL_MODE_CURSOR
> > Jun 01 15:22:42 endless kernel: [drm:drm_ioctl] pid=584, dev=0xe200,
> > auth=1, DRM_IOCTL_MODE_CURSOR2
> > Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_get] OBJ ID: 159 (1)
> > Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_get] OBJ ID: 154 (1)
> > Jun 01 15:22:42 endless kernel: [drm:drm_calc_timestamping_constants]
> > crtc 64: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
> > Jun 01 15:22:42 endless kernel: [drm:drm_calc_timestamping_constants]
> > crtc 64: clock 148500 kHz framedur 16666666 linedur 14814
> > Jun 01 15:22:42 endless kernel: [drm:drm_vblank_enable] enabling
> > vblank on crtc 3, ret: 0
> > Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 159 (2)
> > Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 154 (2)
> >
> > Here is the full log
> > https://gist.github.com/starnight/85d641819839eddc7a55ca7173990a56
> >
> > > > 3. The higher resolutions, like 1920x1080 ... are lost after hot
> > > > re-plug HDMI cable (HDMI0)
> >
> > I should explain this in more detail.  Here are the steps to reproduce
> > this issue:
> > 1. Before unplug the HDMI cable from HDMI0 port.
> > $ xrandr
> > Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
> > HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x
> > axis y axis) 521mm x 293mm
> >    1920x1080     60.00*+  50.00    59.94
> >    1920x1080i    60.00    50.00    59.94
> >    1680x1050     59.88
> >    1280x1024     75.02    60.02
> >    1440x900      59.90
> >    1280x960      60.00
> >    1152x864      75.00
> >    1280x720      60.00    50.00    59.94
> >    1440x576      50.00
> >    1024x768      75.03    70.07    60.00
> >    1440x480      60.00    59.94
> >    832x624       74.55
> >    800x600       72.19    75.00    60.32    56.25
> >    720x576       50.00
> >    720x480       60.00    59.94
> >    640x480       75.00    72.81    66.67    60.00    59.94
> >    720x400       70.08
> > HDMI-2 disconnected (normal left inverted right x axis y axis)
> >
> > 2. Unplug the HDMI cable from HDMI0 port.
> > 3. Plug the HDMI cable to **HDMI1** port.
> > $ xrandr
> > Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
> > HDMI-1 disconnected (normal left inverted right x axis y axis)
> > HDMI-2 connected primary 1920x1080+0+0 (normal left inverted right x
> > axis y axis) 521mm x 293mm
> >    1920x1080     60.00*+  50.00    59.94
> >    1920x1080i    60.00    50.00    59.94
> >    1680x1050     59.88
> >    1280x1024     75.02    60.02
> >    1440x900      59.90
> >    1280x960      60.00
> >    1152x864      75.00
> >    1280x720      60.00    50.00    59.94
> >    1440x576      50.00
> >    1024x768      75.03    70.07    60.00
> >    1440x480      60.00    59.94
> >    832x624       74.55
> >    800x600       72.19    75.00    60.32    56.25
> >    720x576       50.00
> >    720x480       60.00    59.94
> >    640x480       75.00    72.81    66.67    60.00    59.94
> >    720x400       70.08
> >
> > 4. Unplug the HDMI cable from **HDMI1** port.
> > 5. Plug the HDMI cable back to HDMI0 port.
> > $ xrandr
> > Screen 0: minimum 320 x 200, current 1368 x 768, maximum 2048 x 2048
> > HDMI-1 connected primary 1368x768+0+0 (normal left inverted right x
> > axis y axis) 0mm x 0mm
> >    1368x768      59.88*
> >    1360x768      59.80
> >    1280x800      59.81
> >    1152x864      60.00
> >    1280x720      59.86
> >    1024x768      60.00
> >    1024x576      59.90
> >    960x540       59.63
> >    800x600       60.32
> >    800x450       59.82
> >    700x450       59.88
> >    640x480       59.94
> >    684x384       59.88    59.85
> >    680x384       59.80    59.96
> >    640x400       59.88    59.98
> >    576x432       60.06
> >    640x360       59.86    59.83
> >    512x384       60.00
> >    512x288       60.00    59.92
> >    480x270       59.63    59.82
> >    400x300       60.32
> >    320x240       60.05
> > HDMI-2 disconnected (normal left inverted right x axis y axis)
>
> Sorry for getting back at it so late. I just tested with modetest only
> and my current branch and it seems to behave properly. Did you had to
> run X to get that issue, or is it just how you noticed it?
>
> Also, was that with the branch based on 5.7 I pushed on my git tree on
> kernel.org or some earlier revision of the series?

Thanks for coming back :)

I use GNOME 3.36 with Xorg 1.20.4.

To understand when it starts to hit the issues, I separate to step by step:
1. System boots into command line mode first (systemd multi-user.target)
2. Execute Xorg, then xterm.
3. Execute mutter upon the screen of Xorg.

I tried both branches rpi4-kms and rpi4-kms-5.7 of
https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git
Both of the branches hit issues:
* The screen flashes suddenly sometimes.  This happens after mutter is launched.
* The higher resolutions, like 1920x1080 ... are lost after hot
re-plug HDMI cable (HDMI0).  HDMI cable connects to HDMI0 -> HDMI1 ->
HDMI0.  This happens not only with GNOME, but also pure Xorg.

Jian-Hong Pan
Maxime Ripard July 3, 2020, 12:56 p.m. UTC | #18
Hi,

On Tue, Jun 30, 2020 at 04:26:20PM +0800, Jian-Hong Pan wrote:
> Maxime Ripard <maxime@cerno.tech> 於 2020年6月29日 週一 下午10:21寫道:
> >
> > Hi!
> >
> > On Fri, Jun 05, 2020 at 04:44:51PM +0800, Jian-Hong Pan wrote:
> > > Maxime Ripard <maxime@cerno.tech> 於 2020年6月2日 週二 下午7:04寫道:
> > > >
> > > > Hi,
> > > >
> > > > On Mon, Jun 01, 2020 at 03:58:26PM +0800, Jian-Hong Pan wrote:
> > > > > Maxime Ripard <maxime@cerno.tech> 於 2020年5月28日 週四 下午3:30寫道:
> > > > > >
> > > > > > Hi Daniel,
> > > > > >
> > > > > > On Wed, May 27, 2020 at 05:15:12PM +0800, Daniel Drake wrote:
> > > > > > > On Wed, May 27, 2020 at 5:13 PM Maxime Ripard <maxime@cerno.tech> wrote:
> > > > > > > > I'm about to send a v3 today or tomorrow, I can Cc you (and Jian-Hong) if you
> > > > > > > > want.
> > > > > > >
> > > > > > > That would be great, although given the potentially inconsistent
> > > > > > > results we've been seeing so far it would be great if you could
> > > > > > > additionally push a git branch somewhere.
> > > > > > > That way we can have higher confidence that we are applying exactly
> > > > > > > the same patches to the same base etc.
> > > > > >
> > > > > > So I sent a new iteration yesterday, and of course forgot to cc you... Sorry for
> > > > > > that.
> > > > > >
> > > > > > I've pushed my current branch here:
> > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git/log/?h=rpi4-kms
> > > > >
> > > > > Thanks to Maxime!
> > > > >
> > > > > I have tried your repository on branch rpi4-kms.  The DRM VC4 is used!
> > > > > But got some issues:
> > > > > 1. Some weird error message in dmesg.  Not sure it is related, or not
> > > > > [    5.219321] [drm:vc5_hdmi_init_resources] *ERROR* Failed to get
> > > > > HDMI state machine clock
> > > > > https://gist.github.com/starnight/3f317dca121065a361cf08e91225e389
> > > >
> > > > That's a deferred probing. The first time the HDMI driver is being
> > > > probed, the firmware clock driver has not been probed yet. It's making
> > > > another attempt later on, which succeeds.
> > > >
> > > > > 2. The screen flashes suddenly sometimes.
> > >
> > > I append drm.debug=0x3 to boot command.  Whenever, the screen flashes,
> > > I notice the logs like this:
> > >
> > > Jun 01 15:22:40 endless kernel: [drm:drm_calc_timestamping_constants]
> > > crtc 64: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
> > > Jun 01 15:22:40 endless kernel: [drm:drm_calc_timestamping_constants]
> > > crtc 64: clock 148500 kHz framedur 16666666 linedur 14814
> > > Jun 01 15:22:40 endless kernel: [drm:drm_vblank_enable] enabling
> > > vblank on crtc 3, ret: 0
> > > Jun 01 15:22:40 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 159 (2)
> > > Jun 01 15:22:40 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 154 (1)
> > > Jun 01 15:22:40 endless kernel: [drm:vblank_disable_fn] disabling
> > > vblank on crtc 3
> > > Jun 01 15:22:42 endless kernel: [drm:drm_ioctl] pid=584, dev=0xe200,
> > > auth=1, DRM_IOCTL_MODE_CURSOR
> > > Jun 01 15:22:42 endless kernel: [drm:drm_ioctl] pid=584, dev=0xe200,
> > > auth=1, DRM_IOCTL_MODE_CURSOR2
> > > Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_get] OBJ ID: 159 (1)
> > > Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_get] OBJ ID: 154 (1)
> > > Jun 01 15:22:42 endless kernel: [drm:drm_calc_timestamping_constants]
> > > crtc 64: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
> > > Jun 01 15:22:42 endless kernel: [drm:drm_calc_timestamping_constants]
> > > crtc 64: clock 148500 kHz framedur 16666666 linedur 14814
> > > Jun 01 15:22:42 endless kernel: [drm:drm_vblank_enable] enabling
> > > vblank on crtc 3, ret: 0
> > > Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 159 (2)
> > > Jun 01 15:22:42 endless kernel: [drm:drm_mode_object_put.part.0] OBJ ID: 154 (2)
> > >
> > > Here is the full log
> > > https://gist.github.com/starnight/85d641819839eddc7a55ca7173990a56
> > >
> > > > > 3. The higher resolutions, like 1920x1080 ... are lost after hot
> > > > > re-plug HDMI cable (HDMI0)
> > >
> > > I should explain this in more detail.  Here are the steps to reproduce
> > > this issue:
> > > 1. Before unplug the HDMI cable from HDMI0 port.
> > > $ xrandr
> > > Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
> > > HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x
> > > axis y axis) 521mm x 293mm
> > >    1920x1080     60.00*+  50.00    59.94
> > >    1920x1080i    60.00    50.00    59.94
> > >    1680x1050     59.88
> > >    1280x1024     75.02    60.02
> > >    1440x900      59.90
> > >    1280x960      60.00
> > >    1152x864      75.00
> > >    1280x720      60.00    50.00    59.94
> > >    1440x576      50.00
> > >    1024x768      75.03    70.07    60.00
> > >    1440x480      60.00    59.94
> > >    832x624       74.55
> > >    800x600       72.19    75.00    60.32    56.25
> > >    720x576       50.00
> > >    720x480       60.00    59.94
> > >    640x480       75.00    72.81    66.67    60.00    59.94
> > >    720x400       70.08
> > > HDMI-2 disconnected (normal left inverted right x axis y axis)
> > >
> > > 2. Unplug the HDMI cable from HDMI0 port.
> > > 3. Plug the HDMI cable to **HDMI1** port.
> > > $ xrandr
> > > Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
> > > HDMI-1 disconnected (normal left inverted right x axis y axis)
> > > HDMI-2 connected primary 1920x1080+0+0 (normal left inverted right x
> > > axis y axis) 521mm x 293mm
> > >    1920x1080     60.00*+  50.00    59.94
> > >    1920x1080i    60.00    50.00    59.94
> > >    1680x1050     59.88
> > >    1280x1024     75.02    60.02
> > >    1440x900      59.90
> > >    1280x960      60.00
> > >    1152x864      75.00
> > >    1280x720      60.00    50.00    59.94
> > >    1440x576      50.00
> > >    1024x768      75.03    70.07    60.00
> > >    1440x480      60.00    59.94
> > >    832x624       74.55
> > >    800x600       72.19    75.00    60.32    56.25
> > >    720x576       50.00
> > >    720x480       60.00    59.94
> > >    640x480       75.00    72.81    66.67    60.00    59.94
> > >    720x400       70.08
> > >
> > > 4. Unplug the HDMI cable from **HDMI1** port.
> > > 5. Plug the HDMI cable back to HDMI0 port.
> > > $ xrandr
> > > Screen 0: minimum 320 x 200, current 1368 x 768, maximum 2048 x 2048
> > > HDMI-1 connected primary 1368x768+0+0 (normal left inverted right x
> > > axis y axis) 0mm x 0mm
> > >    1368x768      59.88*
> > >    1360x768      59.80
> > >    1280x800      59.81
> > >    1152x864      60.00
> > >    1280x720      59.86
> > >    1024x768      60.00
> > >    1024x576      59.90
> > >    960x540       59.63
> > >    800x600       60.32
> > >    800x450       59.82
> > >    700x450       59.88
> > >    640x480       59.94
> > >    684x384       59.88    59.85
> > >    680x384       59.80    59.96
> > >    640x400       59.88    59.98
> > >    576x432       60.06
> > >    640x360       59.86    59.83
> > >    512x384       60.00
> > >    512x288       60.00    59.92
> > >    480x270       59.63    59.82
> > >    400x300       60.32
> > >    320x240       60.05
> > > HDMI-2 disconnected (normal left inverted right x axis y axis)
> >
> > Sorry for getting back at it so late. I just tested with modetest only
> > and my current branch and it seems to behave properly. Did you had to
> > run X to get that issue, or is it just how you noticed it?
> >
> > Also, was that with the branch based on 5.7 I pushed on my git tree on
> > kernel.org or some earlier revision of the series?
> 
> Thanks for coming back :)
> 
> I use GNOME 3.36 with Xorg 1.20.4.
> 
> To understand when it starts to hit the issues, I separate to step by step:
> 1. System boots into command line mode first (systemd multi-user.target)
> 2. Execute Xorg, then xterm.
> 3. Execute mutter upon the screen of Xorg.
> 
> I tried both branches rpi4-kms and rpi4-kms-5.7 of
> https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git
> Both of the branches hit issues:
> * The screen flashes suddenly sometimes.  This happens after mutter is launched.
> * The higher resolutions, like 1920x1080 ... are lost after hot
> re-plug HDMI cable (HDMI0).  HDMI cable connects to HDMI0 -> HDMI1 ->
> HDMI0.  This happens not only with GNOME, but also pure Xorg.

I just tested with raspbian exactly this, running the same xorg version:
https://pastebin.com/3fKeFPxf

And without X involved, modetest also reports the modes properly, so
it's probably something in either the DDX you're using or Gnome/mutter.

Maxime