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: 7704831 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 26F25BF90C for ; Thu, 26 Nov 2015 07:50:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 548E620698 for ; Thu, 26 Nov 2015 07:50:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0FE5A2065E for ; Thu, 26 Nov 2015 07:50:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B65F96E5CD; Wed, 25 Nov 2015 23:50:53 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD42B6E5CD for ; Wed, 25 Nov 2015 23:50:52 -0800 (PST) Received: by iouu10 with SMTP id u10so78776071iou.0 for ; Wed, 25 Nov 2015 23:50:52 -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> Cc: Chris Zhong , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.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=-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; }