Skip to contentSkip to conversation

drm/i915: fastboot support for HSW and BDW

PATCH In review Jesse Barnes 2 participants 4 messages Jan 9, 2014 – Jan 14, 2014

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

PATCH 1/1 drm/i915: fastboot support for HSW and BDW

No idea if this is correct or not, all the WRPLL programming is new to me. Paulo, can you take a look? At least it doesn't complain on my BDW here...

Thanks,
Jesse

---
 drivers/gpu/drm/i915/i915_reg.h      |  6 ++++
 drivers/gpu/drm/i915/intel_ddi.c     |  2 +-
 drivers/gpu/drm/i915/intel_display.c | 61 ++++++++++++++++++++++++++++++++++--
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 4 files changed, 67 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +6 -0
index a699efd..644e4f9 100644
@@ -5318,8 +5318,13 @@
 #define  WRPLL_PLL_SELECT_LCPLL_2700	(0x03<<28)
 /* WRPLL divider programming */
 #define  WRPLL_DIVIDER_REFERENCE(x)	((x)<<0)
+#define  WRPLL_DIVIDER_REF_MASK		(0xff)
 #define  WRPLL_DIVIDER_POST(x)		((x)<<8)
+#define  WRPLL_DIVIDER_POST_MASK	(0x3f<<8)
+#define  WRPLL_DIVIDER_POST_SHIFT	8
 #define  WRPLL_DIVIDER_FEEDBACK(x)	((x)<<16)
+#define  WRPLL_DIVIDER_FB_SHIFT		16
+#define  WRPLL_DIVIDER_FB_MASK		(0xff<<16)
 
 /* Port clock selection */
 #define PORT_CLK_SEL_A			0x46100
@@ -5332,6 +5337,7 @@
 #define  PORT_CLK_SEL_WRPLL1		(4<<29)
 #define  PORT_CLK_SEL_WRPLL2		(5<<29)
 #define  PORT_CLK_SEL_NONE		(7<<29)
+#define  PORT_CLK_SEL_MASK		(7<<29)
 
 /* Transcoder clock selection */
 #define TRANS_CLK_SEL_A			0x46140
drivers/gpu/drm/i915/intel_ddi.c +1 -1
index 1488b28..f3d7b42 100644
@@ -413,7 +413,7 @@ static void intel_ddi_mode_set(struct intel_encoder *encoder)
 	}
 }
 
-static struct intel_encoder *
+struct intel_encoder *
 intel_ddi_get_crtc_encoder(struct drm_crtc *crtc)
 {
 	struct drm_device *dev = crtc->dev;
drivers/gpu/drm/i915/intel_display.c +59 -2

81 lines not on this page · raw message

drivers/gpu/drm/i915/intel_drv.h +1 -0
index 46aea6c..7bfc19a 100644
@@ -604,6 +604,7 @@ void intel_prepare_ddi(struct drm_device *dev);
 void hsw_fdi_link_train(struct drm_crtc *crtc);
 void intel_ddi_init(struct drm_device *dev, enum port port);
 enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder);
+struct intel_encoder *intel_ddi_get_crtc_encoder(struct drm_crtc *crtc);
 bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
 int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv);
 void intel_ddi_pll_init(struct drm_device *dev);
Signature · 1 line
1.8.3.2
#1 lore raw

2014/1/8 Jesse Barnes <[email protected]>:

Quoted 3 lines

No idea if this is correct or not, all the WRPLL programming is new to me. Paulo, can you take a look? At least it doesn't complain on my BDW here...

As a side note: can't we add some debugfs interface that, when read, would trigger a HW state readout, and then would compare it against what we have? It would be the perfect thing to validate patches like the one you wrote... And it would make QA easier (just write a test case that sets modes and reads the debugfs interface! Or just modify kms_setmode/testdisplay to do it everywhere).

Some comments:

- I guess the commit message could be improved :)
- We probably need to do something about the VGA output, which uses the old intel_crt encoder instead of intel_digital_port. If this patch doesn't regress anything, we could do it on a separate patch.
- Don't we also need to patch intel_pipe_config_compare() so it checks the now-used adjusted_mode.crtc_clock?
- Based on that, don't we also need HW readout support for port_clock?
- You should probably compare your patch against "[PATCH 2/2] drm/i915: add fast boot support for Haswell" sent by Furquan Shaikh in August, and also check the reviews we gave to it.
- I tried booting it on my HSW machine that only has an eDP output, and the driver doesn't load:

