From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17F50C4363D for ; Fri, 25 Sep 2020 13:09:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AAC0C2076B for ; Fri, 25 Sep 2020 13:09:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="r33PX9Ac"; dkim=temperror (0-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="Fa+1kpp9"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="UFDUzS4x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAC0C2076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=p5cHbr2FWyt+f9FMhCwkIRO502TNBodgshHsOONlzYQ=; b=r33PX9AcaK7HyvAFp6EZh8zvTG 7w/tft3Bm2+yebI23BsJiN3FEQIGha6XoU8KS0SX2XnvbOXopg/7wZv2LkBEHPwLnYocwBkVd0adC BHK+CH7PO6MEhnlL+av5DbRNzV+U3CDEIYe/bQho38L4jbrgNkRq3mhhlQgDGt1AKUfSadxdbOJmm KbKhT1+mIGIivdy+W+7RkDQbHh+e9qhgmdVMK6WAHVL8PuUd1sR2dwXPumPCV0szouiQPOuR47uCO 7nSbB7xTcAcl33UCOV5VSJU/9DtcHq1kk9rvZm2gdq/29Z0ukbeUghGXfkmwotsfD2yzjlHUhrEKE zcmtMK0w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLnS8-0005Dt-EF; Fri, 25 Sep 2020 13:07:56 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLnS1-0005C9-Aj; Fri, 25 Sep 2020 13:07:50 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id C1618580143; Fri, 25 Sep 2020 09:07:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 25 Sep 2020 09:07:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=YM2DjL5FV7a6DzHDYshCBUS/UB n0d03kAZLJ2AU9u7I=; b=Fa+1kpp9VITzlI2/FwoQaOo0Sf3LHXS3U2CcncbMfj cJhwQSSqwpvgHlZ/flVspGN1mfQ78slVPWGPG59C0Th1Kf0v4vGzPPKUsy/juMgH 3J6kS+ioqlp2ppCJigj+GdJOFjM/STMz7QIep9+SR3AM6stMgmHehwlP6c+v6/dk QvspArhVf6/NtXfR3ujt3WFJRZDOxkI+/T/TT/MvD4AqX05t2HILhIAHVH0+yDfj 0lA+6/OkP15vPEud8f2EzlzXN7yss3Hn5k80VI8DkBOCpYZFVV+j9H2sCgUkjBt5 9caCAujeV3MKMHM6gdTgF9dFRsGngYCV3h9Fcrdcfndw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=YM2DjL5FV7a6DzHDY shCBUS/UBn0d03kAZLJ2AU9u7I=; b=UFDUzS4xiY7zYZLFfdcyaW4duS18dwdOV Hkmvdwkz9RNjvR2KrlOV9i+2aVYv82zXEfmIu6W7RjH7DCAWQZq7nE3rGU1Yruoe YbeDA3wnRa2m88mrZ7XuMhET9yQ2Dsi4Op9RkEXcZcOK/9/rKNp4BQQnWi9C9wc9 ZaWSXZVfrV5vJU4YwfxBnEmah4YECI5Ozo5eBprPTYNcDU5+sb7kHbswDLo4s2ag u2NfE4uhpbxcINz62UrzgeVmKFIOx23uf9FYQ02CHyql6lkfFrmdEYHahA6vEXQq DaSHAHVnuIm6BdtscQBh2yqytZVh28DFrn/Tu6PZZbuEw9XU1e08A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepofgrgihimhgvucft ihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtthgvrh hnpeejffehuddvvddvlefhgeelleffgfeijedvhefgieejtdeiueetjeetfeeukeejgeen ucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 26306328005A; Fri, 25 Sep 2020 09:07:46 -0400 (EDT) From: Maxime Ripard To: Mark Rutland , Rob Herring , Frank Rowand , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Eric Anholt Subject: [PATCH 1/2] drm/vc4: hdmi: Disable Wifi Frequencies Date: Fri, 25 Sep 2020 15:07:43 +0200 Message-Id: <20200925130744.575725-1-maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200925_090749_437463_AA0EA23D X-CRM114-Status: GOOD ( 16.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Tim Gover , Dave Stevenson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- .../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(-) diff --git a/Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml b/Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml index 03a76729d26c..63e7fe999c0a 100644 --- a/Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml +++ b/Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml @@ -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 diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index acfb4e235214..74da7c00ecd0 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -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); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index 40e51ece8efe..6618ee758890 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel