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=-7.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 7AC1FC433E2 for ; Tue, 1 Sep 2020 02:09:35 +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 3AEB7208DB for ; Tue, 1 Sep 2020 02:09:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dBfKW6Y/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="eNjqB8RL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AEB7208DB 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+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:References:In-Reply-To:MIME-Version:Date:Message-ID: From:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NHvPa8QNTuM4ky+2Q3tV1p4NlqejXJuBsPS1VgvSfAM=; b=dBfKW6Y/Be7U6wuC0YXYW1X+1 GaOXE/MZpf1Xt06lkEtfYa5X1U9Rc+i/UR11t/5Q4SQTSn4S4S+punWemd8SMGcRWb44Yr5jy92mo XHDjBafa/wXzTv13yw9eENqK0G/bjYCVs89AkUXEshAB1ZTVflAvG7lWL8GsOzR9LOgq4IdCxMhaG bvlOzyJzLQ+hFxrqomPK+sIa/kRWyda3o7BEhPV5mHpzW/MZKSXwcudRUfm8lbYIn7ANwn+Q9G6+P isFSI4mlxnEa7QmJGyzFfqRA08N/1AO8qW4hKkoMC2Y56liuBGerUm8vsMXDvWLziceYcgBl6Rc5d linSgOrNg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCviI-0002mj-GG; Tue, 01 Sep 2020 02:07:58 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCviF-0002lm-3F for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2020 02:07:56 +0000 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200901020750epoutp04be91603fc85c1ddb227a7400fb723ab0~whso9sylo1461114611epoutp04V for ; Tue, 1 Sep 2020 02:07:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200901020750epoutp04be91603fc85c1ddb227a7400fb723ab0~whso9sylo1461114611epoutp04V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598926070; bh=URBVDctkmVqca9PXVLh3E1qepQ6UHAxy0LP6rzedCbQ=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=eNjqB8RLW9SsgNuX3Fj1Ai1tixx0K/O0l8jZD52wlo3FT1nmNlSdp5P5Z8YlMJSVj ZITvX9Ta1qRJIbODLsRto3ZhPAAi45AeXvRN6mmSbvWzK0vc2PrOvImwi3oHIXEr3l XSGu1Zoen1qNC34QG0mjPnm0I/JZXwtQ2rRCHTA0= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20200901020750epcas1p2d70205ed0566b254540c0bc25c9ac072~whsoQQHJp2039520395epcas1p2b; Tue, 1 Sep 2020 02:07:50 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.152]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4BgVpC1JpBzMqYm7; Tue, 1 Sep 2020 02:07:47 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id E3.04.28578.1FCAD4F5; Tue, 1 Sep 2020 11:07:46 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20200901020745epcas1p33a9988253efe06f536ece4c24c830137~whsj6j1wS2865628656epcas1p3F; Tue, 1 Sep 2020 02:07:45 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200901020745epsmtrp2d906f389fe4a7a416ff22089a5800a88~whsj5FVt21929619296epsmtrp2P; Tue, 1 Sep 2020 02:07:45 +0000 (GMT) X-AuditID: b6c32a39-8dfff70000006fa2-85-5f4dacf11fcf Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 43.03.08303.1FCAD4F5; Tue, 1 Sep 2020 11:07:45 +0900 (KST) Received: from [10.113.111.64] (unknown [10.113.111.64]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200901020745epsmtip1ab493178da14b7dbe6bd1200a8620199~whsjiI7Pv0918909189epsmtip1h; Tue, 1 Sep 2020 02:07:45 +0000 (GMT) Subject: Re: [PATCH 3/3] drm/vc4: hdmi: Add pixel bvb clock control To: Dave Stevenson , Maxime Ripard From: Hoegeun Kwon Message-ID: Date: Tue, 1 Sep 2020 11:07:26 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA02TfVBUVRjGO7t37y7kNpev9kQUcMsUJj4WWD04fDQD1i38oKgx+KP1xt6A WHZ39oJjZAQUybegELLAgGBCiyiBEiAbKwo7gWgFCEO6lLhOYrAIQ2M0YbtcnPjved/ze857 nnPmiPjOq7i7KEWVzmhVtJLEHbGuKz7+fktn98oDx4w81FYyiKH5uiYM1V+9LkDjK1YcGXPG ALI2F+KoZ7wNQx2zNwXoYbFZgMZ6a3FU/mu7EJ18tAbQz8O7UZeuGUfnph/gKM9wVYjWbn5n M7RM4ehO5Qx4zYXKtQ7hlHUqT0jpZkZx6tb1GzjVo7stpC5Oy6gOfQFOzRSZeFTn6c+pvMFV jCq9oAdU58in1HLHi7HihNSwZIZWMFovRpWoVqSoksLJmDh5lFy2I1DqJw1FO0kvFZ3GhJPR e2L9Xk9R2mKSXodoZYatFUuzLBkQEaZVZ6QzXslqNj2cZDQKpSZU48/SaWyGKsk/UZ22SxoY GCSzgQdTk09apvia2y8c7tdN4tngB0khcBBBIgS2990SFgJHkTPRDeDYwH3AFUsAHn3cJ+CK ZQC75ur5Tyz6qZENqhdA8xnzBjUPoMlSuk65EFGw8tFlgV27Eu/Da8aidQefmMRgVckCbl/A CT+4UjzJs2sxEQFXF//E7BojXoZ3ZoeBXbsR8bDHcl/IMU7wx+q764wD8TYsaGpY34dPeMLv 52v5nJbA6bv1PPswSNQ4wL8HxoTcuaPh+faJjQwucM50YaPvDpcXDDinWThePYdx5mwAj5XX bEDBsP+bE7ZdRb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fWYFIjNJqAr8bXnOhOIzStgJ/HrwxsWEJtFQEXi0eNTjCDLRAUiJXbusIQo EZQ4OfMJWAmnQKBE5+IFbCA2s4CZxLzND5khbHmJ7W/nQNniEreezGeawCg0C0n7LCQts5C0 zELSsoCRZRWjZGpBcW56brFhgVFearlecWJucWleul5yfu4mRnDUa2ntYNyz6oPeIUYmDsZD jBIczEoivAd2eccL8aYkVlalFuXHF5XmpBYfYpTmYFES5/06a2GckEB6YklqdmpqQWoRTJaJ g1OqgenAjguskjrnQqSU/Z0fOnw2yJW42O5ipfYpwpt52YO2+KaSDGm2qKlsWr/+ql4xjY1n 2e1aUPRGxeW30xQT7Y3hJ6X8z23R18r9e9hp8bxPojEVf5iL5EIWTt+6J7lmYpf28z8pgp8Y 4j2PiEex2t67wvFuWqnM+Yq9NxTV6wqfvr9dFPd6yu3lTq1X2xYeWKUkejsooZ6rUnNFpfD0 m+mX+8I6LWoPP9YVM9wrPe1if/3LNQsC85YaXtwX4cX0O6jnEEPHynjuCumWft/Uh9Ocfr1Z eWy5jVHEXSfl5jyPZMGNTa42rT7F8wzMA3Iyqqx/axw4XyJi1d1aeWLe1LRJ+hM+2WwM3Bm9 cIWaEktxRqKhFnNRcSIA/lK3z2kDAAA= X-CMS-MailID: 20200901020745epcas1p33a9988253efe06f536ece4c24c830137 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> <20200821071045.24501-4-hoegeun.kwon@samsung.com> <61c199bf-852f-82d3-089a-a0a435343acf@i2se.com> <80749dcd-d4b2-68a1-f3ca-c19a120f6f7b@samsung.com> <84c423e8-25a6-8f23-cc80-7a17ce03fd1d@i2se.com> <20200828152510.jhhqvka6fmouozff@gilmour.lan> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200831_220755_455176_945D072C X-CRM114-Status: GOOD ( 34.31 ) 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: Stefan Wahren , devicetree@vger.kernel.org, Hoegeun Kwon , Tim Gover , kdasu.kdev@gmail.com, sboyd@kernel.org, mturquette@baylibre.com, LKML , DRI Development , linux-clk@vger.kernel.org, Eric Anholt , robh+dt@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , Nicolas Saenz Julienne , 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 Thank you reviews by Dave, Maxime and Stefan. On 8/29/20 12:37 AM, Dave Stevenson wrote: > Hi Maxime, Stefan, and Hoegeun > > On Fri, 28 Aug 2020 at 16:25, Maxime Ripard wrote: >> Hi, >> >> On Fri, Aug 28, 2020 at 02:45:49PM +0200, Stefan Wahren wrote: >>> Am 28.08.20 um 08:30 schrieb Hoegeun Kwon: >>>> On 8/27/20 6:49 PM, Stefan Wahren wrote: >>>>> Am 27.08.20 um 06:35 schrieb Hoegeun Kwon: >>>>>> Hi Stefan, >>>>>> >>>>>> Thank you for your review. >>>>>> >>>>>> >>>>>> On 8/26/20 7:04 PM, Stefan Wahren wrote: >>>>>>> Hi Hoeguen, >>>>>>> >>>>>>> Am 21.08.20 um 09:10 schrieb Hoegeun Kwon: >>>>>>>> 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. >>>>>>> this patch introduces a mandatory clock, please update >>>>>>> brcm,bcm2835-hdmi.yaml first. >>>>>>> >>>>>>> Is this clock physically available on BCM283x or only on BCM2711? >>>>>> As far as I know, BCM2711 raspberry pi 4 supports 4k, >>>>>> >>>>>> don't supported on pi 3 and pi 3+. >>>>>> >>>>>> Since 4k is not supported in versions prior to Raspberry Pi 4, >>>>>> >>>>>> I don't think we need to modify the bvb clock. >>>>>> >>>>>> >>>>>> So I think it is better to update 'brcm,bcm2711-hdmi.yaml' >>>>>> >>>>>> instead of 'brcm,bcm2835-hdmi.yaml'. >>>>> You are correct please update only brcm,bcm2711-hdmi.yaml. >>>>> >>>>> My concern was that the function vc4_hdmi_encoder_pre_crtc_configure() >>>>> is called on a non-bcm2711 platform or on a Raspberry Pi 4 with an older >>>>> DTB. So making the BVB clock optional might be better? >>>> You are right, if use old dtb, we have a problem with the hdmi driver. >>>> >>>> So how about modifying it like this? >>>> >>>> @@ -1614,8 +1614,8 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi >>>> *vc4_hdmi) >>>> >>>> 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); >>>> + DRM_WARN("Failed to get pixel bvb clock\n"); >>>> + vc4_hdmi->pixel_bvb_clock = NULL; >>>> } >>> i think the better solution would be devm_clk_get_optional(), which >>> return NULL in case the clock doesn't exist. >> It's not really optional though. BCM2711 will require it in order to run >> properly (as Hoegeun experienced), and the previous SoCs won't. >> >> If we use clk_get_optional and that the DT is missing the clock on the >> BCM2711, we will silently ignore it which doesn't sound great. > Am I missing something here? (I know I missed this earlier) > We're in vc5_hdmi_init_resources, which is inherently bcm2711 only. > bcm283x will go through vc4_hdmi_init_resources. > > As long as vc4_hdmi_init_resources has left vc4_hdmi->pixel_bvb_clock > at NULL, then the clock framework will be happy to do a nop. > > For BCM2711 an old DT would have issues, but, as Maxime has stated, no > binding or upstream DTB has been merged yet, so it can be made > mandatory. If so, it seems good to set bvb_clock to mandatory without taking into account the BCM2711 an old DTB as it hasn't been merged yet. I will send version 2 patches. > Making it optional drops you back on whatever the firmware might have > set it to, which may be sufficient for some resolutions but not > others. As a result of checking by adding bvb_clock when I operated it with the firmware, it was confirmed that the firmware increased the bvb_clock from 75000000 to 150000000 when the FHD was exceeded. Best regards Hoegeun > > Dave > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel