1 From 154a12e5c0d417cae205b8e16431f29c627311e6 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Wed, 23 Jun 2021 11:54:58 +0200
4 Subject: [PATCH] drm/vc4: Notify the firmware when DRM is in charge
6 Once the call to drm_fb_helper_remove_conflicting_framebuffers() has
7 been made, simplefb has been unregistered and the KMS driver is entirely
8 in charge of the display.
10 Thus, we can notify the firmware it can free whatever resource it was
11 using to maintain simplefb functional.
13 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
15 drivers/gpu/drm/vc4/vc4_drv.c | 19 +++++++++++++++++++
16 1 file changed, 19 insertions(+)
18 --- a/drivers/gpu/drm/vc4/vc4_drv.c
19 +++ b/drivers/gpu/drm/vc4/vc4_drv.c
21 #include <drm/drm_fb_helper.h>
22 #include <drm/drm_vblank.h>
24 +#include <soc/bcm2835/raspberrypi-firmware.h>
26 #include "uapi/drm/vc4_drm.h"
29 @@ -305,8 +307,25 @@ static int vc4_drm_bind(struct device *d
33 + node = of_parse_phandle(dev->of_node, "raspberrypi,firmware", 0);
35 + vc4->firmware = rpi_firmware_get(dev->of_node);
39 + return -EPROBE_DEFER;
42 drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
44 + if (vc4->firmware) {
45 + ret = rpi_firmware_property(vc4->firmware,
46 + RPI_FIRMWARE_NOTIFY_DISPLAY_DONE,
49 + drm_warn(drm, "Couldn't stop firmware display driver: %d\n", ret);
52 ret = component_bind_all(dev, drm);