bcm27xx: update patches from RPi foundation
[openwrt/staging/ldir.git] / target / linux / bcm27xx / patches-5.4 / 950-0577-drm-vc4-hdmi-Use-local-vc4_hdmi-directly.patch
1 From 985efd0f9da3d2b60e34d10efee969e4dfd85a12 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Mon, 6 Jan 2020 18:44:36 +0100
4 Subject: [PATCH] drm/vc4: hdmi: Use local vc4_hdmi directly
5
6 The function vc4_hdmi_connector_detect access its vc4_hdmi struct by
7 dereferencing the pointer in the structure vc4_dev. This will cause some
8 issues when we will have multiple HDMI controllers, so let's just use the
9 local variable for now instead of dereferencing that pointer all the time,
10 and we'll fix the local variable later.
11
12 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
13 ---
14 drivers/gpu/drm/vc4/vc4_hdmi.c | 12 ++++++------
15 1 file changed, 6 insertions(+), 6 deletions(-)
16
17 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
18 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
19 @@ -124,20 +124,20 @@ vc4_hdmi_connector_detect(struct drm_con
20 struct vc4_dev *vc4 = to_vc4_dev(dev);
21 struct vc4_hdmi *vc4_hdmi = vc4->hdmi;
22
23 - if (vc4->hdmi->hpd_gpio) {
24 - if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^
25 - vc4->hdmi->hpd_active_low)
26 + if (vc4_hdmi->hpd_gpio) {
27 + if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^
28 + vc4_hdmi->hpd_active_low)
29 return connector_status_connected;
30 - cec_phys_addr_invalidate(vc4->hdmi->cec_adap);
31 + cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
32 return connector_status_disconnected;
33 }
34
35 - if (drm_probe_ddc(vc4->hdmi->ddc))
36 + if (drm_probe_ddc(vc4_hdmi->ddc))
37 return connector_status_connected;
38
39 if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED)
40 return connector_status_connected;
41 - cec_phys_addr_invalidate(vc4->hdmi->cec_adap);
42 + cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
43 return connector_status_disconnected;
44 }
45