a15245626fc3e924804d924c9a0e400a32063e38
[openwrt/staging/stintel.git] /
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
5 kms
6
7 fkms driver still wants firmware display to be active
8
9 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
10 ---
11 drivers/gpu/drm/vc4/vc4_drv.c | 14 +++++++++++++-
12 1 file changed, 13 insertions(+), 1 deletion(-)
13
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_
17 {}
18 };
19
20 +/*
21 + * we need this helper function for determining presence of fkms
22 + * before it's been bound
23 + */
24 +static bool firmware_kms(void)
25 +{
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"));
30 +}
31 +
32 static int vc4_drm_bind(struct device *dev)
33 {
34 struct platform_device *pdev = to_platform_device(dev);
35 @@ -318,7 +330,7 @@ static int vc4_drm_bind(struct device *d
36
37 drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
38
39 - if (vc4->firmware) {
40 + if (vc4->firmware && !firmware_kms()) {
41 ret = rpi_firmware_property(vc4->firmware,
42 RPI_FIRMWARE_NOTIFY_DISPLAY_DONE,
43 NULL, 0);