I get:

[   62.635700] WARNING: CPU: 0 PID: 1120 at
drivers/gpu/drm/i915/intel_ddi.c:431
intel_ddi_get_crtc_encoder+0x95/0xa0 [i915]()
[   62.635703] 0 encoders on crtc for pipe A

Then later I see:

[   62.636200] kernel BUG at drivers/gpu/drm/i915/intel_ddi.c:433!
[   62.636249] invalid opcode: 0000 [#1] SMP

Which is the "BUG_ON(ret == NULL);" line

Please notice that I'm not using the i915_fastboot command line argument.

More below:

Quoted 63 lines

Thanks,
Jesse

---
 drivers/gpu/drm/i915/i915_reg.h      |  6 ++++
 drivers/gpu/drm/i915/intel_ddi.c     |  2 +-
 drivers/gpu/drm/i915/intel_display.c | 61 ++++++++++++++++++++++++++++++++++--
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 4 files changed, 67 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +6 -0
index a699efd..644e4f9 100644
@@ -5318,8 +5318,13 @@
 #define  WRPLL_PLL_SELECT_LCPLL_2700   (0x03<<28)
 /* WRPLL divider programming */
 #define  WRPLL_DIVIDER_REFERENCE(x)    ((x)<<0)
+#define  WRPLL_DIVIDER_REF_MASK                (0xff)
 #define  WRPLL_DIVIDER_POST(x)         ((x)<<8)
+#define  WRPLL_DIVIDER_POST_MASK       (0x3f<<8)
+#define  WRPLL_DIVIDER_POST_SHIFT      8
 #define  WRPLL_DIVIDER_FEEDBACK(x)     ((x)<<16)
+#define  WRPLL_DIVIDER_FB_SHIFT                16
+#define  WRPLL_DIVIDER_FB_MASK         (0xff<<16)
 
 /* Port clock selection */
 #define PORT_CLK_SEL_A                 0x46100
@@ -5332,6 +5337,7 @@
 #define  PORT_CLK_SEL_WRPLL1           (4<<29)
 #define  PORT_CLK_SEL_WRPLL2           (5<<29)
 #define  PORT_CLK_SEL_NONE             (7<<29)
+#define  PORT_CLK_SEL_MASK             (7<<29)
 
 /* Transcoder clock selection */
 #define TRANS_CLK_SEL_A                        0x46140
drivers/gpu/drm/i915/intel_ddi.c +1 -1
index 1488b28..f3d7b42 100644
@@ -413,7 +413,7 @@ static void intel_ddi_mode_set(struct intel_encoder *encoder)
        }
 }
 
-static struct intel_encoder *
+struct intel_encoder *
 intel_ddi_get_crtc_encoder(struct drm_crtc *crtc)
 {
        struct drm_device *dev = crtc->dev;
drivers/gpu/drm/i915/intel_display.c +2 -0
index 74137d5..f87244d 100644
@@ -48,6 +48,8 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
                                struct intel_crtc_config *pipe_config);
 static void ironlake_pch_clock_get(struct intel_crtc *crtc,
                                   struct intel_crtc_config *pipe_config);
+static void haswell_ddi_clock_get(struct intel_crtc *crtc,
+                                 struct intel_crtc_config *pipe_config);
 
 static int intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
                          int x, int y, struct drm_framebuffer *old_fb);

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

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +1 -2
@@ -6994,10 +6996,11 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
                tmp = I915_READ(FDI_RX_CTL(PIPE_A));
                pipe_config->fdi_lanes = ((FDI_DP_PORT_WIDTH_MASK & tmp) >>
                                          FDI_DP_PORT_WIDTH_SHIFT) + 1;
-
-               ironlake_get_fdi_m_n_config(crtc, pipe_config);
        }
 
+       ironlake_get_fdi_m_n_config(crtc, pipe_config);

This is a little confusing, probably wrong, because FDI is only used when has_pch_encoder is true, but you're calling this code on all cases.

