From: Mark Yao <mark.yao@rock-chips.com>
To: David Airlie <airlied@linux.ie>, Heiko Stuebner <heiko@sntech.de>,
dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Mark Yao <mark.yao@rock-chips.com>
Subject: [PATCH 2/2] drm/rockchip: vop: verify pixelclock for hdmi and displayport
Date: Tue, 21 Feb 2017 10:41:25 +0800 [thread overview]
Message-ID: <1487644885-22492-2-git-send-email-mark.yao@rock-chips.com> (raw)
In-Reply-To: <1487644885-22492-1-git-send-email-mark.yao@rock-chips.com>
Hdmi or DisplayPort request a accurate clock,
reject the display mode if clock is not good.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
---
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 7ec5d7f..a7c118e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -868,14 +868,24 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
{
struct vop *vop = to_vop(crtc);
const struct vop_data *vop_data = vop->data;
+ struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
+ int clock;
if (mode->hdisplay > vop_data->max_output.width)
return false;
if (mode->vdisplay > vop_data->max_output.height)
return false;
- adjusted_mode->clock =
- clk_round_rate(vop->dclk, mode->clock * 1000) / 1000;
+ clock = clk_round_rate(vop->dclk, mode->clock * 1000) / 1000;
+ /*
+ * Hdmi or DisplayPort request a Accurate clock.
+ */
+ if (s->output_type == DRM_MODE_CONNECTOR_HDMIA ||
+ s->output_type == DRM_MODE_CONNECTOR_DisplayPort)
+ if (clock != mode->clock)
+ return false;
+
+ adjusted_mode->clock = clock;
return true;
}
--
1.9.1
prev parent reply other threads:[~2017-02-21 2:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 2:41 [PATCH 1/2] drm/rockchip: vop: verify display mode with vop max_output Mark Yao
2017-02-21 2:41 ` Mark Yao [this message]
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=1487644885-22492-2-git-send-email-mark.yao@rock-chips.com \
--to=mark.yao@rock-chips.com \
--cc=airlied@linux.ie \
--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 \
/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
all inboxes | Powered by JetHome®