Message ID | 20240104143951.85219-2-cristian.ciocaltea@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-16796-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5650288dyb; Thu, 4 Jan 2024 06:40:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTThozWUPD0zgDaEcK/MfK8y9pkFjD7qfXcBE2/d3HQwOi2JiPVHS0VHocTFQyan4TbECK X-Received: by 2002:ac8:5cc8:0:b0:429:735d:5331 with SMTP id s8-20020ac85cc8000000b00429735d5331mr370187qta.14.1704379228126; Thu, 04 Jan 2024 06:40:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704379228; cv=none; d=google.com; s=arc-20160816; b=kucMu6e/KxFIiDBzcOjtMqy89R0u3dn3tXVegVb/U5zWS7tJDewOKQO45o4u+WzgEW HjQC4RTy4ZVe7/g4+KupVolIe00MZzmwdMpWD51CdREWg7zcEl8GOkpHCjPXz7Z6e+Nd 2idEJeJR2Wb3xagiTIjSPvgGaf1owrxExihjE1OUngmRHilsIwZotWNyQe0cQ0XI9wo0 vL/mB1kSXH+LLpd//rBnolq5ea5I1eblAlMHNj7U0vN3DXYfCcz15eKrqVTdAKGqN0h5 Guaozr9ybgQzCL9Qvv+KUb2KmqOQat02ssm2VoG+R7S9+TmPTbqMBjTEbaRTjlbrX9z1 Q97Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rp11I5nd6GfMqHBEtnjqNbzO5QjgcQzJ/hrfVIoazlI=; fh=VHhIG2KUdtq/t9XgI3hDRIe5Cm/wdwReNzkkuxY96z8=; b=FJOn27H2mgX6ZBGmoKhgTKFvyyKBhCf/01Tsz9zeUam0xTW/dt1PqyyGtqGphya++f 3czacIzOIZ5jhhsV1uEoiZsPGG+/vyVxrpW3U6Y3CebRau9u3+ZUOJb38S7oqNcO9ggP emTxPOQiCciLeE3y2YTERuLStkG1vnkEWEsE4d+XARteb/RR5AZdfh8UlOeo3RjqqIuv 322tSrfxwVxlftZutLCJkjpSEsUUJWRLXdARi+YnXwaEaafRi6m+nlUXjayO3zeQBRrv NPHbXlXT4lzFhCy85608id0LvmG8YaaXiUflVLhkJanui0HuVQrDFRSzk6Yo8mHhpsJy iVdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=OwgrRQ0r; spf=pass (google.com: domain of linux-kernel+bounces-16796-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16796-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p19-20020a05622a00d300b004283d2aa003si2519137qtw.467.2024.01.04.06.40.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 06:40:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16796-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=OwgrRQ0r; spf=pass (google.com: domain of linux-kernel+bounces-16796-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16796-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E53751C2200A for <ouuuleilei@gmail.com>; Thu, 4 Jan 2024 14:40:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E8872377F; Thu, 4 Jan 2024 14:40:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="OwgrRQ0r" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2BB623741 for <linux-kernel@vger.kernel.org>; Thu, 4 Jan 2024 14:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704379195; bh=LwJiWNixgLxt6lWwrlS02C+4POupia0P98Da0BOUfU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OwgrRQ0rIDcc/jUhiQv/PCwYmkZNCxYNoy5da/8UTYUGsfAetij6ESu41hWpT1oDb LmiUYP4ljJJkyONMuLwqiM7bFOYZHW7/MXHqZh6r9jlgh4FQv9/8F376VIVCrxM5gE QE8n9xStFBpK1KS2EOfXqRBR7Eut5dmc37QM5stdlhqHX7hPMN/XrgUbA648f9MP8x DiOZEXiQge4FSZMPm+vfoWNSKRDWvL9JHkjW5ZXqmZqV0sctX9e2uiuSRffCH/gFeu Ipaqr2E/Ezy5HiF3wko5tNF2J6dhQkFwSEbbOR3GgGue6Jnfr8DOibb3r6WrvoxMmz 6GY0PHjmz1Z0Q== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B9BB4378201D; Thu, 4 Jan 2024 14:39:54 +0000 (UTC) From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> To: Sandy Huang <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 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>, Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH] drm/rockchip: vop2: Drop unused if_dclk_rate variable Date: Thu, 4 Jan 2024 16:39:50 +0200 Message-ID: <20240104143951.85219-2-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240104143951.85219-1-cristian.ciocaltea@collabora.com> References: <20240104143951.85219-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787171153467265494 X-GMAIL-MSGID: 1787171153467265494 |
Series |
drm/rockchip: vop2: Drop unused if_dclk_rate variable
|
|
Commit Message
Cristian Ciocaltea
Jan. 4, 2024, 2:39 p.m. UTC
Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588")
introduced a variable which ended up being unused. Remove it.
rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 --
1 file changed, 2 deletions(-)
Comments
Hi Christian, Andy, Am Donnerstag, 4. Januar 2024, 15:39:50 CET schrieb Cristian Ciocaltea: > Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") > introduced a variable which ended up being unused. Remove it. > > rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set but not used [-Wunused-but-set-variable] > > Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> in general, please don't send non-series patches as replies to other patches. It confuses tooling like b4 way too often, as this patch is not designated as a 2/2 (similar to the first one not being 1/2). > --- > drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > index 44508c2dd614..923985d4161b 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > @@ -1685,7 +1685,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, > unsigned long dclk_core_rate = v_pixclk >> 2; > unsigned long dclk_rate = v_pixclk; > unsigned long dclk_out_rate; > - unsigned long if_dclk_rate; > unsigned long if_pixclk_rate; > int K = 1; > > @@ -1700,7 +1699,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, > } > > if_pixclk_rate = (dclk_core_rate << 1) / K; > - if_dclk_rate = dclk_core_rate / K; > /* > * *if_pixclk_div = dclk_rate / if_pixclk_rate; > * *if_dclk_div = dclk_rate / if_dclk_rate; > */ *if_pixclk_div = 2; *if_dclk_div = 4; with the code continuing with those static constants but the comment showing a forumula, I do hope Andy can provide a bit of insight into what is happening here. I.e. I'd really like to understand if that really is just a remnant or something different is needed. Heiko
Hi Heiko, On 1/4/24 17:58, Heiko Stübner wrote: > Hi Christian, Andy, > > Am Donnerstag, 4. Januar 2024, 15:39:50 CET schrieb Cristian Ciocaltea: >> Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") >> introduced a variable which ended up being unused. Remove it. >> >> rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set but not used [-Wunused-but-set-variable] >> >> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> > > in general, please don't send non-series patches as replies to other patches. > It confuses tooling like b4 way too often, as this patch is not designated > as a 2/2 (similar to the first one not being 1/2). That was unintentional, sorry! I wrongly assumed 'git send-email' is able to correctly handle multiple patches which are not part of a series. I'm not sure if the '--no-thread' flag would have helped. >> --- >> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >> index 44508c2dd614..923985d4161b 100644 >> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >> @@ -1685,7 +1685,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, >> unsigned long dclk_core_rate = v_pixclk >> 2; >> unsigned long dclk_rate = v_pixclk; >> unsigned long dclk_out_rate; >> - unsigned long if_dclk_rate; >> unsigned long if_pixclk_rate; >> int K = 1; >> >> @@ -1700,7 +1699,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, >> } >> >> if_pixclk_rate = (dclk_core_rate << 1) / K; >> - if_dclk_rate = dclk_core_rate / K; >> /* >> * *if_pixclk_div = dclk_rate / if_pixclk_rate; >> * *if_dclk_div = dclk_rate / if_dclk_rate; >> */ > *if_pixclk_div = 2; > *if_dclk_div = 4; > > with the code continuing with those static constants but the comment > showing a forumula, I do hope Andy can provide a bit of insight into > what is happening here. > > I.e. I'd really like to understand if that really is just a remnant or > something different is needed. The current implementation is not able to handle all display modes supported by connected displays, e.g. in my testing environment I encountered issues with 2560x1440-75.00Hz, 2048x1152-60.00Hz, 1024x768-60.00Hz. Additionally, it doesn't seem to cope well with non-integer refresh rates like 59.94, 29.97, 23.98, etc. My temporary workaround relies on using the HDMI PHY PLL in conjunction with a downstream-based hack to compute the clock rates. I'm not sure that would be an upstreamable solution, so I would let Andy shed some light on the topic. Thanks, Cristian > > Heiko > >
Hi: On 1/4/24 23:58, Heiko Stübner wrote: > Hi Christian, Andy, > > Am Donnerstag, 4. Januar 2024, 15:39:50 CET schrieb Cristian Ciocaltea: >> Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") >> introduced a variable which ended up being unused. Remove it. >> >> rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set but not used [-Wunused-but-set-variable] >> >> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> > > in general, please don't send non-series patches as replies to other patches. > It confuses tooling like b4 way too often, as this patch is not designated > as a 2/2 (similar to the first one not being 1/2). > >> --- >> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >> index 44508c2dd614..923985d4161b 100644 >> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >> @@ -1685,7 +1685,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, >> unsigned long dclk_core_rate = v_pixclk >> 2; >> unsigned long dclk_rate = v_pixclk; >> unsigned long dclk_out_rate; >> - unsigned long if_dclk_rate; >> unsigned long if_pixclk_rate; >> int K = 1; >> >> @@ -1700,7 +1699,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, >> } >> >> if_pixclk_rate = (dclk_core_rate << 1) / K; >> - if_dclk_rate = dclk_core_rate / K; >> /* >> * *if_pixclk_div = dclk_rate / if_pixclk_rate; >> * *if_dclk_div = dclk_rate / if_dclk_rate; >> */ > *if_pixclk_div = 2; > *if_dclk_div = 4; > > with the code continuing with those static constants but the comment > showing a forumula, I do hope Andy can provide a bit of insight into > what is happening here. > > I.e. I'd really like to understand if that really is just a remnant or > something different is needed. This is not a remnant, in my V1, I calculate all the div by formula, but Sascha prefer more for a constants value[0], so I keep this formula as comments to indicate how these value come from. [0]https://patchwork.kernel.org/project/linux-rockchip/patch/20231114112855.1771372-1-andyshrk@163.com/ > > > Heiko > >
Hi Cristian: On 1/5/24 03:12, Cristian Ciocaltea wrote: > Hi Heiko, > > On 1/4/24 17:58, Heiko Stübner wrote: >> Hi Christian, Andy, >> >> Am Donnerstag, 4. Januar 2024, 15:39:50 CET schrieb Cristian Ciocaltea: >>> Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") >>> introduced a variable which ended up being unused. Remove it. >>> >>> rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set but not used [-Wunused-but-set-variable] >>> >>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> >> >> in general, please don't send non-series patches as replies to other patches. >> It confuses tooling like b4 way too often, as this patch is not designated >> as a 2/2 (similar to the first one not being 1/2). > > That was unintentional, sorry! I wrongly assumed 'git send-email' is > able to correctly handle multiple patches which are not part of a > series. I'm not sure if the '--no-thread' flag would have helped. > >>> --- >>> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 -- >>> 1 file changed, 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >>> index 44508c2dd614..923985d4161b 100644 >>> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >>> @@ -1685,7 +1685,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, >>> unsigned long dclk_core_rate = v_pixclk >> 2; >>> unsigned long dclk_rate = v_pixclk; >>> unsigned long dclk_out_rate; >>> - unsigned long if_dclk_rate; >>> unsigned long if_pixclk_rate; >>> int K = 1; >>> >>> @@ -1700,7 +1699,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, >>> } >>> >>> if_pixclk_rate = (dclk_core_rate << 1) / K; >>> - if_dclk_rate = dclk_core_rate / K; >>> /* >>> * *if_pixclk_div = dclk_rate / if_pixclk_rate; >>> * *if_dclk_div = dclk_rate / if_dclk_rate; >>> */ >> *if_pixclk_div = 2; >> *if_dclk_div = 4; >> >> with the code continuing with those static constants but the comment >> showing a forumula, I do hope Andy can provide a bit of insight into >> what is happening here. >> >> I.e. I'd really like to understand if that really is just a remnant or >> something different is needed. > > The current implementation is not able to handle all display modes > supported by connected displays, e.g. in my testing environment I > encountered issues with 2560x1440-75.00Hz, 2048x1152-60.00Hz, > 1024x768-60.00Hz. Additionally, it doesn't seem to cope well with > non-integer refresh rates like 59.94, 29.97, 23.98, etc. I think this is because the thee PLL from cru can't divide accurate clock for these non-integer refresh rates. > > My temporary workaround relies on using the HDMI PHY PLL in conjunction > with a downstream-based hack to compute the clock rates. I'm not sure > that would be an upstreamable solution, so I would let Andy shed some > light on the topic. Yes, use PLL from HDMI PHY can give more flexible clock rates to support more display mode. We also use it in our bsp kernel, but one thing should keep in mind that use HDMI PHY pll as dclk source can only work for HDMI 2.0 or bellow, if can't be used in hdmi 2.1 mode(such as 4K120), so we need to switch the clock source by hdmi work mode. The difficult thing is how to make this accepted by upstream. > > Thanks, > Cristian > >> >> Heiko >> >> > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip
Hi, Am Freitag, 5. Januar 2024, 10:04:55 CET schrieb Andy Yan: > On 1/4/24 23:58, Heiko Stübner wrote: > > Am Donnerstag, 4. Januar 2024, 15:39:50 CET schrieb Cristian Ciocaltea: > >> Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") > >> introduced a variable which ended up being unused. Remove it. > >> > >> rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set but not used [-Wunused-but-set-variable] > >> > >> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> > > > > in general, please don't send non-series patches as replies to other patches. > > It confuses tooling like b4 way too often, as this patch is not designated > > as a 2/2 (similar to the first one not being 1/2). > > > >> --- > >> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 -- > >> 1 file changed, 2 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > >> index 44508c2dd614..923985d4161b 100644 > >> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > >> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > >> @@ -1685,7 +1685,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, > >> unsigned long dclk_core_rate = v_pixclk >> 2; > >> unsigned long dclk_rate = v_pixclk; > >> unsigned long dclk_out_rate; > >> - unsigned long if_dclk_rate; > >> unsigned long if_pixclk_rate; > >> int K = 1; > >> > >> @@ -1700,7 +1699,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, > >> } > >> > >> if_pixclk_rate = (dclk_core_rate << 1) / K; > >> - if_dclk_rate = dclk_core_rate / K; > >> /* > >> * *if_pixclk_div = dclk_rate / if_pixclk_rate; > >> * *if_dclk_div = dclk_rate / if_dclk_rate; > >> */ > > *if_pixclk_div = 2; > > *if_dclk_div = 4; > > > > with the code continuing with those static constants but the comment > > showing a forumula, I do hope Andy can provide a bit of insight into > > what is happening here. > > > > I.e. I'd really like to understand if that really is just a remnant or > > something different is needed. > > This is not a remnant, in my V1, I calculate all the div by formula, but Sascha prefer > more for a constants value[0], so I keep this formula as comments to indicate how these value come from. > > [0]https://patchwork.kernel.org/project/linux-rockchip/patch/20231114112855.1771372-1-andyshrk@163.com/ thanks for referencing the source of the change. Leaving the formula in there was the right choice I think That still leaves the issue with the "unused" warning. @Christan: in the hdmi block itself can you move the if_dclk_rate = dclk_core_rate / K; to the comment block please? And possibly reference the use of the static values in the comment message. The if_dclk_rate var declaration at the top of the function can of course go away. That way we still keep documenting how these values came to be: /* * if_dclk_rate = dclk_core_rate / K; * *if_pixclk_div = dclk_rate / if_pixclk_rate; * *if_dclk_div = dclk_rate / if_dclk_rate; */ Thanks Heiko
On 1/5/24 11:57, Heiko Stübner wrote: > Hi, > > Am Freitag, 5. Januar 2024, 10:04:55 CET schrieb Andy Yan: >> On 1/4/24 23:58, Heiko Stübner wrote: >>> Am Donnerstag, 4. Januar 2024, 15:39:50 CET schrieb Cristian Ciocaltea: >>>> Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") >>>> introduced a variable which ended up being unused. Remove it. >>>> >>>> rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set but not used [-Wunused-but-set-variable] >>>> >>>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> [...] >>> with the code continuing with those static constants but the comment >>> showing a forumula, I do hope Andy can provide a bit of insight into >>> what is happening here. >>> >>> I.e. I'd really like to understand if that really is just a remnant or >>> something different is needed. >> >> This is not a remnant, in my V1, I calculate all the div by formula, but Sascha prefer >> more for a constants value[0], so I keep this formula as comments to indicate how these value come from. >> >> [0]https://patchwork.kernel.org/project/linux-rockchip/patch/20231114112855.1771372-1-andyshrk@163.com/ > > thanks for referencing the source of the change. > Leaving the formula in there was the right choice I think > > That still leaves the issue with the "unused" warning. > > @Christan: in the hdmi block itself can you move the > if_dclk_rate = dclk_core_rate / K; > to the comment block please? And possibly reference the use > of the static values in the comment message. > > The if_dclk_rate var declaration at the top of the function can of course > go away. > > That way we still keep documenting how these values came to be: Requested changes submitted via v2: https://lore.kernel.org/lkml/20240105174007.98054-1-cristian.ciocaltea@collabora.com/ Thanks, Cristian
Hi Andy, On 1/5/24 11:13, Andy Yan wrote: > Hi Cristian: > > On 1/5/24 03:12, Cristian Ciocaltea wrote: >> Hi Heiko, >> >> On 1/4/24 17:58, Heiko Stübner wrote: >>> Hi Christian, Andy, >>> >>> Am Donnerstag, 4. Januar 2024, 15:39:50 CET schrieb Cristian Ciocaltea: >>>> Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") >>>> introduced a variable which ended up being unused. Remove it. >>>> >>>> rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set >>>> but not used [-Wunused-but-set-variable] >>>> >>>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> [...] >> The current implementation is not able to handle all display modes >> supported by connected displays, e.g. in my testing environment I >> encountered issues with 2560x1440-75.00Hz, 2048x1152-60.00Hz, >> 1024x768-60.00Hz. Additionally, it doesn't seem to cope well with >> non-integer refresh rates like 59.94, 29.97, 23.98, etc. > > I think this is because the thee PLL from cru can't divide accurate > clock for these > non-integer refresh rates. >> >> My temporary workaround relies on using the HDMI PHY PLL in conjunction >> with a downstream-based hack to compute the clock rates. I'm not sure >> that would be an upstreamable solution, so I would let Andy shed some >> light on the topic. > > Yes, use PLL from HDMI PHY can give more flexible clock rates to support > more display mode. > We also use it in our bsp kernel, but one thing should keep in mind > that use HDMI PHY pll > as dclk source can only work for HDMI 2.0 or bellow, if can't be used in > hdmi 2.1 mode(such as 4K120), > so we need to switch the clock source by hdmi work mode. > > The difficult thing is how to make this accepted by upstream. Thanks for the heads-up! I will try to have a look as soon as I finalize the work on HDMI phy & bridge drivers (unfortunately I had to put it temporarily on hold to focus on different tasks, but I expect to resume soon). Regards, Cristian
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 44508c2dd614..923985d4161b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -1685,7 +1685,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, unsigned long dclk_core_rate = v_pixclk >> 2; unsigned long dclk_rate = v_pixclk; unsigned long dclk_out_rate; - unsigned long if_dclk_rate; unsigned long if_pixclk_rate; int K = 1; @@ -1700,7 +1699,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, } if_pixclk_rate = (dclk_core_rate << 1) / K; - if_dclk_rate = dclk_core_rate / K; /* * *if_pixclk_div = dclk_rate / if_pixclk_rate; * *if_dclk_div = dclk_rate / if_dclk_rate;