mbox series

[0/5] drm/vc4: Use the firmware to stop the display pipeline

Message ID 20211117145040.334827-1-maxime@cerno.tech (mailing list archive)
Headers show
Series drm/vc4: Use the firmware to stop the display pipeline | expand

Message

Maxime Ripard Nov. 17, 2021, 2:50 p.m. UTC
Hi,

The VC4 driver has had limited support to disable the HDMI controllers and
pixelvalves at boot if the firmware has enabled them.

However, this proved to be limited, and a bit unreliable so a new firmware
command has been introduced some time ago to make it free all its resources and
disable any display output it might have enabled.

This series takes advantage of that command to call it once the transition from
simplefb to the KMS driver has been done.

Let me know what you think,
Maxime

Maxime Ripard (5):
  dt-bindings: display: vc4: Add optional phandle to firmware
  firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE
  drm/vc4: Remove conflicting framebuffers before callind bind_all
  drm/vc4: Notify the firmware when DRM is in charge
  ARM: dts: rpi: Add the firmware node to vc4

 .../bindings/display/brcm,bcm2835-vc4.yaml    |  5 ++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi            |  4 +++
 drivers/gpu/drm/vc4/vc4_drv.c                 | 27 ++++++++++++++++---
 drivers/gpu/drm/vc4/vc4_drv.h                 |  2 ++
 include/soc/bcm2835/raspberrypi-firmware.h    |  1 +
 5 files changed, 35 insertions(+), 4 deletions(-)

Comments

Nicolas Saenz Julienne Nov. 30, 2021, 11:45 a.m. UTC | #1
Hi Maxime,

On Wed, 2021-11-17 at 15:50 +0100, Maxime Ripard wrote:
> Hi,
> 
> The VC4 driver has had limited support to disable the HDMI controllers and
> pixelvalves at boot if the firmware has enabled them.
> 
> However, this proved to be limited, and a bit unreliable so a new firmware
> command has been introduced some time ago to make it free all its resources and
> disable any display output it might have enabled.
> 
> This series takes advantage of that command to call it once the transition from
> simplefb to the KMS driver has been done.

I think it would make sense to integrate this funtionality into
'reset/reset-raspberrypi.c' and pass it to VC4 as a reset controller. It fits
the same startup situation as the one we have with the USB controller. Also, it
would contain the firmware weirdness in a single spot.

Otherwise, please use 'devm_rpi_firmware_get()'.

Regards,
Nicolas
Maxime Ripard Dec. 3, 2021, 1:50 p.m. UTC | #2
Hi Nicolas,

On Tue, Nov 30, 2021 at 12:45:49PM +0100, nicolas saenz julienne wrote:
> On Wed, 2021-11-17 at 15:50 +0100, Maxime Ripard wrote:
> > The VC4 driver has had limited support to disable the HDMI controllers and
> > pixelvalves at boot if the firmware has enabled them.
> > 
> > However, this proved to be limited, and a bit unreliable so a new firmware
> > command has been introduced some time ago to make it free all its resources and
> > disable any display output it might have enabled.
> > 
> > This series takes advantage of that command to call it once the transition from
> > simplefb to the KMS driver has been done.
> 
> I think it would make sense to integrate this funtionality into
> 'reset/reset-raspberrypi.c' and pass it to VC4 as a reset controller. It fits
> the same startup situation as the one we have with the USB controller. Also, it
> would contain the firmware weirdness in a single spot.

I don't really think it makes sense. It's not really made for that
purpose, affects multiple devices (basically, all of the devices from
the display pipeline), and can even have some side effects on clocks and
memory. Plus, it can only be done once iirc, so a later call to reset
the pipeline will be ineffective, even if we changed its state.

So yeah, it doesn't really fit into the reset abstraction.

> Otherwise, please use 'devm_rpi_firmware_get()'.

Will do, thanks!
Maxime