drm/vc4: hdmi: Disable Wifi Frequencies
Subsystems (5)
PATCH 1/2 drm/vc4: hdmi: Disable Wifi Frequencies
There's cross-talk on the RPi4 between the 2.4GHz channels used by the WiFi chip and some resolutions, most notably 1440p at 60Hz.
In such a case, we can either reject entirely the mode, or lower slightly the pixel frequency to remove the overlap. Let's go for the latter.
--- .../bindings/display/brcm,bcm2711-hdmi.yaml | 6 ++++++ drivers/gpu/drm/vc4/vc4_hdmi.c | 14 +++++++++++++- drivers/gpu/drm/vc4/vc4_hdmi.h | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml +6 -0
@@ -76,6 +76,12 @@ properties: resets: maxItems: 1 + raspberrypi,disable-wifi-frequencies: + type: boolean + description: > + Should the pixel frequencies in the WiFi frequencies range be + avoided? + required: - compatible - reg
drivers/gpu/drm/vc4/vc4_hdmi.c +13 -1
@@ -877,13 +877,22 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder,struct vc4_hdmi_connector_state *vc4_state =conn_state_to_vc4_hdmi_conn_state (conn_state);struct drm_display_mode *mode = &crtc_state->adjusted_mode;struct vc4_hdmi *vc4_hdmi =encoder_to_vc4_hdmi (encoder); -unsigned long long pixel_rate = mode->clock *1000 ; +unsigned long long pixel_rate;if (vc4_hdmi->variant->broken_odd_h_timings && ((mode->hdisplay %2 ) || (mode->hsync_start %2 ) || (mode->hsync_end %2 ) || (mode->htotal %2 )))return -EINVAL ; +/* +* The 1440p@60 pixel rate is in the same range than the WiFi +* channels. Slightly lower the frequency to bring it out of the +* WiFi range. +*/ +if (vc4_hdmi->disable_wifi_frequencies && mode->clock ==241500 ) + mode->clock =238560 ; + + pixel_rate = mode->clock *1000 ;if (mode->flags &DRM_MODE_FLAG_DBLCLK ) pixel_rate *=2 ;
@@ -1837,6 +1846,9 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->hpd_active_low = hpd_gpio_flags &OF_GPIO_ACTIVE_LOW ; } + vc4_hdmi->disable_wifi_frequencies = +of_property_read_bool (dev->of_node,"raspberrypi,disable-wifi-frequencies" ); +pm_runtime_enable (dev);drm_simple_encoder_init (drm, encoder,DRM_MODE_ENCODER_TMDS );
drivers/gpu/drm/vc4/vc4_hdmi.h +8 -0
@@ -143,6 +143,14 @@ struct vc4_hdmi {int hpd_gpio;bool hpd_active_low; +/* +* On some systems (like the RPi4), some modes are in the same +* frequency range than the WiFi channels (1440p@60Hz for +* example). Should we take evasive actions because that system +* has a wifi adapter. +*/ +bool disable_wifi_frequencies; +struct cec_adapter *cec_adap;struct cec_msg cec_rx_msg;bool cec_tx_ok;
Signature · 1 line
2.26.2
PATCH 2/2 ARM: dts: rpi-4: disable wifi frequencies
The RPi4 WiFi chip and HDMI outputs have some frequency overlap with crosstalk around 2.4GHz. Let's mark it as such so we can use some evasive maneuvers.
--- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/bcm2711-rpi-4-b.dts +2 -0
@@ -174,12 +174,14 @@ &gpio { &hdmi0 { clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; clock-names = "hdmi", "bvb", "audio", "cec"; + raspberrypi,disable-wifi-frequencies; status = "okay"; }; &hdmi1 { clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; clock-names = "hdmi", "bvb", "audio", "cec"; + raspberrypi,disable-wifi-frequencies; status = "okay"; };
Signature · 1 line
2.26.2
Quoted 44 lines · Maxime Ripard
There's cross-talk on the RPi4 between the 2.4GHz channels used by the WiFi chip and some resolutions, most notably 1440p at 60Hz.
In such a case, we can either reject entirely the mode, or lower slightly the pixel frequency to remove the overlap. Let's go for the latter.
Signed-off-by Maxime Ripard <[email protected]>--- .../bindings/display/brcm,bcm2711-hdmi.yaml | 6 ++++++ drivers/gpu/drm/vc4/vc4_hdmi.c | 14 +++++++++++++- drivers/gpu/drm/vc4/vc4_hdmi.h | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml +6
-0@@ -76,6 +76,12 @@ properties: resets: maxItems: 1 + raspberrypi,disable-wifi-frequencies: + type: boolean + description: > + Should the pixel frequencies in the WiFi frequencies range be + avoided? + required: - compatible - regdrivers/gpu/drm/vc4/vc4_hdmi.c +1
-1@@ -877,13 +877,22 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder,struct vc4_hdmi_connector_state *vc4_state =conn_state_to_vc4_hdmi_conn_state (conn_state);struct drm_display_mode *mode = &crtc_state->adjusted_mode;struct vc4_hdmi *vc4_hdmi =encoder_to_vc4_hdmi (encoder); -unsigned long long pixel_rate = mode->clock *1000 ; +unsigned long long pixel_rate; if (vc4_hdmi->variant->broken_odd_h_timings && ((mode->hdisplay % 2) || (mode->hsync_start % 2) ||
drivers/gpu/drm/vc4/vc4_hdmi.c static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, · line 893
Quoted 10 lines
drivers/gpu/drm/vc4/vc4_hdmi.c +7
-0(mode->hsync_end % 2) || (mode->htotal % 2)))return -EINVAL ; +/* +* The 1440p@60 pixel rate is in the same range than the WiFi +* channels. Slightly lower the frequency to bring it out of the +* WiFi range. +*/ +if (vc4_hdmi->disable_wifi_frequencies && mode->clock ==241500 ) + mode->clock =238560 ;
Don't you want to map for a (narrow) range of frequencies here? Just for that infamous 60p vs 59.99p thing and similar. And I think that would still be in that band you want to avoid.
-Daniel
Quoted 41 lines
drivers/gpu/drm/vc4/vc4_hdmi.c +5
-0+ + pixel_rate = mode->clock *1000 ;if (mode->flags &DRM_MODE_FLAG_DBLCLK ) pixel_rate *=2 ;@@ -1837,6 +1846,9 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->hpd_active_low = hpd_gpio_flags &OF_GPIO_ACTIVE_LOW ; } + vc4_hdmi->disable_wifi_frequencies = +of_property_read_bool (dev->of_node,"raspberrypi,disable-wifi-frequencies" ); +pm_runtime_enable (dev);drm_simple_encoder_init (drm, encoder,DRM_MODE_ENCODER_TMDS );drivers/gpu/drm/vc4/vc4_hdmi.h +8
-1@@ -143,6 +143,14 @@ struct vc4_hdmi {int hpd_gpio;bool hpd_active_low; +/* +* On some systems (like the RPi4), some modes are in the same +* frequency range than the WiFi channels (1440p@60Hz for +* example). Should we take evasive actions because that system +* has a wifi adapter. +*/ +bool disable_wifi_frequencies; +struct cec_adapter *cec_adap;struct cec_msg cec_rx_msg;bool cec_tx_ok; --2.26.2
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Hi Daniel,
Quoted 48 lines · Daniel Vetter
Quoted 47 lines · Maxime Ripard
There's cross-talk on the RPi4 between the 2.4GHz channels used by the WiFi chip and some resolutions, most notably 1440p at 60Hz.
In such a case, we can either reject entirely the mode, or lower slightly the pixel frequency to remove the overlap. Let's go for the latter.
Signed-off-by Maxime Ripard <[email protected]>--- .../bindings/display/brcm,bcm2711-hdmi.yaml | 6 ++++++ drivers/gpu/drm/vc4/vc4_hdmi.c | 14 +++++++++++++- drivers/gpu/drm/vc4/vc4_hdmi.h | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml +6
-0@@ -76,6 +76,12 @@ properties: resets: maxItems: 1 + raspberrypi,disable-wifi-frequencies: + type: boolean + description: > + Should the pixel frequencies in the WiFi frequencies range be + avoided? + required: - compatible - regdrivers/gpu/drm/vc4/vc4_hdmi.c +1
-1@@ -877,13 +877,22 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder,struct vc4_hdmi_connector_state *vc4_state =conn_state_to_vc4_hdmi_conn_state (conn_state);struct drm_display_mode *mode = &crtc_state->adjusted_mode;struct vc4_hdmi *vc4_hdmi =encoder_to_vc4_hdmi (encoder); -unsigned long long pixel_rate = mode->clock *1000 ; +unsigned long long pixel_rate;if (vc4_hdmi->variant->broken_odd_h_timings && ((mode->hdisplay %2 ) || (mode->hsync_start %2 ) || (mode->hsync_end %2 ) || (mode->htotal %2 )))return -EINVAL ;
Quoted 11 lines
drivers/gpu/drm/vc4/vc4_hdmi.c static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, · line 893
Quoted 7 lines
drivers/gpu/drm/vc4/vc4_hdmi.c +7
-0+/* +* The 1440p@60 pixel rate is in the same range than the WiFi +* channels. Slightly lower the frequency to bring it out of the +* WiFi range. +*/ +if (vc4_hdmi->disable_wifi_frequencies && mode->clock ==241500 ) + mode->clock =238560 ;Don't you want to map for a (narrow) range of frequencies here? Just for that infamous 60p vs 59.99p thing and similar. And I think that would still be in that band you want to avoid.
Testing for a range seems better indeed, I'll send a new version
Thanks!
Maxime
Rob Herring
maintainerQuoted 18 lines · Maxime Ripard
There's cross-talk on the RPi4 between the 2.4GHz channels used by the WiFi chip and some resolutions, most notably 1440p at 60Hz.
In such a case, we can either reject entirely the mode, or lower slightly the pixel frequency to remove the overlap. Let's go for the latter.
Signed-off-by Maxime Ripard <[email protected]>--- .../bindings/display/brcm,bcm2711-hdmi.yaml | 6 ++++++ drivers/gpu/drm/vc4/vc4_hdmi.c | 14 +++++++++++++- drivers/gpu/drm/vc4/vc4_hdmi.h | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml +0
-0
Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml properties: · line 83
Quoted 8 lines
Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml +5
-0@@ -76,6 +76,12 @@ properties: resets: maxItems: 1 + raspberrypi,disable-wifi-frequencies: + type: boolean + description: > + Should the pixel frequencies in the WiFi frequencies range be + avoided?
Based on googling the issue, perhaps should be a common property?
Hi Rob,
Quoted 22 lines · Rob Herring
Quoted 21 lines · Maxime Ripard
There's cross-talk on the RPi4 between the 2.4GHz channels used by the WiFi chip and some resolutions, most notably 1440p at 60Hz.
In such a case, we can either reject entirely the mode, or lower slightly the pixel frequency to remove the overlap. Let's go for the latter.
Signed-off-by Maxime Ripard <[email protected]>--- .../bindings/display/brcm,bcm2711-hdmi.yaml | 6 ++++++ drivers/gpu/drm/vc4/vc4_hdmi.c | 14 +++++++++++++- drivers/gpu/drm/vc4/vc4_hdmi.h | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml +0
-0@@ -76,6 +76,12 @@ properties: resets: maxItems: 1
Quoted 7 lines
Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml properties: · line 83
Quoted 5 lines
Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml +5
-0+ raspberrypi,disable-wifi-frequencies: + type: boolean + description: > + Should the pixel frequencies in the WiFi frequencies range be + avoided?Based on googling the issue, perhaps should be a common property?
This is a fairly generic issue indeed, but went for the most non-intrusive way. Do you have a better idea of a generic name, or do you just want me to drop the vendor prefix?
Maxime