mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hoegeun Kwon <hoegeun.kwon@samsung.com>
To: Chanwoo Choi <cw00.choi@samsung.com>,
	nsaenzjulienne@suse.de, eric@anholt.net, maxime@cerno.tech,
	stefan.wahren@i2se.com, dave.stevenson@raspberrypi.com
Cc: devicetree@vger.kernel.org, tim.gover@raspberrypi.com,
	sboyd@kernel.org, mturquette@baylibre.com, kdasu.kdev@gmail.com,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-clk@vger.kernel.org, robh+dt@kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-rpi-kernel@lists.infradead.org, phil@raspberrypi.com,
	linux-arm-kernel@lists.infradead.org,
	Hoegeun Kwon <hoegeun.kwon@samsung.com>
Subject: Re: [PATCH v2 2/4] drm/vc4: hdmi: Add pixel bvb clock control
Date: Wed, 2 Sep 2020 12:13:44 +0900	[thread overview]
Message-ID: <da50b700-2566-2b5e-766f-77621405c8e3@samsung.com> (raw)
In-Reply-To: <46e051f7-ba72-5960-da95-a2e9c44d2d85@samsung.com>

Hi Chanwoo,

On 9/1/20 1:27 PM, Chanwoo Choi wrote:
> Hi Hoegeun,
>
> It looks good to me. But, just one comment.
>
> On 9/1/20 1:07 PM, Hoegeun Kwon wrote:
>> 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 <hoegeun.kwon@samsung.com>
>> ---
>>   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;
>> +	}
> Generally, enable the clock before using clk and then change the clock rate.
> I think that you better to change the order between clk_prepare_enable and clk_set_rate.

Thank you for your comment.


As Maxime answered in another patch [1], there is no clear rule of order 
here.

[1] https://lkml.org/lkml/2020/9/1/327


Best regards,

Hoegeun



  reply	other threads:[~2020-09-02  3:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200901040850epcas1p2150ea195dfb20b46d6421af63b1f5129@epcas1p2.samsung.com>
2020-09-01  4:07 ` [PATCH v2 0/4] drm/vc4: Support HDMI QHD or higher output Hoegeun Kwon
     [not found]   ` <CGME20200901040851epcas1p28f443c0e819bea756ebf9296491b32da@epcas1p2.samsung.com>
2020-09-01  4:07     ` [PATCH v2 1/4] clk: bcm: rpi: Add register to control pixel bvb clk Hoegeun Kwon
2020-09-02 19:04       ` Maxime Ripard
2020-09-08 16:09       ` Nicolas Saenz Julienne
2020-09-22 19:29       ` Stephen Boyd
     [not found]   ` <CGME20200901040851epcas1p3124094e38175758b2310bdae6d76793c@epcas1p3.samsung.com>
2020-09-01  4:07     ` [PATCH v2 2/4] drm/vc4: hdmi: Add pixel bvb clock control Hoegeun Kwon
2020-09-01  4:27       ` Chanwoo Choi
2020-09-02  3:13         ` Hoegeun Kwon [this message]
     [not found]   ` <CGME20200901040851epcas1p1456e8561c7a332811ec7ddc941ded2bd@epcas1p1.samsung.com>
2020-09-01  4:07     ` [PATCH v2 3/4] dt-bindings: display: vc4: hdmi: Add bvb clock-names property Hoegeun Kwon
     [not found]   ` <CGME20200901040851epcas1p18d6757ed06d19c7fd68cbcd439672183@epcas1p1.samsung.com>
2020-09-01  4:07     ` [PATCH v2 4/4] ARM: dts: bcm2711: Add bvb clock for hdmi-pixel Hoegeun Kwon
2020-09-08 16:11   ` [PATCH v2 0/4] drm/vc4: Support HDMI QHD or higher output Nicolas Saenz Julienne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=da50b700-2566-2b5e-766f-77621405c8e3@samsung.com \
    --to=hoegeun.kwon@samsung.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=cw00.choi@samsung.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=kdasu.kdev@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=maxime@cerno.tech \
    --cc=mturquette@baylibre.com \
    --cc=nsaenzjulienne@suse.de \
    --cc=phil@raspberrypi.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=stefan.wahren@i2se.com \
    --cc=tim.gover@raspberrypi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®