Function ironlake_get_fdi_m_n_config() calls intel_cpu_transcoder_get_m_n() for eDP/DP/HDMI.
However, we have encoder->get_config which calls intel_ddi_get_config() which calls intel_dp_get_m_n(), which will call intel_cpu_transcoder_get_m_n() again on the same cases. So we call the same thing twice.

I would imagine you probably don't need to move this line above, but I may be wrong. If something is wrong, you probably need to fix some other code that's assuming that "gen5+ DP m/n registers are on the PCH" or something like that.

Quoted 81 lines
drivers/gpu/drm/i915/intel_display.c +56 -0
+       haswell_ddi_clock_get(crtc, pipe_config);
+
        intel_get_pipe_timings(crtc, pipe_config);
 
        pfit_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
@@ -8034,6 +8037,60 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc,
                                         &pipe_config->fdi_m_n);
 }
 
+#define LC_FREQ 2700
+
+static int intel_ddi_calc_wrpll_link(u32 wrpll)
+{
+       int n, p, r;
+
+       r = wrpll & WRPLL_DIVIDER_REF_MASK;
+       p = (wrpll & WRPLL_DIVIDER_POST_MASK) >> WRPLL_DIVIDER_POST_SHIFT;
+       n = (wrpll & WRPLL_DIVIDER_FB_MASK) >> WRPLL_DIVIDER_FB_SHIFT;
+
+       return (LC_FREQ * n) / (p * r);
+}
+
+static void haswell_ddi_clock_get(struct intel_crtc *crtc,
+                                 struct intel_crtc_config *pipe_config)
+{
+       struct intel_encoder *intel_encoder =
+               intel_ddi_get_crtc_encoder(&crtc->base);
+       struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
+       enum port port = intel_ddi_get_encoder_port(intel_encoder);
+       int link_clock;
+       u32 val, pll;
+
+       val = I915_READ(PORT_CLK_SEL(port));
+       switch (val & PORT_CLK_SEL_MASK) {
+       case PORT_CLK_SEL_LCPLL_810:
+               link_clock = 81000;
+               break;
+       case PORT_CLK_SEL_LCPLL_1350:
+               link_clock = 135000;
+               break;
+       case PORT_CLK_SEL_LCPLL_2700:
+               link_clock = 270000;
+               break;
+       case PORT_CLK_SEL_WRPLL1:
+               pll = I915_READ(WRPLL_CTL1);
+               link_clock = intel_ddi_calc_wrpll_link(pll);
+               break;
+       case PORT_CLK_SEL_WRPLL2:
+               pll = I915_READ(WRPLL_CTL2);
+               link_clock = intel_ddi_calc_wrpll_link(pll);
+               break;
+       case PORT_CLK_SEL_SPLL:
+               link_clock = 135000;
+               break;
+       default:
+               WARN(1, "bad port clock sel\n");
+               return;
+       }
+
+       pipe_config->adjusted_mode.crtc_clock =
+               intel_dotclock_calculate(link_clock, &pipe_config->fdi_m_n);
+}
+
 /** Returns the currently programmed mode of the given pipe. */
 struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
                                             struct drm_crtc *crtc)
drivers/gpu/drm/i915/intel_drv.h +1 -1
index 46aea6c..7bfc19a 100644
@@ -604,6 +604,7 @@ void intel_prepare_ddi(struct drm_device *dev);
 void hsw_fdi_link_train(struct drm_crtc *crtc);
 void intel_ddi_init(struct drm_device *dev, enum port port);
 enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder);
+struct intel_encoder *intel_ddi_get_crtc_encoder(struct drm_crtc *crtc);
 bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
 int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv);
 void intel_ddi_pll_init(struct drm_device *dev);
--

1.8.3.2

Signature · 1 line
Paulo Zanoni
#2 lore raw
Quoted 205 lines · On Mon, 13 Jan 2014 17:55:27 -0200 Paulo Zanoni <[email protected]> wrote:

2014/1/8 Jesse Barnes <[email protected]>:

Quoted 3 lines

No idea if this is correct or not, all the WRPLL programming is new to me. Paulo, can you take a look? At least it doesn't complain on my BDW here...

