[8/6] drm/i915/skl: Enable DDI-E
diff mbox

Message ID 1438994121-12616-1-git-send-email-rodrigo.vivi@intel.com
State New
Headers show

Commit Message

Vivi, Rodrigo Aug. 8, 2015, 12:35 a.m. UTC
There are OEMs using DDI-E out there,
so let's enable it.

Unfortunately there is no detection bit for DDI-E
So we need to rely on VBT for that.

I also need to give credits to Xiong since before seing
his approach to check info->support_* I was creating an ugly
vbt->ddie_sfuse_strap in order to propagate the ddi presence info

v2: Rebased as last patch in the series. since all other patches
in this series are needed for anything working propperly on DDI-E.

Credits-to: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
Cc: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_bios.c    | 14 +++++++-------
 drivers/gpu/drm/i915/intel_bios.h    |  2 ++
 drivers/gpu/drm/i915/intel_display.c |  9 +++++++++
 3 files changed, 18 insertions(+), 7 deletions(-)

Comments

Xiong Zhang Aug. 11, 2015, 7:12 a.m. UTC | #1
Reviewed-by: Xiong Zhang <xiong.y.zhang@intel.com>

thanks
> -----Original Message-----
> From: Vivi, Rodrigo
> Sent: Saturday, August 8, 2015 8:35 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Vivi, Rodrigo; Zhang, Xiong Y
> Subject: [PATCH 8/6] drm/i915/skl: Enable DDI-E
> 
> There are OEMs using DDI-E out there,
> so let's enable it.
> 
> Unfortunately there is no detection bit for DDI-E So we need to rely on VBT for
> that.
> 
> I also need to give credits to Xiong since before seing his approach to check
> info->support_* I was creating an ugly
> vbt->ddie_sfuse_strap in order to propagate the ddi presence info
> 
> v2: Rebased as last patch in the series. since all other patches in this series are
> needed for anything working propperly on DDI-E.
> 
> Credits-to: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
> Cc: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_bios.c    | 14 +++++++-------
>  drivers/gpu/drm/i915/intel_bios.h    |  2 ++
>  drivers/gpu/drm/i915/intel_display.c |  9 +++++++++
>  3 files changed, 18 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_bios.c
> b/drivers/gpu/drm/i915/intel_bios.c
> index c417973..c5b5a59b 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -898,19 +898,19 @@ static void parse_ddi_port(struct drm_i915_private
> *dev_priv, enum port port,
>  	/* Each DDI port can have more than one value on the "DVO Port" field,
>  	 * so look for all the possible values for each port and abort if more
>  	 * than one is found. */
> -	int dvo_ports[][2] = {
> -		{DVO_PORT_HDMIA, DVO_PORT_DPA},
> -		{DVO_PORT_HDMIB, DVO_PORT_DPB},
> -		{DVO_PORT_HDMIC, DVO_PORT_DPC},
> -		{DVO_PORT_HDMID, DVO_PORT_DPD},
> -		{DVO_PORT_CRT, -1 /* Port E can only be DVO_PORT_CRT */ },
> +	int dvo_ports[][3] = {
> +		{DVO_PORT_HDMIA, DVO_PORT_DPA, -1},
> +		{DVO_PORT_HDMIB, DVO_PORT_DPB, -1},
> +		{DVO_PORT_HDMIC, DVO_PORT_DPC, -1},
> +		{DVO_PORT_HDMID, DVO_PORT_DPD, -1},
> +		{DVO_PORT_CRT, DVO_PORT_HDMIE, DVO_PORT_DPE},
>  	};
> 
>  	/* Find the child device to use, abort if more than one found. */
>  	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
>  		it = dev_priv->vbt.child_dev + i;
> 
> -		for (j = 0; j < 2; j++) {
> +		for (j = 0; j < 3; j++) {
>  			if (dvo_ports[port][j] == -1)
>  				break;
> 
> diff --git a/drivers/gpu/drm/i915/intel_bios.h
> b/drivers/gpu/drm/i915/intel_bios.h
> index 77bf1dd..a2ef0df 100644
> --- a/drivers/gpu/drm/i915/intel_bios.h
> +++ b/drivers/gpu/drm/i915/intel_bios.h
> @@ -759,6 +759,8 @@ int intel_parse_bios(struct drm_device *dev);
>  #define DVO_PORT_DPC	8
>  #define DVO_PORT_DPD	9
>  #define DVO_PORT_DPA	10
> +#define DVO_PORT_DPE	11
> +#define DVO_PORT_HDMIE	12
>  #define DVO_PORT_MIPIA	21
>  #define DVO_PORT_MIPIB	22
>  #define DVO_PORT_MIPIC	23
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index fcf1230..7bf6209 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13961,6 +13961,15 @@ static void intel_setup_outputs(struct
> drm_device *dev)
>  			intel_ddi_init(dev, PORT_C);
>  		if (found & SFUSE_STRAP_DDID_DETECTED)
>  			intel_ddi_init(dev, PORT_D);
> +		/*
> +		 * On SKL we don't have a way to detect DDI-E so we rely on VBT.
> +		 */
> +		if (IS_SKYLAKE(dev) &&
> +		    (dev_priv->vbt.ddi_port_info[PORT_E].supports_dp ||
> +		     dev_priv->vbt.ddi_port_info[PORT_E].supports_dvi ||
> +		     dev_priv->vbt.ddi_port_info[PORT_E].supports_hdmi))
> +			intel_ddi_init(dev, PORT_E);
> +
>  	} else if (HAS_PCH_SPLIT(dev)) {
>  		int found;
>  		dpd_is_edp = intel_dp_is_edp(dev, PORT_D);
> --
> 2.4.3
Jani Nikula Aug. 31, 2015, 3:48 p.m. UTC | #2
On Sat, 08 Aug 2015, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> There are OEMs using DDI-E out there,
> so let's enable it.
>
> Unfortunately there is no detection bit for DDI-E
> So we need to rely on VBT for that.
>
> I also need to give credits to Xiong since before seing
> his approach to check info->support_* I was creating an ugly
> vbt->ddie_sfuse_strap in order to propagate the ddi presence info
>
> v2: Rebased as last patch in the series. since all other patches
> in this series are needed for anything working propperly on DDI-E.
>
> Credits-to: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
> Cc: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Pushed to drm-intel-next-fixes.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/intel_bios.c    | 14 +++++++-------
>  drivers/gpu/drm/i915/intel_bios.h    |  2 ++
>  drivers/gpu/drm/i915/intel_display.c |  9 +++++++++
>  3 files changed, 18 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index c417973..c5b5a59b 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -898,19 +898,19 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
>  	/* Each DDI port can have more than one value on the "DVO Port" field,
>  	 * so look for all the possible values for each port and abort if more
>  	 * than one is found. */
> -	int dvo_ports[][2] = {
> -		{DVO_PORT_HDMIA, DVO_PORT_DPA},
> -		{DVO_PORT_HDMIB, DVO_PORT_DPB},
> -		{DVO_PORT_HDMIC, DVO_PORT_DPC},
> -		{DVO_PORT_HDMID, DVO_PORT_DPD},
> -		{DVO_PORT_CRT, -1 /* Port E can only be DVO_PORT_CRT */ },
> +	int dvo_ports[][3] = {
> +		{DVO_PORT_HDMIA, DVO_PORT_DPA, -1},
> +		{DVO_PORT_HDMIB, DVO_PORT_DPB, -1},
> +		{DVO_PORT_HDMIC, DVO_PORT_DPC, -1},
> +		{DVO_PORT_HDMID, DVO_PORT_DPD, -1},
> +		{DVO_PORT_CRT, DVO_PORT_HDMIE, DVO_PORT_DPE},
>  	};
>  
>  	/* Find the child device to use, abort if more than one found. */
>  	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
>  		it = dev_priv->vbt.child_dev + i;
>  
> -		for (j = 0; j < 2; j++) {
> +		for (j = 0; j < 3; j++) {
>  			if (dvo_ports[port][j] == -1)
>  				break;
>  
> diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
> index 77bf1dd..a2ef0df 100644
> --- a/drivers/gpu/drm/i915/intel_bios.h
> +++ b/drivers/gpu/drm/i915/intel_bios.h
> @@ -759,6 +759,8 @@ int intel_parse_bios(struct drm_device *dev);
>  #define DVO_PORT_DPC	8
>  #define DVO_PORT_DPD	9
>  #define DVO_PORT_DPA	10
> +#define DVO_PORT_DPE	11
> +#define DVO_PORT_HDMIE	12
>  #define DVO_PORT_MIPIA	21
>  #define DVO_PORT_MIPIB	22
>  #define DVO_PORT_MIPIC	23
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index fcf1230..7bf6209 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13961,6 +13961,15 @@ static void intel_setup_outputs(struct drm_device *dev)
>  			intel_ddi_init(dev, PORT_C);
>  		if (found & SFUSE_STRAP_DDID_DETECTED)
>  			intel_ddi_init(dev, PORT_D);
> +		/*
> +		 * On SKL we don't have a way to detect DDI-E so we rely on VBT.
> +		 */
> +		if (IS_SKYLAKE(dev) &&
> +		    (dev_priv->vbt.ddi_port_info[PORT_E].supports_dp ||
> +		     dev_priv->vbt.ddi_port_info[PORT_E].supports_dvi ||
> +		     dev_priv->vbt.ddi_port_info[PORT_E].supports_hdmi))
> +			intel_ddi_init(dev, PORT_E);
> +
>  	} else if (HAS_PCH_SPLIT(dev)) {
>  		int found;
>  		dpd_is_edp = intel_dp_is_edp(dev, PORT_D);
> -- 
> 2.4.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index c417973..c5b5a59b 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -898,19 +898,19 @@  static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
 	/* Each DDI port can have more than one value on the "DVO Port" field,
 	 * so look for all the possible values for each port and abort if more
 	 * than one is found. */
-	int dvo_ports[][2] = {
-		{DVO_PORT_HDMIA, DVO_PORT_DPA},
-		{DVO_PORT_HDMIB, DVO_PORT_DPB},
-		{DVO_PORT_HDMIC, DVO_PORT_DPC},
-		{DVO_PORT_HDMID, DVO_PORT_DPD},
-		{DVO_PORT_CRT, -1 /* Port E can only be DVO_PORT_CRT */ },
+	int dvo_ports[][3] = {
+		{DVO_PORT_HDMIA, DVO_PORT_DPA, -1},
+		{DVO_PORT_HDMIB, DVO_PORT_DPB, -1},
+		{DVO_PORT_HDMIC, DVO_PORT_DPC, -1},
+		{DVO_PORT_HDMID, DVO_PORT_DPD, -1},
+		{DVO_PORT_CRT, DVO_PORT_HDMIE, DVO_PORT_DPE},
 	};
 
 	/* Find the child device to use, abort if more than one found. */
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
 		it = dev_priv->vbt.child_dev + i;
 
-		for (j = 0; j < 2; j++) {
+		for (j = 0; j < 3; j++) {
 			if (dvo_ports[port][j] == -1)
 				break;
 
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
index 77bf1dd..a2ef0df 100644
--- a/drivers/gpu/drm/i915/intel_bios.h
+++ b/drivers/gpu/drm/i915/intel_bios.h
@@ -759,6 +759,8 @@  int intel_parse_bios(struct drm_device *dev);
 #define DVO_PORT_DPC	8
 #define DVO_PORT_DPD	9
 #define DVO_PORT_DPA	10
+#define DVO_PORT_DPE	11
+#define DVO_PORT_HDMIE	12
 #define DVO_PORT_MIPIA	21
 #define DVO_PORT_MIPIB	22
 #define DVO_PORT_MIPIC	23
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index fcf1230..7bf6209 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13961,6 +13961,15 @@  static void intel_setup_outputs(struct drm_device *dev)
 			intel_ddi_init(dev, PORT_C);
 		if (found & SFUSE_STRAP_DDID_DETECTED)
 			intel_ddi_init(dev, PORT_D);
+		/*
+		 * On SKL we don't have a way to detect DDI-E so we rely on VBT.
+		 */
+		if (IS_SKYLAKE(dev) &&
+		    (dev_priv->vbt.ddi_port_info[PORT_E].supports_dp ||
+		     dev_priv->vbt.ddi_port_info[PORT_E].supports_dvi ||
+		     dev_priv->vbt.ddi_port_info[PORT_E].supports_hdmi))
+			intel_ddi_init(dev, PORT_E);
+
 	} else if (HAS_PCH_SPLIT(dev)) {
 		int found;
 		dpd_is_edp = intel_dp_is_edp(dev, PORT_D);