From patchwork Tue Aug 10 02:43:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandor Yu X-Patchwork-Id: 12427711 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 582D7C4338F for ; Tue, 10 Aug 2021 02:39:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 0F42460FC4 for ; Tue, 10 Aug 2021 02:39:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0F42460FC4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37A5E89E03; Tue, 10 Aug 2021 02:39:54 +0000 (UTC) X-Greylist: delayed 443 seconds by postgrey-1.36 at gabe; Tue, 10 Aug 2021 02:39:53 UTC Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id C200589E03 for ; Tue, 10 Aug 2021 02:39:53 +0000 (UTC) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 320741A065C; Tue, 10 Aug 2021 04:32:28 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EF6D81A05B5; Tue, 10 Aug 2021 04:32:27 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 81DC4183AD28; Tue, 10 Aug 2021 10:32:26 +0800 (+08) From: Sandor.yu@nxp.com To: liviu.dudau@arm.com, brian.starkey@arm.com, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org Cc: Sandor.yu@nxp.com Subject: [PATCH] drm/arm/malidp: fix mode_valid couldn't cull invalid modes issue Date: Tue, 10 Aug 2021 10:43:31 +0800 Message-Id: <20210810024331.14050-1-Sandor.yu@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sandor Yu 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 Acked-by: Liviu Dudau --- 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);