As a side note: can't we add some debugfs interface that, when read, would trigger a HW state readout, and then would compare it against what we have? It would be the perfect thing to validate patches like the one you wrote... And it would make QA easier (just write a test case that sets modes and reads the debugfs interface! Or just modify kms_setmode/testdisplay to do it everywhere).

Some comments:

- I guess the commit message could be improved :)
- We probably need to do something about the VGA output, which uses the old intel_crt encoder instead of intel_digital_port. If this patch doesn't regress anything, we could do it on a separate patch.
- Don't we also need to patch intel_pipe_config_compare() so it checks the now-used adjusted_mode.crtc_clock?
- Based on that, don't we also need HW readout support for port_clock?
- You should probably compare your patch against "[PATCH 2/2] drm/i915: add fast boot support for Haswell" sent by Furquan Shaikh in August, and also check the reviews we gave to it.
- I tried booting it on my HSW machine that only has an eDP output, and the driver doesn't load:

I get:

[   62.635700] WARNING: CPU: 0 PID: 1120 at
drivers/gpu/drm/i915/intel_ddi.c:431
intel_ddi_get_crtc_encoder+0x95/0xa0 [i915]()
[   62.635703] 0 encoders on crtc for pipe A

Then later I see:

[   62.636200] kernel BUG at drivers/gpu/drm/i915/intel_ddi.c:433!
[   62.636249] invalid opcode: 0000 [#1] SMP

Which is the "BUG_ON(ret == NULL);" line

Please notice that I'm not using the i915_fastboot command line argument.

More below:

Quoted 63 lines

Thanks,
Jesse

---
 drivers/gpu/drm/i915/i915_reg.h      |  6 ++++
 drivers/gpu/drm/i915/intel_ddi.c     |  2 +-
 drivers/gpu/drm/i915/intel_display.c | 61 ++++++++++++++++++++++++++++++++++--
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 4 files changed, 67 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +6 -0
index a699efd..644e4f9 100644
@@ -5318,8 +5318,13 @@
 #define  WRPLL_PLL_SELECT_LCPLL_2700   (0x03<<28)
 /* WRPLL divider programming */
 #define  WRPLL_DIVIDER_REFERENCE(x)    ((x)<<0)
+#define  WRPLL_DIVIDER_REF_MASK                (0xff)
 #define  WRPLL_DIVIDER_POST(x)         ((x)<<8)
+#define  WRPLL_DIVIDER_POST_MASK       (0x3f<<8)
+#define  WRPLL_DIVIDER_POST_SHIFT      8
 #define  WRPLL_DIVIDER_FEEDBACK(x)     ((x)<<16)
+#define  WRPLL_DIVIDER_FB_SHIFT                16
+#define  WRPLL_DIVIDER_FB_MASK         (0xff<<16)
 
 /* Port clock selection */
 #define PORT_CLK_SEL_A                 0x46100
@@ -5332,6 +5337,7 @@
 #define  PORT_CLK_SEL_WRPLL1           (4<<29)
 #define  PORT_CLK_SEL_WRPLL2           (5<<29)
 #define  PORT_CLK_SEL_NONE             (7<<29)
+#define  PORT_CLK_SEL_MASK             (7<<29)
 
 /* Transcoder clock selection */
 #define TRANS_CLK_SEL_A                        0x46140
drivers/gpu/drm/i915/intel_ddi.c +1 -1
index 1488b28..f3d7b42 100644
@@ -413,7 +413,7 @@ static void intel_ddi_mode_set(struct intel_encoder *encoder)
        }
 }
 
-static struct intel_encoder *
+struct intel_encoder *
 intel_ddi_get_crtc_encoder(struct drm_crtc *crtc)
 {
        struct drm_device *dev = crtc->dev;
drivers/gpu/drm/i915/intel_display.c +2 -0
index 74137d5..f87244d 100644
@@ -48,6 +48,8 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
                                struct intel_crtc_config *pipe_config);
 static void ironlake_pch_clock_get(struct intel_crtc *crtc,
                                   struct intel_crtc_config *pipe_config);
