intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook
@ 2018-08-01  0:30 Manasi Navare
  2018-08-01  1:05 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2018-08-13 19:38 ` [PATCH] " Souza, Jose
  0 siblings, 2 replies; 4+ messages in thread
From: Manasi Navare @ 2018-08-01  0:30 UTC (permalink / raw)
  To: intel-gfx; +Cc: Paulo Zanoni

In case of Legacy DP connector on TypeC port (C, D, E or F), the
flex IO DPMLE register is set to maximum number of lanes since
there is no muxing with other controllers in this case.
While in case of the TypeC connector, it is set to the lane count
obained from DFLEXDPSP register.
This needs to be programmed before enabling the shared PLLs hence
add a pre_pll_enable hook for ICL and add this programming in that hook.

v3:
* Call intel_dp_max_common_lane_count that gets lane count
common between sink, source, fia
v2:
* Add pre pll enable hook and move dflexdpmle programming
to that hook (Animesh)

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 18 ++++++++++++++++++
 drivers/gpu/drm/i915/intel_dp.c  | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 3 files changed, 39 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 0adc043..eb00ac4 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -3193,6 +3193,22 @@ static void bxt_ddi_pre_pll_enable(struct intel_encoder *encoder,
 	bxt_ddi_phy_set_lane_optim_mask(encoder, mask);
 }
 
+static void icl_ddi_pre_pll_enable(struct intel_encoder *encoder,
+				   const struct intel_crtc_state *pipe_config,
+				   const struct drm_connector_state *conn_state)
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
+	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+	struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
+	enum tc_port tc_port = intel_port_to_tc(dev_priv,
+						intel_dig_port->base.port);
+
+	if (tc_port == PORT_TC_NONE || intel_dig_port->tc_type == TC_PORT_TBT)
+		return;
+
+	intel_dp_set_fia_lane_count(intel_dp);
+}
+
 void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
 {
 	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
@@ -3709,6 +3725,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 	intel_encoder->enable = intel_enable_ddi;
 	if (IS_GEN9_LP(dev_priv))
 		intel_encoder->pre_pll_enable = bxt_ddi_pre_pll_enable;
+	if (IS_ICELAKE(dev_priv))
+		intel_encoder->pre_pll_enable = icl_ddi_pre_pll_enable;
 	intel_encoder->pre_enable = intel_ddi_pre_enable;
 	intel_encoder->disable = intel_disable_ddi;
 	intel_encoder->post_disable = intel_ddi_post_disable;
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 49a3149..6683cdc 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2127,6 +2127,26 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
 	intel_dp->link_mst = link_mst;
 }
 
+void intel_dp_set_fia_lane_count(struct intel_dp *intel_dp)
+{
+	struct drm_device *dev = intel_dp_to_dev(intel_dp);
+	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+	enum tc_port tc_port = intel_port_to_tc(dev_priv,
+						intel_dig_port->base.port);
+	u8 lane_count = intel_dp_max_common_lane_count(intel_dp);
+	u32 val;
+
+	/* In case of legacy/static DP over Type-C port there is no muxing
+	 * with other controllers so this is set to max lane count.
+	 * In case of Type_C it is set to the DFLEXDPSP.DPX4TXLATC value.
+	 */
+	val = I915_READ(PORT_TX_DFLEXDPMLE1);
+	val &= ~DFLEXDPMLE1_DPMLETC_MASK(tc_port);
+	val |= DFLEXDPMLE1_DPMLETC(tc_port, lane_count);
+	I915_WRITE(PORT_TX_DFLEXDPMLE1, val);
+}
+
 static void intel_dp_prepare(struct intel_encoder *encoder,
 			     const struct intel_crtc_state *pipe_config)
 {
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 1ad7c11..d98cdb9 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1676,6 +1676,7 @@ bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 void intel_dp_set_link_params(struct intel_dp *intel_dp,
 			      int link_rate, uint8_t lane_count,
 			      bool link_mst);
+void intel_dp_set_fia_lane_count(struct intel_dp *intel_dp);
 int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
 					    int link_rate, uint8_t lane_count);
 void intel_dp_start_link_train(struct intel_dp *intel_dp);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook
  2018-08-01  0:30 [PATCH] drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook Manasi Navare
@ 2018-08-01  1:05 ` Patchwork
  2018-08-13 19:38 ` [PATCH] " Souza, Jose
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-08-01  1:05 UTC (permalink / raw)
  To: Manasi Navare; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook
URL   : https://patchwork.freedesktop.org/series/47519/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4600 -> Patchwork_9827 =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_9827 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_9827, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/47519/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_9827:

  === IGT changes ===

    ==== Possible regressions ====

    igt@gem_ringfill@basic-default-hang:
      fi-elk-e7500:       PASS -> DMESG-WARN

    
== Known issues ==

  Here are the changes found in Patchwork_9827 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_guc:
      fi-skl-guc:         NOTRUN -> DMESG-WARN (fdo#107175, fdo#107258)

    igt@drv_selftest@live_hangcheck:
      fi-bdw-5557u:       PASS -> DMESG-FAIL (fdo#106560)

    igt@drv_selftest@live_workarounds:
      fi-cnl-psr:         PASS -> DMESG-FAIL (fdo#107292)

    igt@kms_flip@basic-flip-vs-dpms:
      fi-skl-6700hq:      PASS -> DMESG-WARN (fdo#105998)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_hangcheck:
      fi-kbl-guc:         DMESG-FAIL (fdo#106947) -> PASS
      fi-skl-6260u:       DMESG-FAIL (fdo#107174, fdo#106560) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       DMESG-FAIL (fdo#106103, fdo#102614) -> PASS

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
      fi-skl-6700k2:      FAIL (fdo#103191) -> PASS

    
    ==== Warnings ====

    {igt@kms_psr@primary_page_flip}:
      fi-cnl-psr:         DMESG-FAIL (fdo#107372) -> DMESG-WARN (fdo#107372)

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#105998 https://bugs.freedesktop.org/show_bug.cgi?id=105998
  fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
  fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
  fdo#107175 https://bugs.freedesktop.org/show_bug.cgi?id=107175
  fdo#107258 https://bugs.freedesktop.org/show_bug.cgi?id=107258
  fdo#107292 https://bugs.freedesktop.org/show_bug.cgi?id=107292
  fdo#107372 https://bugs.freedesktop.org/show_bug.cgi?id=107372


== Participating hosts (48 -> 45) ==

  Additional (2): fi-skl-guc fi-glk-j4005 
  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-byt-clapper fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4600 -> Patchwork_9827

  CI_DRM_4600: 308427119c70d0aaa90433b05969a0317165b122 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4581: f1c868dae24056ebc27e4f3c197724ce9b956a8a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9827: e5529aa3662792da36e042b8676bcc5c227915f9 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

e5529aa36627 drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9827/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook
  2018-08-01  0:30 [PATCH] drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook Manasi Navare
  2018-08-01  1:05 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2018-08-13 19:38 ` Souza, Jose
  2018-08-13 22:12   ` Manasi Navare
  1 sibling, 1 reply; 4+ messages in thread
From: Souza, Jose @ 2018-08-13 19:38 UTC (permalink / raw)
  To: intel-gfx@lists.freedesktop.org, Navare, Manasi D; +Cc: Zanoni, Paulo R

On Tue, 2018-07-31 at 17:30 -0700, Manasi Navare wrote:
> In case of Legacy DP connector on TypeC port (C, D, E or F), the

Legacy DP connector(DisplayPort Alternative Mode)

> flex IO DPMLE register is set to maximum number of lanes since
> there is no muxing with other controllers in this case.

Okay there is no muxing but driver could choose to use few lanes do
save power.

> While in case of the TypeC connector, it is set to the lane count
> obained from DFLEXDPSP register.

obtained

> This needs to be programmed before enabling the shared PLLs hence
> add a pre_pll_enable hook for ICL and add this programming in that
> hook.
> 
> v3:
> * Call intel_dp_max_common_lane_count that gets lane count
> common between sink, source, fia
> v2:
> * Add pre pll enable hook and move dflexdpmle programming
> to that hook (Animesh)
> 
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Animesh Manna <animesh.manna@intel.com>
> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 18 ++++++++++++++++++
>  drivers/gpu/drm/i915/intel_dp.c  | 20 ++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_drv.h |  1 +
>  3 files changed, 39 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> b/drivers/gpu/drm/i915/intel_ddi.c
> index 0adc043..eb00ac4 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -3193,6 +3193,22 @@ static void bxt_ddi_pre_pll_enable(struct
> intel_encoder *encoder,
>  	bxt_ddi_phy_set_lane_optim_mask(encoder, mask);
>  }
>  
> +static void icl_ddi_pre_pll_enable(struct intel_encoder *encoder,
> +				   const struct intel_crtc_state
> *pipe_config,
> +				   const struct drm_connector_state
> *conn_state)
> +{
> +	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
> +	struct intel_digital_port *intel_dig_port =
> dp_to_dig_port(intel_dp);
> +	struct drm_i915_private *dev_priv = to_i915(intel_dig_port-
> >base.base.dev);
> +	enum tc_port tc_port = intel_port_to_tc(dev_priv,
> +						intel_dig_port-
> >base.port);
> +
> +	if (tc_port == PORT_TC_NONE || intel_dig_port->tc_type ==
> TC_PORT_TBT)
> +		return;
> +
> +	intel_dp_set_fia_lane_count(intel_dp);
> +}
> +
>  void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
>  {
>  	struct intel_digital_port *intel_dig_port =
> dp_to_dig_port(intel_dp);
> @@ -3709,6 +3725,8 @@ void intel_ddi_init(struct drm_i915_private
> *dev_priv, enum port port)
>  	intel_encoder->enable = intel_enable_ddi;
>  	if (IS_GEN9_LP(dev_priv))
>  		intel_encoder->pre_pll_enable = bxt_ddi_pre_pll_enable;
> +	if (IS_ICELAKE(dev_priv))
> +		intel_encoder->pre_pll_enable = icl_ddi_pre_pll_enable;

pre_pll_enable is set initialy in intel_crt_init() for most of the
gens, maybe those 4 lines should be moved there but that can be done in
another patch.

>  	intel_encoder->pre_enable = intel_ddi_pre_enable;
>  	intel_encoder->disable = intel_disable_ddi;
>  	intel_encoder->post_disable = intel_ddi_post_disable;
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index 49a3149..6683cdc 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2127,6 +2127,26 @@ void intel_dp_set_link_params(struct intel_dp
> *intel_dp,
>  	intel_dp->link_mst = link_mst;
>  }
>  
> +void intel_dp_set_fia_lane_count(struct intel_dp *intel_dp)
> +{
> +	struct drm_device *dev = intel_dp_to_dev(intel_dp);
> +	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct intel_digital_port *intel_dig_port =
> dp_to_dig_port(intel_dp);
> +	enum tc_port tc_port = intel_port_to_tc(dev_priv,
> +						intel_dig_port-
> >base.port);
> +	u8 lane_count = intel_dp_max_common_lane_count(intel_dp);

intel_dp->max_link_lane_count could be used instead as it is set on
hotplug and don't change over time.

But I guess this is also wrong, it should not enable the max lane
count, it should enable the number of the lanes that the driver decides
that is enough to the mode set to save power.

> +	u32 val;
> +
> +	/* In case of legacy/static DP over Type-C port there is no
> muxing
> +	 * with other controllers so this is set to max lane count.
> +	 * In case of Type_C it is set to the DFLEXDPSP.DPX4TXLATC
> value.
> +	 */
> +	val = I915_READ(PORT_TX_DFLEXDPMLE1);
> +	val &= ~DFLEXDPMLE1_DPMLETC_MASK(tc_port);
> +	val |= DFLEXDPMLE1_DPMLETC(tc_port, lane_count);

this macro is wrong, each bit set maps to a lane, so to enable all 4
lanes it should 0xf for the first TC.

From spec:

For example, in DP Pin Assignment C, the register
DFLEXDPSP1.DPX4TXLATC0 tells Display Driver that all the 4 TX Lane in
PHY can be used. However, Display Driver may choose to use only x1,
i.e. for ML0. Then Display Driver will program “0001b” to this
register. For x2 and x4, Display Driver will program “0011b” and
“1111b”, respectively.


> +	I915_WRITE(PORT_TX_DFLEXDPMLE1, val);
> +}
> +
>  static void intel_dp_prepare(struct intel_encoder *encoder,
>  			     const struct intel_crtc_state
> *pipe_config)
>  {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h
> b/drivers/gpu/drm/i915/intel_drv.h
> index 1ad7c11..d98cdb9 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1676,6 +1676,7 @@ bool intel_dp_init_connector(struct
> intel_digital_port *intel_dig_port,
>  void intel_dp_set_link_params(struct intel_dp *intel_dp,
>  			      int link_rate, uint8_t lane_count,
>  			      bool link_mst);
> +void intel_dp_set_fia_lane_count(struct intel_dp *intel_dp);
>  int intel_dp_get_link_train_fallback_values(struct intel_dp
> *intel_dp,
>  					    int link_rate, uint8_t
> lane_count);
>  void intel_dp_start_link_train(struct intel_dp *intel_dp);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook
  2018-08-13 19:38 ` [PATCH] " Souza, Jose
