From patchwork Fri Aug 21 07:10:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoegeun Kwon X-Patchwork-Id: 11728287 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D541722 for ; Fri, 21 Aug 2020 07:12:26 +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 367F8214F1 for ; Fri, 21 Aug 2020 07:12:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wHHGfL+l"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="UtVhY1IT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 367F8214F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To: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:List-Owner; bh=WDacNqaqH3rEz2hRcIrqXW55g5QJ9gcw+2n+8z35CQs=; b=wHHGfL+l+W0shlD5EAqfUdIEpV Gavk6UT+wNfZwXSZqHNhuh14szRNb28f3ks6kx6Na5wcU7mNtws8t0Wmjq1aXa4GrgMT7VvG0mE9p CmTL76PlvEf+B3c6GlTcX5Fh0bSMz+nACyywdCLobUMOP8J3oJkq8TKJ5Voc3RE+hSB2N//4WPsoD LacQopMcIaozsBdPUvwVucJa3KXs+t9k35XTJTVSTwuKGUDYLe9oxgrTE8rIj4iC1ixsK0miQKAhe 5WaDsPSadAgjudYkAvHKC+PlY6wasPV//YP5wY0PACErz5Pfhm4VWhCVw3FME1sgUkxVqSWIZjZ6x UwMlRjwg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k91DS-0004Js-1i; Fri, 21 Aug 2020 07:11:58 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k91D0-00045i-Kx for linux-arm-kernel@lists.infradead.org; Fri, 21 Aug 2020 07:11:33 +0000 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20200821071127epoutp02b4fcb719db05bd861f148b9d25f03bf7~tNvlIJw9m0820408204epoutp02I for ; Fri, 21 Aug 2020 07:11:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20200821071127epoutp02b4fcb719db05bd861f148b9d25f03bf7~tNvlIJw9m0820408204epoutp02I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597993887; bh=aV0x4n6wQckii0JDBHb/o4LkoOEhIHxl7xns9Eg3VhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UtVhY1IT7h8a7RPeMP8EH0ah3Fz7mAeOoxmpmz9GefxUhZUfAZV5+NTsGFIePBtH6 aPsKL3regcqJ4GseeXzLFGQQe/M7xzxD+3BxUS9TQfFkM97Nh8XuvGfN5kq5wlCR2l 2P1j3Ks7W+N1c4X8KJRWDfmTj4YP7HFmako+vQhw= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20200821071126epcas1p4d9ce4f46c18803992d1d7e22986ac3b3~tNvknpofv3245032450epcas1p4c; Fri, 21 Aug 2020 07:11:26 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.40.156]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4BXt3Z4g0JzMqYkr; Fri, 21 Aug 2020 07:11:22 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id A7.8D.18978.A937F3F5; Fri, 21 Aug 2020 16:11:22 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20200821071122epcas1p3d00dda4665f94192ac5e9ee829d0557d~tNvgqLEzS1277912779epcas1p3n; Fri, 21 Aug 2020 07:11:22 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200821071122epsmtrp2da61cd56d43dbcb30a9004682fdccc9e~tNvgpY4TN2521125211epsmtrp25; Fri, 21 Aug 2020 07:11:22 +0000 (GMT) X-AuditID: b6c32a35-603ff70000004a22-63-5f3f739ae0fc Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id BD.C1.08382.A937F3F5; Fri, 21 Aug 2020 16:11:22 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.111.64]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200821071121epsmtip2b93ad01672ed278eec482ed19b1d61e6~tNvgXmNBO2424724247epsmtip2y; Fri, 21 Aug 2020 07:11:21 +0000 (GMT) From: Hoegeun Kwon To: nsaenzjulienne@suse.de, eric@anholt.net, maxime@cerno.tech Subject: [PATCH 3/3] drm/vc4: hdmi: Add pixel bvb clock control Date: Fri, 21 Aug 2020 16:10:45 +0900 Message-Id: <20200821071045.24501-4-hoegeun.kwon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200821071045.24501-1-hoegeun.kwon@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCJsWRmVeSWpSXmKPExsWy7bCmge6sYvt4g7PP5SzW9h5lsXg7dzGL xfwj51gtrnx9z2ZxoPEyo8X75V1sFjuvrGWx2PT4GqvFx557rBaXd81hs5h4ewO7xYwf/xgt Lp5ytdg2azmbxbpbr9ksWvceYbf4d20ji8WjqfcZHYQ8mt4fY/N4f6OV3WPW/bNsHnfOnWfz 2DnrLrvHplWdbB73u48zeWxeUu/RevQXi0ffllWMHptPV3t83iQXwBOVbZORmpiSWqSQmpec n5KZl26r5B0c7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkD9J2SQlliTilQKCCxuFhJ386m KL+0JFUhI7+4xFYptSAlp8CyQK84Mbe4NC9dLzk/18rQwMDIFKgwITvj36fVTAVbRCuOz+hk bWDsFupi5OSQEDCRaFr9jr2LkYtDSGAHo8Sl00dZQRJCAp8YJeYdC4VIfGOUuPfwKhtMx94l j9kgEnsZJRZOugfV/plRYsOuz+wgVWwCuhJfe64zgdgiAnYSbT0HGUGKmAW2M0tcb+8GKxIW sJeYcO4R0D4ODhYBVYnH37hBwrwCthI3516D2iYvsXrDAWYQmxNozuI7S1lA5kgIXOCQWLRo CTtEkYvE0S23mCFsYYlXx7dAxaUkPr/bCzWoWOLKzFdQzQ2MEv0TZ0MVGUvsXzqZCeQIZgFN ifW79CHCihI7f89lBLGZBfgk3n3tAbtTQoBXoqMNGnZqEs8aDrBC2DISp3qXM0HYHhLvJx+G BspERonnJ88xT2CUm4WwYQEj4ypGsdSC4tz01GLDAkPkKNvECE6+WqY7GCe+/aB3iJGJg/EQ owQHs5IIb+9e63gh3pTEyqrUovz4otKc1OJDjKbAwJvILCWanA9M/3kl8YamRsbGxhYmhmam hoZK4rwPbynECwmkJ5akZ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PXOCf27ZQIqpn9nbPSt+X0086vdK4+oa5/8bhcPVwNe4vOW0vZkg/ O/os98rcibqdnfF5Vm87cytSj/qUqVs9dv2QJ6pyYt6rS7uy1dpUfEsV+sV6V1Qwyt11TU99 Yhz29uup2wuTH86ScRBdututMnrJCUuZW29/SIc2LLry99Ph9cpZlSs+HTpyQO35dq5N6xlu 5RSeZkovmrDMYHPfhTvSK63mSJfNfG2a9bz3oVD0sX6W0KCpalP/b1HavfKz7sbGK8cZGv7O YOcJ/XNP+VincrKX+zbzhl/9LG7qX39ueislfdopU9Bx46Ro3cKJJ0ImZgud+Z+0LPTy3NNl h9YqsRRnJBpqMRcVJwIAetHsOwADAAA= X-CMS-MailID: 20200821071122epcas1p3d00dda4665f94192ac5e9ee829d0557d X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200821071122epcas1p3d00dda4665f94192ac5e9ee829d0557d References: <20200821071045.24501-1-hoegeun.kwon@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200821_031131_344496_34D880EC X-CRM114-Status: GOOD ( 20.86 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [203.254.224.25 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [203.254.224.25 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender 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@raspberrypi.com, kdasu.kdev@gmail.com, sboyd@kernel.org, mturquette@baylibre.com, dave.stevenson@raspberrypi.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, phil@raspberrypi.com, robh+dt@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hoegeun.kwon@samsung.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org There is a problem that the output does not work at a resolution exceeding FHD. To solve this, we need to adjust the bvb clock at a resolution exceeding FHD. Signed-off-by: Hoegeun Kwon --- drivers/gpu/drm/vc4/vc4_hdmi.c | 25 +++++++++++++++++++++++++ drivers/gpu/drm/vc4/vc4_hdmi.h | 1 + 2 files changed, 26 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 95ec5eedea39..eb3192d1fd86 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -80,6 +80,7 @@ # define VC4_HD_M_ENABLE BIT(0) #define CEC_CLOCK_FREQ 40000 +#define VC4_HSM_MID_CLOCK 149985000 static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) { @@ -380,6 +381,7 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder) HDMI_WRITE(HDMI_VID_CTL, HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_ENABLE); + clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock); clk_disable_unprepare(vc4_hdmi->hsm_clock); clk_disable_unprepare(vc4_hdmi->pixel_clock); @@ -638,6 +640,23 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder) return; } + ret = clk_set_rate(vc4_hdmi->pixel_bvb_clock, + (hsm_rate > VC4_HSM_MID_CLOCK ? 150000000 : 75000000)); + if (ret) { + DRM_ERROR("Failed to set pixel bvb clock rate: %d\n", ret); + clk_disable_unprepare(vc4_hdmi->hsm_clock); + clk_disable_unprepare(vc4_hdmi->pixel_clock); + return; + } + + ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); + if (ret) { + DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret); + clk_disable_unprepare(vc4_hdmi->hsm_clock); + clk_disable_unprepare(vc4_hdmi->pixel_clock); + return; + } + if (vc4_hdmi->variant->reset) vc4_hdmi->variant->reset(vc4_hdmi); @@ -1593,6 +1612,12 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) return PTR_ERR(vc4_hdmi->audio_clock); } + vc4_hdmi->pixel_bvb_clock = devm_clk_get(dev, "bvb"); + if (IS_ERR(vc4_hdmi->pixel_bvb_clock)) { + DRM_ERROR("Failed to get pixel bvb clock\n"); + return PTR_ERR(vc4_hdmi->pixel_bvb_clock); + } + vc4_hdmi->reset = devm_reset_control_get(dev, NULL); if (IS_ERR(vc4_hdmi->reset)) { DRM_ERROR("Failed to get HDMI reset line\n"); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index 0806c6d9f24e..63c6f8bddf1d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -147,6 +147,7 @@ struct vc4_hdmi { struct clk *pixel_clock; struct clk *hsm_clock; struct clk *audio_clock; + struct clk *pixel_bvb_clock; struct reset_control *reset;