+static void haswell_ddi_clock_get(struct intel_crtc *crtc,
+                                 struct intel_crtc_config *pipe_config);
 
 static int intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
                          int x, int y, struct drm_framebuffer *old_fb);

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

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +1 -2
@@ -6994,10 +6996,11 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
                tmp = I915_READ(FDI_RX_CTL(PIPE_A));
                pipe_config->fdi_lanes = ((FDI_DP_PORT_WIDTH_MASK & tmp) >>
                                          FDI_DP_PORT_WIDTH_SHIFT) + 1;
-
-               ironlake_get_fdi_m_n_config(crtc, pipe_config);
        }
 
+       ironlake_get_fdi_m_n_config(crtc, pipe_config);

This is a little confusing, probably wrong, because FDI is only used when has_pch_encoder is true, but you're calling this code on all cases.

Function ironlake_get_fdi_m_n_config() calls intel_cpu_transcoder_get_m_n() for eDP/DP/HDMI.
However, we have encoder->get_config which calls intel_ddi_get_config() which calls intel_dp_get_m_n(), which will call intel_cpu_transcoder_get_m_n() again on the same cases. So we call the same thing twice.

I would imagine you probably don't need to move this line above, but I may be wrong. If something is wrong, you probably need to fix some other code that's assuming that "gen5+ DP m/n registers are on the PCH" or something like that.

Quoted 71 lines
drivers/gpu/drm/i915/intel_display.c +56 -0
+       haswell_ddi_clock_get(crtc, pipe_config);
+
        intel_get_pipe_timings(crtc, pipe_config);
 
        pfit_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
@@ -8034,6 +8037,60 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc,
                                         &pipe_config->fdi_m_n);
 }
 
+#define LC_FREQ 2700
+
+static int intel_ddi_calc_wrpll_link(u32 wrpll)
+{
+       int n, p, r;
+
+       r = wrpll & WRPLL_DIVIDER_REF_MASK;
+       p = (wrpll & WRPLL_DIVIDER_POST_MASK) >> WRPLL_DIVIDER_POST_SHIFT;
+       n = (wrpll & WRPLL_DIVIDER_FB_MASK) >> WRPLL_DIVIDER_FB_SHIFT;
+
+       return (LC_FREQ * n) / (p * r);
+}
+
+static void haswell_ddi_clock_get(struct intel_crtc *crtc,
+                                 struct intel_crtc_config *pipe_config)
+{
+       struct intel_encoder *intel_encoder =
+               intel_ddi_get_crtc_encoder(&crtc->base);
+       struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
+       enum port port = intel_ddi_get_encoder_port(intel_encoder);
+       int link_clock;
+       u32 val, pll;
+
+       val = I915_READ(PORT_CLK_SEL(port));
+       switch (val & PORT_CLK_SEL_MASK) {
+       case PORT_CLK_SEL_LCPLL_810:
+               link_clock = 81000;
+               break;
+       case PORT_CLK_SEL_LCPLL_1350:
+               link_clock = 135000;
+               break;
+       case PORT_CLK_SEL_LCPLL_2700:
+               link_clock = 270000;
+               break;
+       case PORT_CLK_SEL_WRPLL1:
+               pll = I915_READ(WRPLL_CTL1);
+               link_clock = intel_ddi_calc_wrpll_link(pll);
+               break;
+       case PORT_CLK_SEL_WRPLL2:
+               pll = I915_READ(WRPLL_CTL2);
+               link_clock = intel_ddi_calc_wrpll_link(pll);
+               break;
+       case PORT_CLK_SEL_SPLL:
+               link_clock = 135000;
+               break;
+       default:
+               WARN(1, "bad port clock sel\n");
+               return;
+       }
+
+       pipe_config->adjusted_mode.crtc_clock =
+               intel_dotclock_calculate(link_clock, &pipe_config->fdi_m_n);
+}
+
 /** Returns the currently programmed mode of the given pipe. */
 struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
                                             struct drm_crtc *crtc)
drivers/gpu/drm/i915/intel_drv.h +0 -0
index 46aea6c..7bfc19a 100644
@@ -604,6 +604,7 @@ void intel_prepare_ddi(struct drm_device *dev);
Quoted 8 lines

drivers/gpu/drm/i915/intel_drv.h void intel_prepare_ddi(struct drm_device *dev);