@ 2018-08-13 22:12   ` Manasi Navare
  0 siblings, 0 replies; 4+ messages in thread
From: Manasi Navare @ 2018-08-13 22:12 UTC (permalink / raw)
  To: Souza, Jose; +Cc: intel-gfx@lists.freedesktop.org, Zanoni, Paulo R

On Mon, Aug 13, 2018 at 12:38:00PM -0700, Souza, Jose wrote:
> On Tue, 2018-07-31 at 17:30 -0700, Manasi Navare wrote:
> > In case of Legacy DP connector on TypeC port (C, D, E or F), the
> 
> Legacy DP connector(DisplayPort Alternative Mode)

Ok will reword this as DisplayPort Alternative Mode

> 
> > flex IO DPMLE register is set to maximum number of lanes since
> > there is no muxing with other controllers in this case.
> 
> Okay there is no muxing but driver could choose to use few lanes do
> save power.
> 
> > While in case of the TypeC connector, it is set to the lane count
> > obained from DFLEXDPSP register.
> 
> obtained
> 
> > This needs to be programmed before enabling the shared PLLs hence
> > add a pre_pll_enable hook for ICL and add this programming in that
> > hook.
> > 
> > v3:
> > * Call intel_dp_max_common_lane_count that gets lane count
> > common between sink, source, fia
> > v2:
> > * Add pre pll enable hook and move dflexdpmle programming
> > to that hook (Animesh)
> > 
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Animesh Manna <animesh.manna@intel.com>
> > Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> > Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_ddi.c | 18 ++++++++++++++++++
> >  drivers/gpu/drm/i915/intel_dp.c  | 20 ++++++++++++++++++++
> >  drivers/gpu/drm/i915/intel_drv.h |  1 +
> >  3 files changed, 39 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> > b/drivers/gpu/drm/i915/intel_ddi.c
> > index 0adc043..eb00ac4 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -3193,6 +3193,22 @@ static void bxt_ddi_pre_pll_enable(struct
> > intel_encoder *encoder,
> >  	bxt_ddi_phy_set_lane_optim_mask(encoder, mask);
> >  }
> >  
> > +static void icl_ddi_pre_pll_enable(struct intel_encoder *encoder,
> > +				   const struct intel_crtc_state
> > *pipe_config,
> > +				   const struct drm_connector_state
> > *conn_state)
> > +{
> > +	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
> > +	struct intel_digital_port *intel_dig_port =
> > dp_to_dig_port(intel_dp);
> > +	struct drm_i915_private *dev_priv = to_i915(intel_dig_port-
> > >base.base.dev);
> > +	enum tc_port tc_port = intel_port_to_tc(dev_priv,
> > +						intel_dig_port-
> > >base.port);
> > +
> > +	if (tc_port == PORT_TC_NONE || intel_dig_port->tc_type ==
> > TC_PORT_TBT)
> > +		return;
> > +
> > +	intel_dp_set_fia_lane_count(intel_dp);
> > +}
> > +
> >  void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
> >  {
> >  	struct intel_digital_port *intel_dig_port =
> > dp_to_dig_port(intel_dp);
> > @@ -3709,6 +3725,8 @@ void intel_ddi_init(struct drm_i915_private
> > *dev_priv, enum port port)
> >  	intel_encoder->enable = intel_enable_ddi;
> >  	if (IS_GEN9_LP(dev_priv))
> >  		intel_encoder->pre_pll_enable = bxt_ddi_pre_pll_enable;
> > +	if (IS_ICELAKE(dev_priv))
> > +		intel_encoder->pre_pll_enable = icl_ddi_pre_pll_enable;
> 
> pre_pll_enable is set initialy in intel_crt_init() for most of the
> gens, maybe those 4 lines should be moved there but that can be done in
> another patch.

I think the crt_init() only has thecrt specific functions for DDI platforms
like hsw_crt_compute_config() hsw_enable_crt() etc, all the other ddi function pointers
are assigned in intel_ddi_init()

> 
> >  	intel_encoder->pre_enable = intel_ddi_pre_enable;
> >  	intel_encoder->disable = intel_disable_ddi;
> >  	intel_encoder->post_disable = intel_ddi_post_disable;
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c
> > b/drivers/gpu/drm/i915/intel_dp.c
> > index 49a3149..6683cdc 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -2127,6 +2127,26 @@ void intel_dp_set_link_params(struct intel_dp
> > *intel_dp,
> >  	intel_dp->link_mst = link_mst;
> >  }
> >  
> > +void intel_dp_set_fia_lane_count(struct intel_dp *intel_dp)
> > +{
> > +	struct drm_device *dev = intel_dp_to_dev(intel_dp);
> > +	struct drm_i915_private *dev_priv = to_i915(dev);
> > +	struct intel_digital_port *intel_dig_port =
> > dp_to_dig_port(intel_dp);
> > +	enum tc_port tc_port = intel_port_to_tc(dev_priv,
> > +						intel_dig_port-
> > >base.port);
> > +	u8 lane_count = intel_dp_max_common_lane_count(intel_dp);
> 
> intel_dp->max_link_lane_count could be used instead as it is set on
> hotplug and don't change over time.
> 
> But I guess this is also wrong, it should not enable the max lane
> count, it should enable the number of the lanes that the driver decides
> that is enough to the mode set to save power.

So I should be using crtc_state->lane_count here because thats what is the optimum
lane count computed in intel_dp_compute_config() for legacy DP connector.

In case of Type-C connector also, DFLEXDPSP only has the max lane count but the enable sequence
says:

"Dynamic - Program the number of lanes as per DFLEXDPSP.DPX4TXLATC*"
Also really the statement in the enable sequence "Program DFLEXDPMLE.DPMLETC* to maximum number of lanes allowed as determined by FIA and panel lane count." 
This makes it confusing as to whether we should set this to max or just the optimum required for the mode.


> 
> > +	u32 val;
> > +
> > +	/* In case of legacy/static DP over Type-C port there is no
> > muxing
> > +	 * with other controllers so this is set to max lane count.
> > +	 * In case of Type_C it is set to the DFLEXDPSP.DPX4TXLATC
> > value.
> > +	 */
> > +	val = I915_READ(PORT_TX_DFLEXDPMLE1);
> > +	val &= ~DFLEXDPMLE1_DPMLETC_MASK(tc_port);
> > +	val |= DFLEXDPMLE1_DPMLETC(tc_port, lane_count);
> 
> this macro is wrong, each bit set maps to a lane, so to enable all 4
> lanes it should 0xf for the first TC.
> 
> From spec:
> 
> For example, in DP Pin Assignment C, the register
> DFLEXDPSP1.DPX4TXLATC0 tells Display Driver that all the 4 TX Lane in
> PHY can be used. However, Display Driver may choose to use only x1,
> i.e. for ML0. Then Display Driver will program “0001b” to this
> register. For x2 and x4, Display Driver will program “0011b” and
> “1111b”, respectively.
>

Oh yes I realize now that there is no 1:1 mapping between lane count
and the value set in ML register
Lane count 1 - Value = 1
Lane count = 2, value = 3
Lane count = 4, Value = 0xf

I will change that logic.

Manasi

> 
> > +	I915_WRITE(PORT_TX_DFLEXDPMLE1, val);
> > +}
> > +
> >  static void intel_dp_prepare(struct intel_encoder *encoder,
> >  			     const struct intel_crtc_state
> > *pipe_config)
> >  {
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h
> > b/drivers/gpu/drm/i915/intel_drv.h
> > index 1ad7c11..d98cdb9 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -1676,6 +1676,7 @@ bool intel_dp_init_connector(struct
> > intel_digital_port *intel_dig_port,
> >  void intel_dp_set_link_params(struct intel_dp *intel_dp,
> >  			      int link_rate, uint8_t lane_count,
> >  			      bool link_mst);
> > +void intel_dp_set_fia_lane_count(struct intel_dp *intel_dp);
> >  int intel_dp_get_link_train_fallback_values(struct intel_dp
> > *intel_dp,
> >  					    int link_rate, uint8_t
> > lane_count);
> >  void intel_dp_start_link_train(struct intel_dp *intel_dp);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-13 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-01  0:30 [PATCH] drm/i915/icl: Add pre_pll_enable hook for ICL and set DFLEXDPMLE in this hook Manasi Navare
2018-08-01  1:05 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-08-13 19:38 ` [PATCH] " Souza, Jose
2018-08-13 22:12   ` Manasi Navare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).