1 From b14001459c04ec0d4a99c1a422077fbce5a0aebc Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Mon, 5 Jul 2021 11:43:12 +0100
4 Subject: [PATCH] vc4/drv: Only notify firmware of display done with
7 fkms driver still wants firmware display to be active
9 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
11 drivers/gpu/drm/vc4/vc4_drv.c | 14 +++++++++++++-
12 1 file changed, 13 insertions(+), 1 deletion(-)
14 --- a/drivers/gpu/drm/vc4/vc4_drv.c
15 +++ b/drivers/gpu/drm/vc4/vc4_drv.c
16 @@ -258,6 +258,18 @@ const struct of_device_id vc4_dma_range_
21 + * we need this helper function for determining presence of fkms
22 + * before it's been bound
24 +static bool firmware_kms(void)
26 + return of_device_is_available(of_find_compatible_node(NULL, NULL,
27 + "raspberrypi,rpi-firmware-kms")) ||
28 + of_device_is_available(of_find_compatible_node(NULL, NULL,
29 + "raspberrypi,rpi-firmware-kms-2711"));
32 static int vc4_drm_bind(struct device *dev)
34 struct platform_device *pdev = to_platform_device(dev);
35 @@ -318,7 +330,7 @@ static int vc4_drm_bind(struct device *d
37 drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
39 - if (vc4->firmware) {
40 + if (vc4->firmware && !firmware_kms()) {
41 ret = rpi_firmware_property(vc4->firmware,
42 RPI_FIRMWARE_NOTIFY_DISPLAY_DONE,