public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 06/09] drm/i915: fix Haswell M/N registers
Date: Fri, 29 Jun 2012 16:03:38 -0300	[thread overview]
Message-ID: <1340996621-14345-6-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1340996621-14345-1-git-send-email-przanoni@gmail.com>

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

We have to write the correct values inside intel_dp_set_m_n and then
we have to prevent ironlake_crtc_mode_set from overwriting the correct
values with wrong ones.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   10 ++++++----
 drivers/gpu/drm/i915/intel_dp.c      |    9 ++++++++-
 2 files changed, 14 insertions(+), 5 deletions(-)

When exactly the M/N values set inside crtc_mode_set should be used? It's
certainly not for DP...

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1475b18..d2542bd 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5018,10 +5018,12 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 	I915_WRITE(PIPESRC(pipe),
 		   ((mode->hdisplay - 1) << 16) | (mode->vdisplay - 1));
 
-	I915_WRITE(PIPE_DATA_M1(pipe), TU_SIZE(m_n.tu) | m_n.gmch_m);
-	I915_WRITE(PIPE_DATA_N1(pipe), m_n.gmch_n);
-	I915_WRITE(PIPE_LINK_M1(pipe), m_n.link_m);
-	I915_WRITE(PIPE_LINK_N1(pipe), m_n.link_n);
+	if (!(IS_HASWELL(dev) && is_dp)) {
+		I915_WRITE(PIPE_DATA_M1(pipe), TU_SIZE(m_n.tu) | m_n.gmch_m);
+		I915_WRITE(PIPE_DATA_N1(pipe), m_n.gmch_n);
+		I915_WRITE(PIPE_LINK_M1(pipe), m_n.link_m);
+		I915_WRITE(PIPE_LINK_N1(pipe), m_n.link_n);
+	}
 
 	if (is_cpu_edp)
 		ironlake_set_pll_edp(crtc, adjusted_mode->clock);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 2a8bf47..8c66c0c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -795,7 +795,14 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
 	intel_dp_compute_m_n(intel_crtc->bpp, lane_count,
 			     mode->clock, adjusted_mode->clock, &m_n);
 
-	if (HAS_PCH_SPLIT(dev)) {
+	if (IS_HASWELL(dev)) {
+		I915_WRITE(PIPE_DATA_M1(pipe),
+			   ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) |
+			   m_n.gmch_m);
+		I915_WRITE(PIPE_DATA_N1(pipe), m_n.gmch_n);
+		I915_WRITE(PIPE_LINK_M1(pipe), m_n.link_m);
+		I915_WRITE(PIPE_LINK_N1(pipe), m_n.link_n);
+	} else if (HAS_PCH_SPLIT(dev)) {
 		I915_WRITE(TRANSDATA_M1(pipe),
 			   ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) |
 			   m_n.gmch_m);
-- 
1.7.10.2

  parent reply	other threads:[~2012-06-29 19:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29 19:03 [PATCH 01/09] drm/i915: move common code to intel_dp_set_link_train Paulo Zanoni
2012-06-29 19:03 ` [PATCH 02/09] drm/i915: try to train DP even harder Paulo Zanoni
2012-07-12 14:58   ` Daniel Vetter
2012-06-29 19:03 ` [PATCH 03/09] drm/i915: Move DP structs to shared location Paulo Zanoni
2012-07-12 15:13   ` Daniel Vetter
2012-06-29 19:03 ` [PATCH 04/09] drm/i915: Add "port" field to struct intel_dp Paulo Zanoni
2012-07-12 15:04   ` Daniel Vetter
2012-06-29 19:03 ` [PATCH 05/09] drm/i915: add basic Haswell DP enablement Paulo Zanoni
2012-06-29 19:03 ` Paulo Zanoni [this message]
2012-06-29 19:03 ` [PATCH 07/09] drm/i915: implement Haswell DP link train Paulo Zanoni
2012-06-29 19:03 ` [PATCH 08/09] drm/i915: fix DP AUX register definitions on Haswell Paulo Zanoni
2012-06-29 19:03 ` [PATCH 09/09] drm/i915: init DP instead of HDMI on port B Paulo Zanoni
2012-07-12 14:52 ` [PATCH 01/09] drm/i915: move common code to intel_dp_set_link_train Daniel Vetter
2012-07-17 19:55 ` [PATCH 1/2] " Paulo Zanoni
2012-07-17 20:53 ` [PATCH 2/2] drm/i915: add port field to struct intel_dp and use it Paulo Zanoni
2012-07-18 10:42   ` 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=1340996621-14345-6-git-send-email-przanoni@gmail.com \
    --to=przanoni@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox