From patchwork Tue Apr 13 14:54:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 420782 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 B3423C433B4 for ; Tue, 13 Apr 2021 14:54:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EA55613B1 for ; Tue, 13 Apr 2021 14:54:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231775AbhDMOzJ (ORCPT ); Tue, 13 Apr 2021 10:55:09 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:45321 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231721AbhDMOzJ (ORCPT ); Tue, 13 Apr 2021 10:55:09 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id A48B22D5; Tue, 13 Apr 2021 10:54:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 13 Apr 2021 10:54:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=WTTxhz7TT0y6m FK14ROq7Hd8G4QJsosdSX03P/4q+SQ=; b=W1f+iG5AQRFA7Rqci6l/PLRA3pk/j 3ii7OB73GBXFjrjnd5SVrIAQtDcJqASqW/3lX7lQQS3oFBKUk1jWYmJxIYlmpUE8 o3O05Hwj2IcMqD8tmQNqOrE8GqSfLOGMGwDgnmS73yTftsP35bLr9XZPsRS8DMby VJNXDsKPTkeiGpWRWENkI0kpCjEgvHl9lQkcBUxAKMUtgSC8jecoVWOG0wJvYj45 xPQcbpVeRK+auS3VK1F43sae6UGbt2jP76cheV6JaKXVAFq5BtMMks84oZNcmDMx oJI39MhIOZ0u/qZf84UJzkOtxmNNdREh+Mzhh8ck6ukCcgp9bkm/R16qg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=WTTxhz7TT0y6mFK14ROq7Hd8G4QJsosdSX03P/4q+SQ=; b=Ei1JX/Bf bStkwigCilkmw9rKo2AuX748DFFs+lyM7RaFM3RY+NlXOhpc5RQpG1FcCqaUbJl5 uaDiR+sBI9gnDFe2jB8HUSd6vDwqWyt4/kQSN2LY8xm7rddefhSnrs0KC+HYICto e1uYEBhoLPwT6gEvIZ2reIqw7r75imKq/ajYtS0VGNxfnkDcV+ojuuW1pNvhtYMQ 03AqR5sa45CZmytS2ZB1JKrDXPcCnjM6xF5Q388JmDGNTqRRCKOFWxDJ+f5lBdwF dr1FmCCprXKQv3diYtiz/RSz7n/b7w9HWO5TDs4rhBJFaM8zoqgavOgoaaGdLdPv 7n+x+zoXN1AIfg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekledgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh 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 DB31F24005E; Tue, 13 Apr 2021 10:54:45 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Phil Elwell , Nicolas Saenz Julienne , Tim Gover , linux-rpi-kernel@lists.infradead.org, Dave Stevenson , Daniel Vetter , David Airlie , bcm-kernel-feedback-list@broadcom.com, stable@vger.kernel.org Subject: [PATCH v3 1/9] drm/vc4: txp: Properly set the possible_crtcs mask Date: Tue, 13 Apr 2021 16:54:33 +0200 Message-Id: <20210413145441.483977-2-maxime@cerno.tech> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210413145441.483977-1-maxime@cerno.tech> References: <20210413145441.483977-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The current code does a binary OR on the possible_crtcs variable of the TXP encoder, while we want to set it to that value instead. Cc: # v5.9+ Fixes: 39fcb2808376 ("drm/vc4: txp: Turn the TXP into a CRTC of its own") Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_txp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c index c0122d83b651..2fc7f4b5fa09 100644 --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -507,7 +507,7 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) return ret; encoder = &txp->connector.encoder; - encoder->possible_crtcs |= drm_crtc_mask(crtc); + encoder->possible_crtcs = drm_crtc_mask(crtc); ret = devm_request_irq(dev, irq, vc4_txp_interrupt, 0, dev_name(dev), txp); From patchwork Tue Apr 13 14:54:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 420781 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 13233C43460 for ; Tue, 13 Apr 2021 14:54:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBB53613B1 for ; Tue, 13 Apr 2021 14:54:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231830AbhDMOzO (ORCPT ); Tue, 13 Apr 2021 10:55:14 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:39313 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231378AbhDMOzM (ORCPT ); Tue, 13 Apr 2021 10:55:12 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id 4FF34166D; Tue, 13 Apr 2021 10:54:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 13 Apr 2021 10:54:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=LuOQk5RAkKI6i R1Tmdd65UjMydvRnA/88JIeEOIKERI=; b=rHt0A3kHsEtuwiiWsyOMJ8H+FtT++ KwU9nq+MMd3+KtSLZ8oQ2nwLG/u/v4yDSJGM+l3X6ax5WKk525wr6lTJlmVXQTIW kIr0IIAgystirQGmBii3/d0vvuHBUb6vkIh5vDLFsxub4aKw7dvKaGcMbguXP9gb 8YGc8NFAf1pMI2HatqbYJxNEO2w6uSAcu7MP46YxO2qZNrFyjsr7qlzYZ/nBEup5 Y3vl+GHzdtiwTRcno39YTXFsLEoOuXeqkHjlaKB9xjoMOwI6Awv1lLLIQSGDTOsX lcOauCkjDtLjqRJPkYgWfgjvFLHZ23PMUII+dcGEjYTFT0wjPxaW0xSOg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=LuOQk5RAkKI6iR1Tmdd65UjMydvRnA/88JIeEOIKERI=; b=qpP00lPJ m6R/47Vel75EcreEzQZGRWx7pTVpx/BP5+atuVrZiPM4wOJy2KB0VHJSYbltZXYA Bownfa4o11EwI/tFc8Ylc7xOCTLH/qwWQHPGQ6126TgamJyFouQY/LwfMqz0IJ3W AeqQCot9Rg8OSyeoLj7xCcHrMjuQJVR16+fE9moR8ne0eSaohK/RZzVnsDwIocny pFELS9b+NTGf+cO+KHe7bOc0XpLuL1gOqiN/OLB/z/inaMhDfGlQjcdThUfxOnE6 f6qgZrkV16jTBzL78bovnMaKCvr3q9Ka1kw339UMsEELG6mQ3A9MPtqkmYMqnkCy 4UBGMAe4GG3A7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekledgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh 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 9DC61240068; Tue, 13 Apr 2021 10:54:50 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Phil Elwell , Nicolas Saenz Julienne , Tim Gover , linux-rpi-kernel@lists.infradead.org, Dave Stevenson , Daniel Vetter , David Airlie , bcm-kernel-feedback-list@broadcom.com, stable@vger.kernel.org Subject: [PATCH v3 4/9] drm/vc4: hdmi: Prevent clock unbalance Date: Tue, 13 Apr 2021 16:54:36 +0200 Message-Id: <20210413145441.483977-5-maxime@cerno.tech> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210413145441.483977-1-maxime@cerno.tech> References: <20210413145441.483977-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Since we fixed the hooks to disable the encoder at boot, we now have an unbalanced clk_disable call at boot since we never enabled them in the first place. Let's mimic the state of the hardware and enable the clocks at boot if the controller is enabled to get the use-count right. Cc: # v5.10+ Fixes: 09c438139b8f ("drm/vc4: hdmi: Implement finer-grained hooks") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 1fda574579af..9c919472ae84 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1995,6 +1995,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) if (vc4_hdmi->variant->reset) vc4_hdmi->variant->reset(vc4_hdmi); + if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || + of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && + HDMI_READ(HDMI_VID_CTL) & VC4_HD_VID_CTL_ENABLE) { + clk_prepare_enable(vc4_hdmi->pixel_clock); + clk_prepare_enable(vc4_hdmi->hsm_clock); + clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); + } + pm_runtime_enable(dev); drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);