linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chris Zhong <zyw@rock-chips.com>
To: heiko@sntech.de, linux-rockchip@lists.infradead.org,
	mark.yao@rock-chips.com, treding@nvidia.com
Cc: Chris Zhong <zyw@rock-chips.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 1/5] drm/rockchip: return a true clock rate to adjusted_mode
Date: Wed,  6 Jan 2016 12:03:53 +0800	[thread overview]
Message-ID: <1452053038-32098-2-git-send-email-zyw@rock-chips.com> (raw)
In-Reply-To: <1452053038-32098-1-git-send-email-zyw@rock-chips.com>

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 <zyw@rock-chips.com>
Acked-by: Mark Yao <mark.yao@rock-chips.com>

---

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;
 }
 
-- 
2.6.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-01-06  4:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06  4:03 [PATCH v7 0/5] Add mipi dsi support for rk3288 Chris Zhong
2016-01-06  4:03 ` Chris Zhong [this message]
2016-01-06  4:03 ` [PATCH v7 2/5] Documentation: dt-bindings: Add bindings for rk3288 DW MIPI DSI driver Chris Zhong
2016-01-06  4:03 ` [PATCH v7 3/5] drm: rockchip: Support Synopsys DW MIPI DSI Chris Zhong
2016-01-06  6:30   ` Mark yao
2016-01-06  7:12     ` [PATCH v7.1 " Chris Zhong
2016-01-06  8:12     ` [PATCH v7.2 " Chris Zhong
2016-01-06  4:03 ` [PATCH v7 4/5] ARM: dts: rockchip: add rk3288 mipi_dsi nodes Chris Zhong
     [not found]   ` <1452053038-32098-5-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-19 15:29     ` Heiko Stuebner
2016-01-20  0:50       ` Chris Zhong
     [not found] ` <1452053038-32098-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-06  4:03   ` [PATCH v7 5/5] ARM: dts: rockchip: add support mipi panel tv080wum-nl0 Chris Zhong
     [not found]     ` <1452053038-32098-6-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-19 19:26       ` Heiko Stuebner
2016-01-20  1:09         ` Chris Zhong
     [not found]           ` <569EDE2F.6060400-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-20 22:25             ` Heiko Stuebner
2016-01-06  8:39 ` [PATCH v7 0/5] Add mipi dsi support for rk3288 Mark yao
2016-02-08 10:12 ` Archit Taneja
2016-02-08 10:52   ` Heiko Stuebner
2016-02-08 12:26     ` Archit Taneja
     [not found]   ` <56B869F4.6090507-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-02-24  9:38     ` Xinliang Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452053038-32098-2-git-send-email-zyw@rock-chips.com \
    --to=zyw@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.com \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).