Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1353839lqd; Thu, 25 Apr 2024 12:55:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXB3onTcF2Qxuj82X753AUgZKv/4JwWc8mdrd1XirlhqGM2t6PBGMNJOoD00TpIwE3ND3bSDHTkTIzGbFl03MshVEx/9QnsxCY9C+52ww== X-Google-Smtp-Source: AGHT+IEkNy+fIJAFoojFkQKXQlEbtuM6GnYobG3gROYMRYzNK2aX44wJ+IcV1GwutGzs0o7MFU9S X-Received: by 2002:a50:aade:0:b0:56e:309f:4cb3 with SMTP id r30-20020a50aade000000b0056e309f4cb3mr343046edc.16.1714074944332; Thu, 25 Apr 2024 12:55:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714074944; cv=pass; d=google.com; s=arc-20160816; b=FDcG/lvcTGZrMx+kvSW0k1JSBcAk/vFY8EXUjF0CfrAXsCz/6UrpPnU2T22l/B2Ypk aA2KVgNmh8dyRyKkgnuhQlkK7Ud5hFprE1GhZ3CXsqKUZYn8++9wTbeLY700cMVXs6oh zKNm4d++5fI96aPSn82hYT59CfEGrVHF7qL8CCQUNhqwyHtLgYr1+1HWds+h6Jzhm3t5 ycH0Xe55rtfZRvpdNrvzNutjZOHTgD4hHaFtcUha5Mvsp8bbXCqJYTz/NVDRgKGtxe6O yZBWNWy6cQJBP+xJdbrO3VX/rtHotAFL3Qcz/MDLLxqH7RBe6tpHbh61DqJjBXhwNFv2 J07g== ARC-Message-Signature: i=2; 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; bh=e9wmlwBQ5+M02ggmv6L3g2EtAyXAUNBvcNIMMpNMSqc=; fh=+WukiN6GELlt+87eIIl8IwlThh8dlq6InR/dmQR7atk=; b=BUWFso0/xGo+ZCBHJMxN7snPtLPIDKm9cle0Mg8FaAnGHW4B8JOT9SVGWpViZim5Bl 1sYgoJ3N0UyQv3YMmlLtywOIWhHrGfGWuL43yg+EWEgfU2+zBXjnmNi4rMwfozHI4xUP sioGWMax8JrXxXqU3c5xXmhuYlrrwiGOalRjUQE1rSdFcUDGi2qU7uF7BHRfsvyM8bYX MeCiDHKD+eRD7yw33KFct5Ce0unws6w+RuwsTl5uUIh69+d9xL4JQkuxeRZKnoSAWbJq wxfQNyhTezwsOGux9dlJ/um3yOgkwGOjeANchtFEIfRAD9HpB0TG7C4AqmZL1zj4KdWf Nsrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-159091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s4-20020a50ab04000000b00571fe9eccc1si6704824edc.48.2024.04.25.12.55.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 12:55:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-159091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 145511F21E24 for ; Thu, 25 Apr 2024 19:55:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BDCE153512; Thu, 25 Apr 2024 19:55:22 +0000 (UTC) Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (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 4A715152166 for ; Thu, 25 Apr 2024 19:55:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714074921; cv=none; b=Ahj0eR0Is0cEsHTLhveW89aYSM0RIgF7C6j5x8wpqfv1X98qk43z4NjbzAY0p+n+m/5K5NmzSdkhIRpWEiHoJXLQ7krwbk1K2YsTFMrpkcH/spsbcGuwapJPGi/W1kzkEC4rVPo71RvtYizEOfJNo3QaqaqQqDp5m/H2QdySMl8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714074921; c=relaxed/simple; bh=Es8VWY69NJQ1IsR6Nu4K39ugmgFtBLIAeTWGEQ4G3J4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ww3KOdS9CyEA1FetpbjcWHsasoddLYAud7Xg56liiTqODp5Xj1dFxBdkoM6k2sTsH5OYqZPh8U3/ubhhMRTDfkMz+iS58OKrageVh+px0C/geXALUIT5Qda1RFOJt9rEjeEqWVAzquk3GTV9g7LN+m6SX+brlfH8MhIohx4JPUE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Received: from i53875b01.versanet.de ([83.135.91.1] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s05BX-0005vK-Kl; Thu, 25 Apr 2024 21:55:11 +0200 From: Heiko Stuebner To: heiko@sntech.de Cc: quentin.schulz@theobroma-systems.com, hjc@rock-chips.com, andy.yan@rock-chips.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Heiko Stuebner Subject: [PATCH 1/2] drm/rockchip: vop2: fix rk3588 dp+dsi maxclk verification Date: Thu, 25 Apr 2024 21:55:05 +0200 Message-Id: <20240425195506.2935955-2-heiko@sntech.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240425195506.2935955-1-heiko@sntech.de> References: <20240425195506.2935955-1-heiko@sntech.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Heiko Stuebner The clock is in Hz while the value checked against is in kHz, so actual frequencies will never be able to be below to max value. Fix this by specifying the max-value in Hz too. Fixes: 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") Signed-off-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 9bee1fd88e6a2..523880a4e8e74 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -1719,7 +1719,7 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, else dclk_out_rate = v_pixclk >> 2; - dclk_rate = rk3588_calc_dclk(dclk_out_rate, 600000); + dclk_rate = rk3588_calc_dclk(dclk_out_rate, 600000000); if (!dclk_rate) { drm_err(vop2->drm, "DP dclk_out_rate out of range, dclk_out_rate: %ld KHZ\n", dclk_out_rate); @@ -1736,7 +1736,7 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, * dclk_rate = N * dclk_core_rate N = (1,2,4 ), * we get a little factor here */ - dclk_rate = rk3588_calc_dclk(dclk_out_rate, 600000); + dclk_rate = rk3588_calc_dclk(dclk_out_rate, 600000000); if (!dclk_rate) { drm_err(vop2->drm, "MIPI dclk out of range, dclk_out_rate: %ld KHZ\n", dclk_out_rate); -- 2.39.2