diff mbox series

drm/arm/malidp: fix mode_valid couldn't cull invalid modes issue

Message ID 20210810024331.14050-1-Sandor.yu@nxp.com (mailing list archive)
State New, archived
Headers show
Series drm/arm/malidp: fix mode_valid couldn't cull invalid modes issue | expand

Commit Message

Sandor Yu Aug. 10, 2021, 2:43 a.m. UTC
From: Sandor Yu <Sandor.yu@nxp.com>

In function malidp_crtc_mode_valid, mode->crtc_mode = 0 when run
in drm_helper_probe_single_connector_modes.
Invalid video modes are not culled
and all modes move to the connector's modes list.
It is not expected by mode_valid.

Replace mode->crtc_clock with mode->clock to fix the issue.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
---
 drivers/gpu/drm/arm/malidp_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

liviu.dudau@arm.com Aug. 13, 2021, 5:06 p.m. UTC | #1
On Tue, Aug 10, 2021 at 10:43:31AM +0800, Sandor.yu@nxp.com wrote:
> From: Sandor Yu <Sandor.yu@nxp.com>
> 
> In function malidp_crtc_mode_valid, mode->crtc_mode = 0 when run
> in drm_helper_probe_single_connector_modes.
> Invalid video modes are not culled
> and all modes move to the connector's modes list.
> It is not expected by mode_valid.
> 
> Replace mode->crtc_clock with mode->clock to fix the issue.
> 
> Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>

It looks like at least drm/bridge/cdns-dsi.c does the same thing of using
mode->clock when validating, so looks like a legit bug.

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Many thanks,
Liviu

> ---
>  drivers/gpu/drm/arm/malidp_crtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c
> index 494075ddbef6..55890334385d 100644
> --- a/drivers/gpu/drm/arm/malidp_crtc.c
> +++ b/drivers/gpu/drm/arm/malidp_crtc.c
> @@ -31,7 +31,7 @@ static enum drm_mode_status malidp_crtc_mode_valid(struct drm_crtc *crtc,
>  	 * check that the hardware can drive the required clock rate,
>  	 * but skip the check if the clock is meant to be disabled (req_rate = 0)
>  	 */
> -	long rate, req_rate = mode->crtc_clock * 1000;
> +	long rate, req_rate = mode->clock * 1000;
>  
>  	if (req_rate) {
>  		rate = clk_round_rate(hwdev->pxlclk, req_rate);
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c
index 494075ddbef6..55890334385d 100644
--- a/drivers/gpu/drm/arm/malidp_crtc.c
+++ b/drivers/gpu/drm/arm/malidp_crtc.c
@@ -31,7 +31,7 @@  static enum drm_mode_status malidp_crtc_mode_valid(struct drm_crtc *crtc,
 	 * check that the hardware can drive the required clock rate,
 	 * but skip the check if the clock is meant to be disabled (req_rate = 0)
 	 */
-	long rate, req_rate = mode->crtc_clock * 1000;
+	long rate, req_rate = mode->clock * 1000;
 
 	if (req_rate) {
 		rate = clk_round_rate(hwdev->pxlclk, req_rate);