[PATCH v5 0/7] drm/vc4: Fix the core clock behaviour

From: Maxime Ripard
Date: Thu Oct 27 2022 - 08:53:00 EST


Hi,

Those patches used to be part of a larger clock fixes series:
https://lore.kernel.org/linux-clk/20220715160014.2623107-1-maxime@xxxxxxxxxx/

However, that series doesn't seem to be getting anywhere, so I've split out
these patches that fix a regression that has been there since 5.18 and that
prevents the 4k output from working on the RaspberryPi4.

Hopefully, we will be able to merge those patches through the DRM tree to avoid
any further disruption.

Let me know what you think,
Maxime

To: Florian Fainelli <f.fainelli@xxxxxxxxx>
To: Broadcom internal kernel review list <bcm-kernel-feedback-list@xxxxxxxxxxxx>
To: Ray Jui <rjui@xxxxxxxxxxxx>
To: Scott Branden <sbranden@xxxxxxxxxxxx>
To: Michael Turquette <mturquette@xxxxxxxxxxxx>
To: Stephen Boyd <sboyd@xxxxxxxxxx>
To: Emma Anholt <emma@xxxxxxxxxx>
To: Maxime Ripard <mripard@xxxxxxxxxx>
To: David Airlie <airlied@xxxxxxxx>
To: Daniel Vetter <daniel@xxxxxxxx>
Cc: Stefan Wahren <stefan.wahren@xxxxxxxx>
Cc: linux-rpi-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-clk@xxxxxxxxxxxxxxx
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: Dom Cobley <popcornmix@xxxxxxxxx>
Signed-off-by: Maxime Ripard <maxime@xxxxxxxxxx>

---
Changes in v5:
- Changed the bool name
- Change type of variable storing the max rate to unsigned int
- Link to v4: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v4-0-a1b40526df3e@xxxxxxxxxx

Changes in v4:
- Move the rpi_firmware_of_match to avoid confusion
- Link to v3: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v3-0-fc56729d11fe@xxxxxxxxxx

Changes in v3:
- Return UINT_MAX when the firmware call fails in the _get_max_rate function
- Link to v2: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v2-0-983276b83f62@xxxxxxxxxx

Changes in v2:
- Dropped the clock patches, made an ad-hoc function in the firmware driver
- Link to v1: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v1-0-c52bd642f7c6@xxxxxxxxxx

---
Dom Cobley (1):
drm/vc4: hdmi: Add more checks for 4k resolutions

Maxime Ripard (6):
firmware: raspberrypi: Introduce rpi_firmware_find_node()
firmware: raspberrypi: Move the clock IDs to the firmware header
firmware: raspberrypi: Provide a helper to query a clock max rate
drm/vc4: hdmi: Fix hdmi_enable_4kp60 detection
drm/vc4: hdmi: Rework hdmi_enable_4kp60 detection code
drm/vc4: Make sure we don't end up with a core clock too high

drivers/clk/bcm/clk-raspberrypi.c | 19 -----------
drivers/firmware/raspberrypi.c | 38 ++++++++++++++++++----
drivers/gpu/drm/vc4/vc4_drv.h | 16 +++++++++
drivers/gpu/drm/vc4/vc4_hdmi.c | 25 +++++++-------
drivers/gpu/drm/vc4/vc4_hdmi.h | 8 -----
drivers/gpu/drm/vc4/vc4_hvs.c | 26 +++++++++++++++
drivers/gpu/drm/vc4/vc4_kms.c | 13 +++++---
include/soc/bcm2835/raspberrypi-firmware.h | 52 ++++++++++++++++++++++++++++++
8 files changed, 147 insertions(+), 50 deletions(-)
---
base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780
change-id: 20220815-rpi-fix-4k-60-17273650429d

Best regards,
--
Maxime Ripard <maxime@xxxxxxxxxx>