From patchwork Sat Oct 31 12:55:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 7531021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CFBB1BEEA4 for ; Sat, 31 Oct 2015 13:01:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFF1B206C7 for ; Sat, 31 Oct 2015 13:01:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11325206AF for ; Sat, 31 Oct 2015 13:01:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZsVlD-0006G4-7Y; Sat, 31 Oct 2015 12:59:55 +0000 Received: from mail-qk0-f177.google.com ([209.85.220.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZsVif-00046i-P9; Sat, 31 Oct 2015 12:57:19 +0000 Received: by qkbl190 with SMTP id l190so41419362qkb.2; Sat, 31 Oct 2015 05:56:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DdlnV5nF1aOvc5OkZvXF5QgmWvTqG7T6xQkBywA7fxk=; b=C+r2fDtmW8s+IcxAIlOSERVDwYfvAMMBVpgZBdzJK6xsFbH9vcTcpRg4eM0OA0RxLh SW/s2BrmSuS+LCdAF8w98TeY8e2FtG+oeHadcQIAkUi0JURHbx3VQeMcpjzVVFlvv3C+ ujWW6nxGOp4IEEQ3HD9GX9gkG6aVcAtbPOt1qsqRJHgJVONkvXAglwwq2R6dilK0C8lj U0S9DgucBhu42emrRS1j/XB5pF/4qR4BXiDQG/FDyFQqvT2ZjxMl+9Od/1pmNYGtxb02 NmaRH6Xqx5IttQqNHV78XpxkgaA1niVsnba7Gy8bwsv+R2WbTuTTQjVrBOQD9d6sr4TP oxIg== X-Received: by 10.55.71.146 with SMTP id u140mr16651172qka.17.1446296217488; Sat, 31 Oct 2015 05:56:57 -0700 (PDT) Received: from localhost.localdomain ([45.74.60.60]) by smtp.gmail.com with ESMTPSA id 64sm4362161qgn.12.2015.10.31.05.56.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 31 Oct 2015 05:56:56 -0700 (PDT) From: Chris Zhong To: heiko@sntech.de, linux-rockchip@lists.infradead.org Subject: [PATCH v2 03/13] drm/rockchip: return a true clock rate to adjusted_mode Date: Sat, 31 Oct 2015 20:55:59 +0800 Message-Id: <1446296170-3702-4-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1446296170-3702-1-git-send-email-zyw@rock-chips.com> References: <1446296170-3702-1-git-send-email-zyw@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151031_055718_196000_2B65AA71 X-CRM114-Status: GOOD ( 10.59 ) X-Spam-Score: -0.5 (/) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chris Zhong , linux-arm-kernel@lists.infradead.org, Mark Yao MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_BLACK autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sometimes the clock driver can not set a accurate clock_rate for vop, get the true rate of vop_dclk and set it back to adjusted_mode, since the mipi dsi driver need to use the clock to make the calculation of Blanking. Signed-off-by: Chris Zhong --- Changes in v2: None drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 5d8ae5e..9986b311ed 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1232,6 +1232,12 @@ static int vop_crtc_mode_set(struct drm_crtc *crtc, reset_control_deassert(vop->dclk_rst); clk_set_rate(vop->dclk, adjusted_mode->clock * 1000); + + /* + * Sometimes the clock driver can not set a accurate clock_rate for vop, + * get the true rate of vop_dclk and set it back to adjusted_mode. + */ + adjusted_mode->clock = clk_get_rate(vop->dclk) / 1000; out: ret_clk = clk_enable(vop->dclk); if (ret_clk < 0) {