Skip to contentSkip to conversation

drm/i915: Enable pixel replicated modes on BDW and HSW.

PATCH Superseded [email protected] 5 participants 18 messages Sep 23, 2014 – Oct 1, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Enable pixel replicated modes on BDW and HSW.

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 15c0eaa..7c078d9 100644
@@ -2431,6 +2431,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2442,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2462,6 +2464,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define MULTIPLY(trans) _TRANSCODER2(trans, _MULTIPLY_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +5 -1
index c092ff4..e58fcde 100644
@@ -4152,6 +4152,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	I915_WRITE(MULTIPLY(intel_crtc->config.cpu_transcoder),
+			    intel_crtc->config.pixel_multiplier - 1);
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7811,7 +7814,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	pipe_config->pixel_multiplier =
+			I915_READ(MULTIPLY(pipe_config->cpu_transcoder)) + 1;
 
 	return true;
 }
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 7 lines · On Tue, 23 Sep 2014, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

Any idea of the failure modes that this will fix? I'm wondering if we already have bugs for this.

BR,
Jani.

Quoted 66 lines
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 15c0eaa..7c078d9 100644
@@ -2431,6 +2431,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2442,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2462,6 +2464,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define MULTIPLY(trans) _TRANSCODER2(trans, _MULTIPLY_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +5 -1
index c092ff4..e58fcde 100644
@@ -4152,6 +4152,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	I915_WRITE(MULTIPLY(intel_crtc->config.cpu_transcoder),
+			    intel_crtc->config.pixel_multiplier - 1);
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7811,7 +7814,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	pipe_config->pixel_multiplier =
+			I915_READ(MULTIPLY(pipe_config->cpu_transcoder)) + 1;
 
 	return true;
 }
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#2 lore raw
Quoted 11 lines · Jani Nikula
Quoted 7 lines · On Tue, 23 Sep 2014, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

Any idea of the failure modes that this will fix? I'm wondering if we already have bugs for this.

Should only be possible to hit since we've enabled doubleclocked hdmi modes with

commit 697c4078c765c02b9c4ca2d828ae4d7af62453a6

Author: Clint Taylor <[email protected]>
Date:   Tue Sep 2 17:03:36 2014 -0700

drm/i915/hdmi: Enable pipe pixel replication for SD interlaced modes

Would be impressive if we'd have a hsw/bdw bug report about this already ;-)

Cheers, Daniel

Quoted 77 lines

BR,
Jani.

Quoted 66 lines
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 15c0eaa..7c078d9 100644
@@ -2431,6 +2431,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2442,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2462,6 +2464,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define MULTIPLY(trans) _TRANSCODER2(trans, _MULTIPLY_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +5 -1
index c092ff4..e58fcde 100644
@@ -4152,6 +4152,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	I915_WRITE(MULTIPLY(intel_crtc->config.cpu_transcoder),
+			    intel_crtc->config.pixel_multiplier - 1);
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7811,7 +7814,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	pipe_config->pixel_multiplier =
+			I915_READ(MULTIPLY(pipe_config->cpu_transcoder)) + 1;
 
 	return true;
 }
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
In reply to [email protected]
Quoted 35 lines · On Tue, Sep 23, 2014 at 11:06:56AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 15c0eaa..7c078d9 100644
@@ -2431,6 +2431,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2442,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 2467

Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2462,6 +2464,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define MULTIPLY(trans) _TRANSCODER2(trans, _MULTIPLY_A)

MULTIPLY is a bit generic and doesn't even match Bspec lingo. I'd just go with PIPE_MULTI instead to match Bspec and give it a nice PIPE_ prefix.

drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_enable(struct drm_crtc *crtc) · line 4155

Quoted 12 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +1 -0
index c092ff4..e58fcde 100644
@@ -4152,6 +4152,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	I915_WRITE(MULTIPLY(intel_crtc->config.cpu_transcoder),

This register is per-pipe, so needs to be indexed with intel_crtc->pipe. Same below.

Otherwise this loooks good.
-Daniel

Quoted 22 lines
drivers/gpu/drm/i915/intel_display.c +4 -1
+			    intel_crtc->config.pixel_multiplier - 1);
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7811,7 +7814,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	pipe_config->pixel_multiplier =
+			I915_READ(MULTIPLY(pipe_config->cpu_transcoder)) + 1;
 
 	return true;
 }
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw
Quoted 52 lines · Daniel Vetter
Quoted 35 lines · On Tue, Sep 23, 2014 at 11:06:56AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

