From patchwork Thu Nov 26 07:50:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 7705131 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 D3093BF90C for ; Thu, 26 Nov 2015 07:55:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2128F20629 for ; Thu, 26 Nov 2015 07:55:14 +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 599C320620 for ; Thu, 26 Nov 2015 07:55:13 +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 1a1rMn-0007Rw-Hq; Thu, 26 Nov 2015 07:53:21 +0000 Received: from mail-ig0-f172.google.com ([209.85.213.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1rKh-00062P-Cw; Thu, 26 Nov 2015 07:51:13 +0000 Received: by igcmv3 with SMTP id mv3so9505253igc.0; Wed, 25 Nov 2015 23:50:50 -0800 (PST) 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=0OrJaoDrWuk+wMUbePqGneU7J7XzfkqUIZiXCGu5Jrk=; b=G++EFG/x0PtjM10f53/d+2OpKBBbhn+HKVyFbW5YFrrLHqb/DCViSvSGRBTmjISe06 c4eten9Lc4w7gvkr886NQRab+gRztPyHz4m1U4DXN4KGq6P1viTP+ifQWS1VS3c26LwO Qd/bNVgst3pU3k5qj1NJQQrnxM9H1mCSZ18NgP6nJD5COWGfjAOn5t3i52xnT6J7X7Zb /Kc4j0jX0T+asrx78lzc+C9VCImuBOTG8eZXlu85p7OaTzQu0gLPGoigLO21CEntLxSJ EqKDctSiVKGgr/vLJwV9iXsMK4oHTwKtcyPKbsDoYru2rGOLjYzEHyEw2vFHUqgjfX/k tQww== X-Received: by 10.98.72.156 with SMTP id q28mr37840612pfi.117.1448524250380; Wed, 25 Nov 2015 23:50:50 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w1sm25396819pfa.57.2015.11.25.23.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 23:50:49 -0800 (PST) From: Chris Zhong To: heiko@sntech.de, linux-rockchip@lists.infradead.org, mark.yao@rock-chips.com, treding@nvidia.com Subject: [PATCH v5 03/11] drm/rockchip: return a true clock rate to adjusted_mode Date: Thu, 26 Nov 2015 15:50:17 +0800 Message-Id: <1448524225-5489-4-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1448524225-5489-1-git-send-email-zyw@rock-chips.com> References: <1448524225-5489-1-git-send-email-zyw@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151125_235111_649284_4D7DA19E X-CRM114-Status: GOOD ( 11.54 ) 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: Chris Zhong , David Airlie , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org 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=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Since the mipi dsi driver need to use the clock of vop to make the calculation of Blanking. But sometimes the clock driver can not set a accurate clock_rate for vop, get it by clk_round_rate before mode_set, so we can get the true value. Signed-off-by: Chris Zhong Acked-by: Mark Yao --- Changes in v5: None Changes in v4: - use clk_round_rate to check the clock rate in vop_crtc_mode_fixup Changes in v3: None Changes in v2: None drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 5d8ae5e..eff545b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1136,9 +1136,14 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { + struct vop *vop = to_vop(crtc); + if (adjusted_mode->htotal == 0 || adjusted_mode->vtotal == 0) return false; + adjusted_mode->clock = + clk_round_rate(vop->dclk, mode->clock * 1000) / 1000; + return true; }