From patchwork Sat Oct 10 09:55:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 7366081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F23C09F32B for ; Sat, 10 Oct 2015 09:58:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 431972078A for ; Sat, 10 Oct 2015 09:58:28 +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 68A3D206AC for ; Sat, 10 Oct 2015 09:58:27 +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 1ZkqtK-0004hg-W5; Sat, 10 Oct 2015 09:56:39 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZkqtE-0004aU-M8; Sat, 10 Oct 2015 09:56:33 +0000 Received: by pabve7 with SMTP id ve7so50936253pab.2; Sat, 10 Oct 2015 02:56:12 -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=TyntBdKHLEqOBKa/R80P+cZji+n/t6/UQe95Ac2C2YA=; b=HykNcI3tIs+xEE05x5OaE6wRRRwqBs1bFELtoB7m8PnXAgaIVgL1SmIkaFuDiQprgA ULWpwUEz3oJLqdpw6cbbfGpdCpVk0tZjc/hBMBuKSkxISz0mfYN6p1BnEcqXV7HSpmpZ QhVV8PFKwi+uX2Bs9erL/Vg++voH7CeRf1gpKGMzkoK2j5ygVPdd9WMc+DJo/4QFsml0 NUBIRuroyxb/S+XGUTQFi4xViZiIiW87aDaY5OBMwmgOhJUclWF6s4ERE2RosK+ixaOh 4zE+z8fH2lYE/irZHOnGCFPiruiRICT7ngYB1hWwl8RKKeL+0vNDVjkWbg940eXUEkt0 U+NA== X-Received: by 10.66.144.135 with SMTP id sm7mr21907422pab.106.1444470972040; Sat, 10 Oct 2015 02:56:12 -0700 (PDT) Received: from localhost.localdomain ([192.253.240.50]) by smtp.gmail.com with ESMTPSA id wi10sm7235351pbc.31.2015.10.10.02.56.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Oct 2015 02:56:11 -0700 (PDT) From: Chris Zhong To: heiko@sntech.de, linux-rockchip@lists.infradead.org Subject: [PATCH 02/10] drm/rockchip: return a true clock rate to adjusted_mode Date: Sat, 10 Oct 2015 17:55:22 +0800 Message-Id: <1444470930-17150-3-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1444470930-17150-1-git-send-email-zyw@rock-chips.com> References: <1444470930-17150-1-git-send-email-zyw@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151010_025632_934014_BB1AAC57 X-CRM114-Status: GOOD ( 10.81 ) X-Spam-Score: -2.2 (--) 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 --- 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) {