---
  drivers/gpu/drm/i915/i915_reg.h      |    3 +++
  drivers/gpu/drm/i915/intel_display.c |    6 +++++-
  2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 15c0eaa..7c078d9 100644
@@ -2431,6 +2431,7 @@ enum punit_power_well {
  #define _PIPEASRC	0x6001c
  #define _BCLRPAT_A	0x60020
  #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
  /* Pipe B timing regs */
  #define _HTOTAL_B	0x61000
@@ -2442,6 +2443,7 @@ enum punit_power_well {
  #define _PIPEBSRC	0x6101c
  #define _BCLRPAT_B	0x61020
  #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
  #define TRANSCODER_A_OFFSET 0x60000
  #define TRANSCODER_B_OFFSET 0x61000

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 2467

Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2462,6 +2464,7 @@ enum punit_power_well {
  #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
  #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
  #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define MULTIPLY(trans) _TRANSCODER2(trans, _MULTIPLY_A)

MULTIPLY is a bit generic and doesn't even match Bspec lingo. I'd just go with PIPE_MULTI instead to match Bspec and give it a nice PIPE_ prefix.

Quoted 9 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
  /* HSW+ eDP PSR registers */
  #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +0 -0
index c092ff4..e58fcde 100644
@@ -4152,6 +4152,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_enable(struct drm_crtc *crtc) · line 4155

Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
  	intel_set_pipe_timings(intel_crtc);
 
+	I915_WRITE(MULTIPLY(intel_crtc->config.cpu_transcoder),

This register is per-pipe, so needs to be indexed with intel_crtc->pipe. Same below.

The MULTIPLY Macro calls the _TRANSCODER2 MACRO which already indexes the register based on intel_crtc->pipe. This should be all that's required.

-Clint

Quoted 27 lines

Otherwise this loooks good.
-Daniel

Quoted 22 lines
drivers/gpu/drm/i915/intel_display.c +4 -2
+			    intel_crtc->config.pixel_multiplier - 1);
+
  	if (intel_crtc->config.has_pch_encoder) {
  		intel_cpu_transcoder_set_m_n(intel_crtc,
  				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7811,7 +7814,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
  			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	pipe_config->pixel_multiplier =
+			I915_READ(MULTIPLY(pipe_config->cpu_transcoder)) + 1;
 
  	return true;
  }
--

1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
Quoted 55 lines · Clint Taylor
Quoted 54 lines · Daniel Vetter
Quoted 35 lines · On Tue, Sep 23, 2014 at 11:06:56AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 15c0eaa..7c078d9 100644
@@ -2431,6 +2431,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2442,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 2467

Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2462,6 +2464,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define MULTIPLY(trans) _TRANSCODER2(trans, _MULTIPLY_A)

MULTIPLY is a bit generic and doesn't even match Bspec lingo. I'd just go with PIPE_MULTI instead to match Bspec and give it a nice PIPE_ prefix.

Quoted 11 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +0 -0
index c092ff4..e58fcde 100644
@@ -4152,6 +4152,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
Quoted 7 lines
Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_enable(struct drm_crtc *crtc) · line 4155

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+	I915_WRITE(MULTIPLY(intel_crtc->config.cpu_transcoder),

This register is per-pipe, so needs to be indexed with intel_crtc->pipe. Same below.

The MULTIPLY Macro calls the _TRANSCODER2 MACRO which already indexes the register based on intel_crtc->pipe. This should be all that's required.

I don't see where it indexes with intel_crtc->pipe ...

But it doesn't matter since the register is clearly in the transcoder block, and the reason why Bspec says is per-pipe is that the edp transcoder doesn't have it. So on second consideration I guess we can keep this part as-is then.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#6 lore raw
Quoted 64 lines · Daniel Vetter
Quoted 55 lines · Clint Taylor
Quoted 54 lines · Daniel Vetter
Quoted 35 lines · On Tue, Sep 23, 2014 at 11:06:56AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 15c0eaa..7c078d9 100644
@@ -2431,6 +2431,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2442,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 2467

Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2462,6 +2464,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define MULTIPLY(trans) _TRANSCODER2(trans, _MULTIPLY_A)

MULTIPLY is a bit generic and doesn't even match Bspec lingo. I'd just go with PIPE_MULTI instead to match Bspec and give it a nice PIPE_ prefix.

Quoted 11 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +0 -0
index c092ff4..e58fcde 100644
@@ -4152,6 +4152,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
Quoted 7 lines
Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_enable(struct drm_crtc *crtc) · line 4155

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+	I915_WRITE(MULTIPLY(intel_crtc->config.cpu_transcoder),

This register is per-pipe, so needs to be indexed with intel_crtc->pipe. Same below.

The MULTIPLY Macro calls the _TRANSCODER2 MACRO which already indexes the register based on intel_crtc->pipe. This should be all that's required.

Quoted 6 lines

I don't see where it indexes with intel_crtc->pipe ...

But it doesn't matter since the register is clearly in the transcoder block, and the reason why Bspec says is per-pipe is that the edp transcoder doesn't have it. So on second consideration I guess we can keep this part as-is then.

? If it doesn't exist for EDP we can't just go passing cpu_transcoder to it.

BDW BSpec seems to claim that it really is a transcoder register and not a pipe register (just looking at the offset isn't enoguh to tell that as PIPESRC shows). So in that sense using cpu_transcoder is more appropriate, but if we do that we must not write the register when cpu_transcoder == EDP. I suppose that even makes sense since it's only valid for HDMI/DVI and that's not supported on the EDP transcoder. But someone really must verify that it really is a transcoder and not a pipe register and that it has no effect on transcoder EDP.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#7 lore raw
Quoted 75 lines · Ville Syrjälä
Quoted 64 lines · Daniel Vetter
Quoted 55 lines · Clint Taylor
Quoted 54 lines · Daniel Vetter
Quoted 35 lines · On Tue, Sep 23, 2014 at 11:06:56AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 15c0eaa..7c078d9 100644
@@ -2431,6 +2431,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2442,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 2467

Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2462,6 +2464,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define MULTIPLY(trans) _TRANSCODER2(trans, _MULTIPLY_A)

MULTIPLY is a bit generic and doesn't even match Bspec lingo. I'd just go with PIPE_MULTI instead to match Bspec and give it a nice PIPE_ prefix.

Quoted 11 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +0 -0
index c092ff4..e58fcde 100644
@@ -4152,6 +4152,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
Quoted 7 lines
Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_enable(struct drm_crtc *crtc) · line 4155

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+	I915_WRITE(MULTIPLY(intel_crtc->config.cpu_transcoder),

This register is per-pipe, so needs to be indexed with intel_crtc->pipe. Same below.

The MULTIPLY Macro calls the _TRANSCODER2 MACRO which already indexes the register based on intel_crtc->pipe. This should be all that's required.

Quoted 6 lines

I don't see where it indexes with intel_crtc->pipe ...

But it doesn't matter since the register is clearly in the transcoder block, and the reason why Bspec says is per-pipe is that the edp transcoder doesn't have it. So on second consideration I guess we can keep this part as-is then.

? If it doesn't exist for EDP we can't just go passing cpu_transcoder to it.

Quoted 8 lines

BDW BSpec seems to claim that it really is a transcoder register and not a pipe register (just looking at the offset isn't enoguh to tell that as PIPESRC shows). So in that sense using cpu_transcoder is more appropriate, but if we do that we must not write the register when cpu_transcoder == EDP. I suppose that even makes sense since it's only valid for HDMI/DVI and that's not supported on the EDP transcoder. But someone really must verify that it really is a transcoder and not a pipe register and that it has no effect on transcoder EDP.

I guess we could use the cpu_transcoder and add a WARN_ON(cpu_transcoder == EDP). Makes stuff consistent and if we ever botch this up we'll know. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#8 lore raw

PATCH v2 1/1 drm/i915: Enable pixel replicated modes on BDW and HSW.

In reply to [email protected]

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)

Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index ad8179b..035d58c 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2474,6 +2476,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULTI(trans) _TRANSCODER2(trans, _MULTIPLY_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +5 -1
index 858011d..49eced4 100644
@@ -4168,6 +4168,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	I915_WRITE(PIPE_MULTI(intel_crtc->config.cpu_transcoder),
+			    intel_crtc->config.pixel_multiplier - 1);
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7853,7 +7856,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULTI(pipe_config->cpu_transcoder)) + 1;
 
 	return true;
 }
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH v3 1/1 drm/i915: Enable pixel replicated modes on BDW and HSW.

In reply to [email protected]

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
ver3: Do not set pixel multiplier if transcoder is eDP (Ville)

Cc Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |   10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index ad8179b..035d58c 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2474,6 +2476,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULTI(trans) _TRANSCODER2(trans, _MULTIPLY_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +9 -1
index 858011d..f8c1f11 100644
@@ -4168,6 +4168,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	if (intel_crtc->config.cpu_transcoder != TRANSCODER_EDP) {
+		I915_WRITE(PIPE_MULTI(intel_crtc->config.cpu_transcoder),
+				intel_crtc->config.pixel_multiplier - 1);
+	}
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7853,7 +7858,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	if (pipe_config->cpu_transcoder != TRANSCODER_EDP) {
+		pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULTI(pipe_config->cpu_transcoder)) + 1;
+	}
 
 	return true;
 }
Signature · 1 line
1.7.9.5
#10 lore raw
Quoted 54 lines · On Thu, Sep 25, 2014 at 10:03:53AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
ver3: Do not set pixel multiplier if transcoder is eDP (Ville)

Cc Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |   10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index ad8179b..035d58c 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2474,6 +2476,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULTI(trans) _TRANSCODER2(trans, _MULTIPLY_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 858011d..f8c1f11 100644

drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_enable(struct drm_crtc *crtc) · line 4174

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -4168,6 +4168,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	if (intel_crtc->config.cpu_transcoder != TRANSCODER_EDP) {
+		I915_WRITE(PIPE_MULTI(intel_crtc->config.cpu_transcoder),
+				intel_crtc->config.pixel_multiplier - 1);
+	}

So did you verify that the register really is a transcoder register? Eg. set PIPE_MULT(A) to >1x and use pipe A to drive the EDP transcoder.

Quoted 18 lines
drivers/gpu/drm/i915/intel_display.c +5 -1
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7853,7 +7858,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	if (pipe_config->cpu_transcoder != TRANSCODER_EDP) {
+		pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULTI(pipe_config->cpu_transcoder)) + 1;
+	}
 
 	return true;
 }
Signature · 1 line
1.7.9.5
Signature · 2 lines
Ville Syrjälä
Intel OTC
#11 lore raw
Quoted 58 lines · Ville Syrjälä
Quoted 57 lines · On Thu, Sep 25, 2014 at 10:03:53AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
ver3: Do not set pixel multiplier if transcoder is eDP (Ville)

Cc Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
  drivers/gpu/drm/i915/i915_reg.h      |    3 +++
  drivers/gpu/drm/i915/intel_display.c |   10 +++++++++-
  2 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index ad8179b..035d58c 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
  #define _PIPEASRC	0x6001c
  #define _BCLRPAT_A	0x60020
  #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
  /* Pipe B timing regs */
  #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
  #define _PIPEBSRC	0x6101c
  #define _BCLRPAT_B	0x61020
  #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
  #define TRANSCODER_A_OFFSET 0x60000
  #define TRANSCODER_B_OFFSET 0x61000
@@ -2474,6 +2476,7 @@ enum punit_power_well {
  #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
  #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
  #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULTI(trans) _TRANSCODER2(trans, _MULTIPLY_A)
 
  /* HSW+ eDP PSR registers */
  #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 858011d..f8c1f11 100644
@@ -4168,6 +4168,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
  	intel_set_pipe_timings(intel_crtc);
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_enable(struct drm_crtc *crtc) · line 4174

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+	if (intel_crtc->config.cpu_transcoder != TRANSCODER_EDP) {
+		I915_WRITE(PIPE_MULTI(intel_crtc->config.cpu_transcoder),
+				intel_crtc->config.pixel_multiplier - 1);
+	}

So did you verify that the register really is a transcoder register? Eg. set PIPE_MULT(A) to >1x and use pipe A to drive the EDP transcoder.

I did not verify. This change was done based on the fact that the register does not exist in the VPG HTML version of the BPEC for Transcoder_EDP, only TRANS_MULT_A, _B, and _C are defined.

Do we have an SI contact that can confirm?

-Clint

Quoted 20 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_display.c +5 -2
+
  	if (intel_crtc->config.has_pch_encoder) {
  		intel_cpu_transcoder_set_m_n(intel_crtc,
  				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7853,7 +7858,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
  			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	if (pipe_config->cpu_transcoder != TRANSCODER_EDP) {
+		pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULTI(pipe_config->cpu_transcoder)) + 1;
+	}
 
  	return true;
  }
--

1.7.9.5

#12 lore raw
Quoted 67 lines · Clint Taylor
Quoted 58 lines · Ville Syrjälä
Quoted 57 lines · On Thu, Sep 25, 2014 at 10:03:53AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
ver3: Do not set pixel multiplier if transcoder is eDP (Ville)

Cc Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
  drivers/gpu/drm/i915/i915_reg.h      |    3 +++
  drivers/gpu/drm/i915/intel_display.c |   10 +++++++++-
  2 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index ad8179b..035d58c 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
  #define _PIPEASRC	0x6001c
  #define _BCLRPAT_A	0x60020
  #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
  /* Pipe B timing regs */
  #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
  #define _PIPEBSRC	0x6101c
  #define _BCLRPAT_B	0x61020
  #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
  #define TRANSCODER_A_OFFSET 0x60000
  #define TRANSCODER_B_OFFSET 0x61000
@@ -2474,6 +2476,7 @@ enum punit_power_well {
  #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
  #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
  #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULTI(trans) _TRANSCODER2(trans, _MULTIPLY_A)
 
  /* HSW+ eDP PSR registers */
  #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 858011d..f8c1f11 100644
@@ -4168,6 +4168,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
  	intel_set_pipe_timings(intel_crtc);
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_enable(struct drm_crtc *crtc) · line 4174

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+	if (intel_crtc->config.cpu_transcoder != TRANSCODER_EDP) {
+		I915_WRITE(PIPE_MULTI(intel_crtc->config.cpu_transcoder),
+				intel_crtc->config.pixel_multiplier - 1);
+	}

So did you verify that the register really is a transcoder register? Eg. set PIPE_MULT(A) to >1x and use pipe A to drive the EDP transcoder.

Quoted 5 lines

I did not verify. This change was done based on the fact that the register does not exist in the VPG HTML version of the BPEC for Transcoder_EDP, only TRANS_MULT_A, _B, and _C are defined.

Do we have an SI contact that can confirm?

Cc ing Art.

Art, the confusion here is whether PIPE_MULT is a transcoder register or a pipe register. BSpec seems to be telling us that it's a transcoder register but the confusion comes from the fact that the EDP transcoder doesn't have this register. My theory is that it is a transcoder register, but since pixel repeat isn't needed for eDP the register isn't present (or relevant) in the EDP transcoder. Can you clarify this?

Although in this case it would be very easy to test this theory on actual hardware as I previously suggested.

Quoted 24 lines

-Clint

Quoted 20 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_display.c +5 -2
+
  	if (intel_crtc->config.has_pch_encoder) {
  		intel_cpu_transcoder_set_m_n(intel_crtc,
  				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7853,7 +7858,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
  			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	if (pipe_config->cpu_transcoder != TRANSCODER_EDP) {
+		pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULTI(pipe_config->cpu_transcoder)) + 1;
+	}
 
  	return true;
  }
--

1.7.9.5

Signature · 2 lines
Ville Syrjälä
Intel OTC
#13 lore raw
Quoted 19 lines
Quoted 9 lines
Quoted 3 lines

So did you verify that the register really is a transcoder register? Eg. set PIPE_MULT(A) to >1x and use pipe A to drive the EDP transcoder.

I did not verify. This change was done based on the fact that the register does not exist in the VPG HTML version of the BPEC for Transcoder_EDP, only TRANS_MULT_A, _B, and _C are defined.

Do we have an SI contact that can confirm?

Cc ing Art.

Art, the confusion here is whether PIPE_MULT is a transcoder register or a pipe register. BSpec seems to be telling us that it's a transcoder register but the confusion comes from the fact that the EDP transcoder doesn't have this register. My theory is that it is a transcoder register, but since pixel repeat isn't needed for eDP the register isn't present (or relevant) in the EDP transcoder. Can you clarify this?

Quoted 2 lines

Although in this case it would be very easy to test this theory on actual hardware as I previously suggested.

You are correct. It's transcoder based. It only gets used in HDMI/DVI modes, so EDP doesn't get one. Broadwell was able to properly rename transcoder stuff, so these became TRANS_MULT.

#14 lore raw
In reply to [email protected]
Quoted 42 lines · On Thu, Sep 25, 2014 at 10:03:53AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
ver3: Do not set pixel multiplier if transcoder is eDP (Ville)

Cc Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |   10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index ad8179b..035d58c 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _MULTIPLY_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _MULTIPLY_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 2479

Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2474,6 +2476,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULTI(trans) _TRANSCODER2(trans, _MULTIPLY_A)

PIPE_MULT (w/o the 'I') is what the spec called it. Best to follow the same naming conventiom to make it easier to search for things in the spec. I would also name the _MULTIPLY_x defines the same way.

Quoted 20 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +5 -0
index 858011d..f8c1f11 100644
@@ -4168,6 +4168,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	if (intel_crtc->config.cpu_transcoder != TRANSCODER_EDP) {
+		I915_WRITE(PIPE_MULTI(intel_crtc->config.cpu_transcoder),
+				intel_crtc->config.pixel_multiplier - 1);
+	}
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 7864

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +4 -1
@@ -7853,7 +7858,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	if (pipe_config->cpu_transcoder != TRANSCODER_EDP) {
+		pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULTI(pipe_config->cpu_transcoder)) + 1;
+	}

else
pixel_multiplier = 1;

With those fixed/changed this look good.

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	return true;
 }
Signature · 1 line
1.7.9.5
Signature · 2 lines
Ville Syrjälä
Intel OTC
#15 lore raw

PATCH v4 1/1 drm/i915: Enable pixel replicated modes on BDW and HSW.

In reply to [email protected]

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
ver3: Do not set pixel multiplier if transcoder is eDP (Ville)
ver4: Macro name change to PIPE_MULT and default else pixel_multiplier

Cc Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |   13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index ad8179b..d428f7a 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _PIPE_MULT_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _PIPE_MULT_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2474,6 +2476,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULT(trans) _TRANSCODER2(trans, _PIPE_MULT_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +12 -1
index 858011d..617dad6 100644
@@ -4168,6 +4168,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	if (intel_crtc->config.cpu_transcoder != TRANSCODER_EDP) {
+		I915_WRITE(PIPE_MULT(intel_crtc->config.cpu_transcoder),
+				intel_crtc->config.pixel_multiplier - 1);
+	}
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7853,7 +7858,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	if (pipe_config->cpu_transcoder != TRANSCODER_EDP) {
+		pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULT(pipe_config->cpu_transcoder)) + 1;
+	}
+	else {
+		pipe_config->pixel_multiplier = 1;
+	}
 
 	return true;
 }
Signature · 1 line
1.7.9.5
Reviewed-by on v4 1/1
#16 lore raw
Quoted 68 lines · On Tue, Sep 30, 2014 at 10:30:22AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
ver3: Do not set pixel multiplier if transcoder is eDP (Ville)
ver4: Macro name change to PIPE_MULT and default else pixel_multiplier

Cc Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |   13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index ad8179b..d428f7a 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _PIPE_MULT_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _PIPE_MULT_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2474,6 +2476,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULT(trans) _TRANSCODER2(trans, _PIPE_MULT_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +5 -0
index 858011d..617dad6 100644
@@ -4168,6 +4168,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	if (intel_crtc->config.cpu_transcoder != TRANSCODER_EDP) {
+		I915_WRITE(PIPE_MULT(intel_crtc->config.cpu_transcoder),
+				intel_crtc->config.pixel_multiplier - 1);
+	}
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7853,7 +7858,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 7867

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +7 -1
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
-	pipe_config->pixel_multiplier = 1;
+	if (pipe_config->cpu_transcoder != TRANSCODER_EDP) {
+		pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULT(pipe_config->cpu_transcoder)) + 1;
+	}
+	else {
+		pipe_config->pixel_multiplier = 1;
+	}

A bit too many curly braces for my taste but maybe that's just me. In any case looks like it will DTRT so:

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	return true;
 }
Signature · 1 line
1.7.9.5
Signature · 2 lines
Ville Syrjälä
Intel OTC
#17 lore raw
Quoted 71 lines · Ville Syrjälä
Quoted 70 lines · On Tue, Sep 30, 2014 at 10:30:22AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

Haswell and later silicon has added a new pixel replication register to the pipe timings for each transcoder. Now in addition to the DPLL_A_MD register for the pixel clock double, we also need to write to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing to the DPLL only double the pixel clock.

ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
ver3: Do not set pixel multiplier if transcoder is eDP (Ville)
ver4: Macro name change to PIPE_MULT and default else pixel_multiplier

Cc Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |   13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index ad8179b..d428f7a 100644
@@ -2443,6 +2443,7 @@ enum punit_power_well {
 #define _PIPEASRC	0x6001c
 #define _BCLRPAT_A	0x60020
 #define _VSYNCSHIFT_A	0x60028
+#define _PIPE_MULT_A	0x6002c
 
 /* Pipe B timing regs */
 #define _HTOTAL_B	0x61000
@@ -2454,6 +2455,7 @@ enum punit_power_well {
 #define _PIPEBSRC	0x6101c
 #define _BCLRPAT_B	0x61020
 #define _VSYNCSHIFT_B	0x61028
+#define _PIPE_MULT_B	0x6102c
 
 #define TRANSCODER_A_OFFSET 0x60000
 #define TRANSCODER_B_OFFSET 0x61000
@@ -2474,6 +2476,7 @@ enum punit_power_well {
 #define BCLRPAT(trans) _TRANSCODER2(trans, _BCLRPAT_A)
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
+#define PIPE_MULT(trans) _TRANSCODER2(trans, _PIPE_MULT_A)
 
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
drivers/gpu/drm/i915/intel_display.c +5 -0
index 858011d..617dad6 100644
@@ -4168,6 +4168,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 
 	intel_set_pipe_timings(intel_crtc);
 
+	if (intel_crtc->config.cpu_transcoder != TRANSCODER_EDP) {
+		I915_WRITE(PIPE_MULT(intel_crtc->config.cpu_transcoder),
+				intel_crtc->config.pixel_multiplier - 1);
+	}
+
 	if (intel_crtc->config.has_pch_encoder) {
 		intel_cpu_transcoder_set_m_n(intel_crtc,
 				     &intel_crtc->config.fdi_m_n, NULL);
@@ -7853,7 +7858,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&
 			(I915_READ(IPS_CTL) & IPS_ENABLE);
 
Quoted 11 lines

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 7867

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +7 -1
-	pipe_config->pixel_multiplier = 1;
+	if (pipe_config->cpu_transcoder != TRANSCODER_EDP) {
+		pipe_config->pixel_multiplier =
+			I915_READ(PIPE_MULT(pipe_config->cpu_transcoder)) + 1;
+	}
+	else {
+		pipe_config->pixel_multiplier = 1;
+	}

A bit too many curly braces for my taste but maybe that's just me. In any case looks like it will DTRT so:

Checkpatch actually complained about the misaligned in the first hunk and about the } on a line of its own. And with proper kernel coding style braces are allowed on single-statement multi-line blocks and should be applied to all blocks of an if statement if one has them. So it's totally ok.

Quoted 1 line

Queued for -next-fixes, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch