From: Daniel Vetter <daniel@ffwll.ch>
To: Xiong Zhang <xiong.y.zhang@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: correct intel_dp_get_config() function for DevCPT
Date: Fri, 28 Jun 2013 10:28:17 +0200 [thread overview]
Message-ID: <20130628082817.GU18285@phenom.ffwll.local> (raw)
In-Reply-To: <1372395546-15728-1-git-send-email-xiong.y.zhang@intel.com>
On Fri, Jun 28, 2013 at 12:59:06PM +0800, Xiong Zhang wrote:
> On DevCPT, the control register for Transcoder DP Sync Polarity is
> TRANS_DP_CTL, not DP_CTL.
> Without this patch, Many call trace occur on CPT machine with DP monitor.
> The call trace is like: *ERROR* mismatch in adjusted_mode.flags(expected X,found X)
>
> v2: use intel-crtc to simple patch, suggested by Daniel.
>
> Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Queued for -next (with some tiny bikeshedding), thanks for the patch.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_dp.c | 35 +++++++++++++++++++++++++----------
> 1 file changed, 25 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 8708a0c..c3ff8ac 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1324,20 +1324,35 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
> struct intel_crtc_config *pipe_config)
> {
> struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
> - struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
> u32 tmp, flags = 0;
> + struct drm_device *dev = encoder->base.dev;
> + struct drm_i915_private *dev_priv = dev->dev_private;
> + enum port port = dp_to_dig_port(intel_dp)->port;
> + struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
>
> - tmp = I915_READ(intel_dp->output_reg);
> + if ((port == PORT_A) || !HAS_PCH_CPT(dev)) {
> + tmp = I915_READ(intel_dp->output_reg);
> + if (tmp & DP_SYNC_HS_HIGH)
> + flags |= DRM_MODE_FLAG_PHSYNC;
> + else
> + flags |= DRM_MODE_FLAG_NHSYNC;
>
> - if (tmp & DP_SYNC_HS_HIGH)
> - flags |= DRM_MODE_FLAG_PHSYNC;
> - else
> - flags |= DRM_MODE_FLAG_NHSYNC;
> + if (tmp & DP_SYNC_VS_HIGH)
> + flags |= DRM_MODE_FLAG_PVSYNC;
> + else
> + flags |= DRM_MODE_FLAG_NVSYNC;
> + } else {
> + tmp = I915_READ(TRANS_DP_CTL(intel_crtc->pipe));
> + if (tmp & TRANS_DP_HSYNC_ACTIVE_HIGH)
> + flags |= DRM_MODE_FLAG_PHSYNC;
> + else
> + flags |= DRM_MODE_FLAG_NHSYNC;
>
> - if (tmp & DP_SYNC_VS_HIGH)
> - flags |= DRM_MODE_FLAG_PVSYNC;
> - else
> - flags |= DRM_MODE_FLAG_NVSYNC;
> + if (tmp & TRANS_DP_VSYNC_ACTIVE_HIGH)
> + flags |= DRM_MODE_FLAG_PVSYNC;
> + else
> + flags |= DRM_MODE_FLAG_NVSYNC;
> + }
>
> pipe_config->adjusted_mode.flags |= flags;
> }
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-06-28 8:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 4:59 [PATCH] drm/i915: correct intel_dp_get_config() function for DevCPT Xiong Zhang
2013-06-28 8:28 ` Daniel Vetter [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-06-27 5:25 Xiong Zhang
2013-06-27 10:30 ` Daniel Vetter
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=20130628082817.GU18285@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=xiong.y.zhang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.