mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
To: Heiko Stuebner <heiko@sntech.de>
Cc: Sandy Huang <hjc@rock-chips.com>,
	Andy Yan <andy.yan@rock-chips.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Guochun Huang <hero.huang@rock-chips.com>,
	Chaoyi Chen <kernel@airkyi.com>,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/rockchip: dsi: Add maximum per lane bit rate calculation
Date: Wed, 3 Jun 2026 09:28:44 +0800	[thread overview]
Message-ID: <91378132-8a8e-4bcc-9aa7-4de9fb135a6a@rock-chips.com> (raw)
In-Reply-To: <4888940.6M6d0yLqnL@phil>

Hi Heiko,

On 6/3/2026 4:59 AM, Heiko Stuebner wrote:
> Am Dienstag, 24. März 2026, 09:58:37 Mitteleuropäische Sommerzeit schrieb Chaoyi Chen:
>> From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
>>
>> Different chips have varying support for the maximum bit rate per lane.
>>
>> Add calculation for the maximum per lane bit rate for various chip
>> platforms, and relax the bandwidth margin requirements.
>>
>> Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
>> ---
>>  .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   | 21 +++++++++++++++----
>>  1 file changed, 17 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> index 3547d91b25d3..d3bacfae174e 100644
>> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> @@ -268,6 +268,7 @@ struct rockchip_dw_dsi_chip_data {
>>  
>>  	unsigned int flags;
>>  	unsigned int max_data_lanes;
>> +	unsigned long max_bit_rate_per_lane;
>>  };
>>  
>>  struct dw_mipi_dsi_rockchip {
>> @@ -565,7 +566,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
>>  	int bpp;
>>  	unsigned long mpclk, tmp;
>>  	unsigned int target_mbps = 1000;
>> -	unsigned int max_mbps = dppa_map[ARRAY_SIZE(dppa_map) - 1].max_mbps;
>> +	unsigned int max_mbps;
>>  	unsigned long best_freq = 0;
>>  	unsigned long fvco_min, fvco_max, fin, fout;
>>  	unsigned int min_prediv, max_prediv;
>> @@ -573,6 +574,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
>>  	unsigned long _fbdiv, best_fbdiv;
>>  	unsigned long min_delta = ULONG_MAX;
>>  
>> +	max_mbps = dsi->cdata->max_bit_rate_per_lane;
> 
> I may be blind, but how do the values come together?
> In the dppa_map table we have mbps values of 89 to 1500
> (MHz)
> 
> While below the values set are
> 	.max_bit_rate_per_lane = 1500000000UL,
> in Hz I guess
> 
> And I don't see the needed conversion somehow.
> 
>

Oh! It should be:

max_mbps = dsi->cdata->max_bit_rate_per_lane / USEC_PER_SEC;

Will fix in v2.

>>  	dsi->format = format;
>>  	bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
>>  	if (bpp < 0) {
>> @@ -584,8 +586,8 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
>>  
>>  	mpclk = DIV_ROUND_UP(mode->clock, MSEC_PER_SEC);
>>  	if (mpclk) {
>> -		/* take 1 / 0.8, since mbps must big than bandwidth of RGB */
>> -		tmp = mpclk * (bpp / lanes) * 10 / 8;
>> +		/* take 1 / 0.9, since mbps must big than bandwidth of RGB */
>> +		tmp = mpclk * (bpp / lanes) * 10 / 9;
> 
> Please do this in a separate patch, especially as I would expect some
> sort of explanation on why this is ok to do.
>

Sure! I'll split this out in the new series.

-- 
Best, 
Chaoyi

      reply	other threads:[~2026-06-03  1:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  8:58 Chaoyi Chen
2026-03-24  8:58 ` [PATCH 2/2] drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types Chaoyi Chen
2026-06-02 21:02   ` Heiko Stuebner
2026-06-03  1:34     ` Chaoyi Chen
2026-05-12  1:07 ` [PATCH 1/2] drm/rockchip: dsi: Add maximum per lane bit rate calculation Chaoyi Chen
2026-06-02 20:59 ` Heiko Stuebner
2026-06-03  1:28   ` Chaoyi Chen [this message]

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=91378132-8a8e-4bcc-9aa7-4de9fb135a6a@rock-chips.com \
    --to=chaoyi.chen@rock-chips.com \
    --cc=airlied@gmail.com \
    --cc=andy.yan@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hero.huang@rock-chips.com \
    --cc=hjc@rock-chips.com \
    --cc=kernel@airkyi.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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®