From patchwork Wed Jan 6 04:03:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 7964391 Return-Path: X-Original-To: patchwork-dri-devel@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 526B5BEEE5 for ; Wed, 6 Jan 2016 04:04:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EF7220222 for ; Wed, 6 Jan 2016 04:04:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 544122034F for ; Wed, 6 Jan 2016 04:04:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3478B6E2C6; Tue, 5 Jan 2016 20:04:16 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A5116E2C6 for ; Tue, 5 Jan 2016 20:04:15 -0800 (PST) Received: by mail-pa0-f41.google.com with SMTP id uo6so207179263pac.1 for ; Tue, 05 Jan 2016 20:04:15 -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=/GXCZzBdRxTQBwJqcZCt4kysLSiEHbUk+p3fUXFlTW0=; b=hDiLPD01XddtW86nELKuBNwHaHmvP000/oM+9QimhF6ERlICWIEs+nDy/S3BqFmtz3 3e5Lg4wRx1LKEN2P+LoanmXyyVAAXijQicZIdjkkRITjRVU9S2osoe6qpoxN14Vas8uZ OhqP8EB8ZLe2GkedtlCEbAyP9wGuYnmbiKXTtD7iroTPmpvdfV+zhH0AEVEuDPK28FpQ 4S+Zrmd9WNIbEPGBeEnq5r9ATig6lixugfwOFix9wvNiib7TUsHU2xUTkcbY1ouHFTIt ynJVntLukjg72zrJgYhHCBpbpq2V7hqBTBTcwU6mA+XECoESqWZjWK0wm6BzBfoyqCh6 IIvA== X-Received: by 10.66.222.129 with SMTP id qm1mr93954741pac.10.1452053055081; Tue, 05 Jan 2016 20:04:15 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id c87sm33242672pfj.79.2016.01.05.20.04.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jan 2016 20:04:13 -0800 (PST) From: Chris Zhong To: heiko@sntech.de, linux-rockchip@lists.infradead.org, mark.yao@rock-chips.com, treding@nvidia.com Subject: [PATCH v7 1/5] drm/rockchip: return a true clock rate to adjusted_mode Date: Wed, 6 Jan 2016 12:03:53 +0800 Message-Id: <1452053038-32098-2-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1452053038-32098-1-git-send-email-zyw@rock-chips.com> References: <1452053038-32098-1-git-send-email-zyw@rock-chips.com> Cc: Chris Zhong , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.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 v7: None Changes in v6: None 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 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 f5b3da2..056cac3 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -878,9 +878,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; }