Quoted 8 lines
drivers/gpu/drm/i915/intel_drv.h +1 -1
 void hsw_fdi_link_train(struct drm_crtc *crtc);
 void intel_ddi_init(struct drm_device *dev, enum port port);
 enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder);
+struct intel_encoder *intel_ddi_get_crtc_encoder(struct drm_crtc *crtc);
 bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
 int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv);
 void intel_ddi_pll_init(struct drm_device *dev);
--

Ok, I only tried it on BDW, I'll check again w/o the fastboot param and see what happens.

Agree on the other points.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#3 lore raw
In reply to Paulo Zanoni
Quoted 12 lines · On Mon, 13 Jan 2014 17:55:27 -0200 Paulo Zanoni <[email protected]> wrote:

2014/1/8 Jesse Barnes <[email protected]>:

Quoted 3 lines

No idea if this is correct or not, all the WRPLL programming is new to me. Paulo, can you take a look? At least it doesn't complain on my BDW here...

As a side note: can't we add some debugfs interface that, when read, would trigger a HW state readout, and then would compare it against what we have? It would be the perfect thing to validate patches like the one you wrote... And it would make QA easier (just write a test case that sets modes and reads the debugfs interface! Or just modify kms_setmode/testdisplay to do it everywhere).

Quoted 6 lines

Some comments:

- I guess the commit message could be improved :)
- We probably need to do something about the VGA output, which uses the old intel_crt encoder instead of intel_digital_port. If this patch doesn't regress anything, we could do it on a separate patch.

I'm not using intel_digital_port here though, or is that what ddi_get_encoder_port needs? If so then yeah I guess I'll need to add specific VGA support somehow.

Quoted 2 lines

- Don't we also need to patch intel_pipe_config_compare() so it checks the now-used adjusted_mode.crtc_clock?

Yeah, it's there, just needs to come out from under its !HAS_DDI rock.

Quoted 1 line

- Based on that, don't we also need HW readout support for port_clock?

Ah yeah that needs to be set too.

Quoted 3 lines

- You should probably compare your patch against "[PATCH 2/2] drm/i915: add fast boot support for Haswell" sent by Furquan Shaikh in August, and also check the reviews we gave to it.

Just checked (I had totally forgotten that), I think his version is a little nicer, but I didn't see an update.

Furquan, were you planning to re-submit for inclusion?

Quoted 9 lines

- I tried booting it on my HSW machine that only has an eDP output, and the driver doesn't load:

I get:

[   62.635700] WARNING: CPU: 0 PID: 1120 at
drivers/gpu/drm/i915/intel_ddi.c:431
intel_ddi_get_crtc_encoder+0x95/0xa0 [i915]()
[   62.635703] 0 encoders on crtc for pipe A

Hm what would cause that? Why would we not have an encoder assigned?

Quoted 19 lines

Then later I see:

[   62.636200] kernel BUG at drivers/gpu/drm/i915/intel_ddi.c:433!
[   62.636249] invalid opcode: 0000 [#1] SMP

Which is the "BUG_ON(ret == NULL);" line

Please notice that I'm not using the i915_fastboot command line argument.

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

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -2
-
-               ironlake_get_fdi_m_n_config(crtc, pipe_config);
        }
 
+       ironlake_get_fdi_m_n_config(crtc, pipe_config);

This is a little confusing, probably wrong, because FDI is only used when has_pch_encoder is true, but you're calling this code on all cases.

Quoted 6 lines

Function ironlake_get_fdi_m_n_config() calls intel_cpu_transcoder_get_m_n() for eDP/DP/HDMI.
However, we have encoder->get_config which calls intel_ddi_get_config() which calls intel_dp_get_m_n(), which will call intel_cpu_transcoder_get_m_n() again on the same cases. So we call the same thing twice.

Confusing I agree, but I think we set the CPU m/n values for eDP/DP/HDMI on HSW+? If so, we need these values to figure out the actual mode clock. I think the redundant call is ok, but I'll check other platforms.

Quoted 4 lines

I would imagine you probably don't need to move this line above, but I may be wrong. If something is wrong, you probably need to fix some other code that's assuming that "gen5+ DP m/n registers are on the PCH" or something like that.

We mainly need to get the values early on to calculate the pixel clock, so maybe the later call can be dropped.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center