Skip to contentSkip to conversation

Add lspcon support

PATCH In review Shashank Sharma 5 participants 18 messages Mar 22, 2016 – Mar 25, 2016

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

cover Add lspcon support

LSPCON is essentially an active DP-HDMI convertor. It has two modes of operations:
- ls mode (for upto HDMI 1.4 outputs, 4k@30 resoution / 297MHz)
- pcon mode (for upto HDMI 2.0 outputs, 4k@60 resolution / 600 MHz)

This patch set adds support for LS mode of operation for GEN9 platforms. It adds a new connector for lspcon, whcih is a mix and match of DP and HDMI connectors, matching dual personality of lspcon devices.

Notes:
- Daniel Vetter gave a review comment on LSPCON design, to make it a separate encoder. This patch set tries to match that expectations with a separate connector, as DDI encoder already fulfills all the requirements of a lspcon_encoder.
- This patch set tagrets LS mode of operations only.
- PCON mode of operation will be added later, based on the requirements. This is to primarily unbloc Linux devices with LSPCON port.
- This patch set is tested with BXT RVP + drm-nightly
- As we redesigned this code, to meet the review comments, this is a working patch set, but not upto commercial quality yet.

Shashank Sharma (7):
drm/i915: add lspcon vbt bit parsing drm/i915: Add lspcon data structures drm/i915: Add new lspcon file
drm/i915: Add and initialize lspcon connector drm/i915: Add and register lspcon connector functions drm/i915: Add lspcon core functions drm/i915: Add lspcon hpd handler

 drivers/gpu/drm/i915/Makefile         |   3 +-
 drivers/gpu/drm/i915/i915_drv.h       |   1 +
 drivers/gpu/drm/i915/intel_bios.c     |  42 +++
 drivers/gpu/drm/i915/intel_ddi.c      |   6 +
 drivers/gpu/drm/i915/intel_dp.c       |  31 ++
 drivers/gpu/drm/i915/intel_drv.h      |  35 +-
 drivers/gpu/drm/i915/intel_hdmi.c     |  25 +-
 drivers/gpu/drm/i915/intel_hotplug.c  |   2 +-
 drivers/gpu/drm/i915/intel_lspcon.c   | 620 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_vbt_defs.h |   1 +
 10 files changed, 759 insertions(+), 7 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/7 drm/i915: add lspcon vbt bit parsing

LSPCON can be configured on a port using VBT entry. This patch adds code to parse VBT and detect presence of LSPCON for a ddi port.

---
 drivers/gpu/drm/i915/i915_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_bios.c     | 42 +++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_vbt_defs.h |  1 +
 3 files changed, 44 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index f330a53..cbd40de 100644
@@ -3373,6 +3373,7 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv);
 bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin);
 bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
 bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
+bool intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port);
 
 /* intel_opregion.c */
 #ifdef CONFIG_ACPI
drivers/gpu/drm/i915/intel_bios.c +42 -0

45 lines not on this page · raw message

drivers/gpu/drm/i915/intel_vbt_defs.h +1 -0
index 749dcea..0066b24 100644
@@ -276,6 +276,7 @@ struct common_child_dev_config {
 	u8 flags_1;
 	u8 not_common3[13];
 	u8 iboost_level;
+	u8 lspcon:1;
 } __packed;
 
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#2 lore raw

Re: [PATCH 1/7] drm/i915: add lspcon vbt bit parsing

Quoted 29 lines · Shashank Sharma

LSPCON can be configured on a port using VBT entry. This patch adds code to parse VBT and detect presence of LSPCON for a ddi port.

---
 drivers/gpu/drm/i915/i915_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_bios.c     | 42 +++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_vbt_defs.h |  1 +
 3 files changed, 44 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index f330a53..cbd40de 100644
@@ -3373,6 +3373,7 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv);
 bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin);
 bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
 bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
+bool intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port);
 
 /* intel_opregion.c */
 #ifdef CONFIG_ACPI
drivers/gpu/drm/i915/intel_bios.c +0 -0
index 083003b..a04ab5c 100644

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1591

Quoted 4 lines
drivers/gpu/drm/i915/intel_bios.c +1 -0
@@ -1588,3 +1588,45 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,
 
 	return false;
 }
+

Please add kernel-doc comment like all the other intel_bios_is_* functions have.

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1593

Quoted 2 lines
drivers/gpu/drm/i915/intel_bios.c +2 -0
+bool
+intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port)

You mean is *present*?

Please pass struct drm_i915_private *dev_priv instead of dev.

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1605

Quoted 12 lines
drivers/gpu/drm/i915/intel_bios.c +12 -0
+{
+	unsigned char i;
+	enum port dvo_port = 0;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* LSPCON is supported only for GEN 9 */
+	if (!IS_GEN9(dev))
+		return false;
+
+	/* Check if lspcon is supported in VBT */
+	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
+		if (!dev_priv->vbt.child_dev[i].common.lspcon)

I think to be defensive we should also check for bdb version >=
192. That we could check before the loop along with the gen check.

Quoted 32 lines
drivers/gpu/drm/i915/intel_bios.c +27 -0
+			continue;
+
+		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
+		case DVO_PORT_DPB:
+			dvo_port = PORT_B;
+			break;
+
+		case DVO_PORT_DPC:
+			dvo_port = PORT_C;
+			break;
+
+		case DVO_PORT_DPD:
+			dvo_port = PORT_D;
+			break;
+
+		default:
+			continue;
+		}
+
+		if (dvo_port == port) {
+			DRM_DEBUG_DRIVER("LSPCON configured on port %c\n",
+			port_name(port));
+			return true;
+		}
+	}
+	return false;
+}
drivers/gpu/drm/i915/intel_vbt_defs.h +0 -0
index 749dcea..0066b24 100644

drivers/gpu/drm/i915/intel_vbt_defs.h struct common_child_dev_config { · line 279

Quoted 4 lines
drivers/gpu/drm/i915/intel_vbt_defs.h +1 -0
@@ -276,6 +276,7 @@ struct common_child_dev_config {
 	u8 flags_1;
 	u8 not_common3[13];
 	u8 iboost_level;
+	u8 lspcon:1;

Huh? AFAICT from the spec, lspcon is bit 2 in flags_1. You could define flags_1 in terms of bitfields, including IBOOST_ENABLE.

Quoted 1 line
drivers/gpu/drm/i915/intel_vbt_defs.h +0 -0
 } __packed;
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH 1/7] drm/i915: add lspcon vbt bit parsing

Thanks for the review, Jani.

Regards
Shashank

Quoted 31 lines · Jani Nikula
Quoted 30 lines · Shashank Sharma

LSPCON can be configured on a port using VBT entry. This patch adds code to parse VBT and detect presence of LSPCON for a ddi port.

---
  drivers/gpu/drm/i915/i915_drv.h       |  1 +
  drivers/gpu/drm/i915/intel_bios.c     | 42 +++++++++++++++++++++++++++++++++++
  drivers/gpu/drm/i915/intel_vbt_defs.h |  1 +
  3 files changed, 44 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index f330a53..cbd40de 100644
@@ -3373,6 +3373,7 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv);
  bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin);
  bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
  bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
+bool intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port);
 
  /* intel_opregion.c */
  #ifdef CONFIG_ACPI
drivers/gpu/drm/i915/intel_bios.c +0 -0
index 083003b..a04ab5c 100644
@@ -1588,3 +1588,45 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1591

Quoted 3 lines
drivers/gpu/drm/i915/intel_bios.c +1 -0
  	return false;
  }
+

Please add kernel-doc comment like all the other intel_bios_is_* functions have.

Ok,

Quoted 5 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1593

Quoted 2 lines
drivers/gpu/drm/i915/intel_bios.c +2 -0
+bool
+intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port)

You mean is *present*?

Well, this is embarrassing :) yes it was supposed to be present.

Quoted 2 lines

Please pass struct drm_i915_private *dev_priv instead of dev.

Ok

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_bios.c +7 -0
+{
+	unsigned char i;
+	enum port dvo_port = 0;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* LSPCON is supported only for GEN 9 */
+	if (!IS_GEN9(dev))
Quoted 9 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1605

Quoted 5 lines
drivers/gpu/drm/i915/intel_bios.c +5 -0
+		return false;
+
+	/* Check if lspcon is supported in VBT */
+	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
+		if (!dev_priv->vbt.child_dev[i].common.lspcon)

I think to be defensive we should also check for bdb version >=
192. That we could check before the loop along with the gen check.

Yes, this can be done.

Quoted 31 lines
Quoted 31 lines
drivers/gpu/drm/i915/intel_bios.c +27 -0
+			continue;
+
+		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
+		case DVO_PORT_DPB:
+			dvo_port = PORT_B;
+			break;
+
+		case DVO_PORT_DPC:
+			dvo_port = PORT_C;
+			break;
+
+		case DVO_PORT_DPD:
+			dvo_port = PORT_D;
+			break;
+
+		default:
+			continue;
+		}
+
+		if (dvo_port == port) {
+			DRM_DEBUG_DRIVER("LSPCON configured on port %c\n",
+			port_name(port));
+			return true;
+		}
+	}
+	return false;
+}
drivers/gpu/drm/i915/intel_vbt_defs.h +0 -0
index 749dcea..0066b24 100644
Quoted 9 lines

drivers/gpu/drm/i915/intel_vbt_defs.h struct common_child_dev_config { · line 279

Quoted 5 lines
drivers/gpu/drm/i915/intel_vbt_defs.h +1 -0
@@ -276,6 +276,7 @@ struct common_child_dev_config {
  	u8 flags_1;
  	u8 not_common3[13];
  	u8 iboost_level;
+	u8 lspcon:1;

Huh? AFAICT from the spec, lspcon is bit 2 in flags_1. You could define flags_1 in terms of bitfields, including IBOOST_ENABLE.

I am not sure about this, let me go to VBT spec again, if there is a recent change. Will update you on this.

Quoted 2 lines

drivers/gpu/drm/i915/intel_vbt_defs.h struct common_child_dev_config { · line 280

Quoted 1 line
drivers/gpu/drm/i915/intel_vbt_defs.h +0 -0
  } __packed;

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

#4 lore raw

Re: [PATCH 1/7] drm/i915: add lspcon vbt bit parsing

Quoted 111 lines · Shashank

Thanks for the review, Jani.

Regards
Shashank

Quoted 31 lines · Jani Nikula
Quoted 30 lines · Shashank Sharma

LSPCON can be configured on a port using VBT entry. This patch adds code to parse VBT and detect presence of LSPCON for a ddi port.

---
  drivers/gpu/drm/i915/i915_drv.h       |  1 +
  drivers/gpu/drm/i915/intel_bios.c     | 42 +++++++++++++++++++++++++++++++++++
  drivers/gpu/drm/i915/intel_vbt_defs.h |  1 +
  3 files changed, 44 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index f330a53..cbd40de 100644
@@ -3373,6 +3373,7 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv);
  bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin);
  bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
  bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
+bool intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port);
 
  /* intel_opregion.c */
  #ifdef CONFIG_ACPI
drivers/gpu/drm/i915/intel_bios.c +0 -0
index 083003b..a04ab5c 100644
@@ -1588,3 +1588,45 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1591

Quoted 3 lines
drivers/gpu/drm/i915/intel_bios.c +1 -0
  	return false;
  }
+

Please add kernel-doc comment like all the other intel_bios_is_* functions have.

Ok,

Quoted 5 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1593

Quoted 2 lines
drivers/gpu/drm/i915/intel_bios.c +2 -0
+bool
+intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port)

You mean is *present*?

Well, this is embarrassing :) yes it was supposed to be present.

Quoted 2 lines

Please pass struct drm_i915_private *dev_priv instead of dev.

Ok

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_bios.c +7 -0
+{
+	unsigned char i;
+	enum port dvo_port = 0;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* LSPCON is supported only for GEN 9 */
+	if (!IS_GEN9(dev))
Quoted 9 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1605

Quoted 5 lines
drivers/gpu/drm/i915/intel_bios.c +5 -0
+		return false;
+
+	/* Check if lspcon is supported in VBT */
+	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
+		if (!dev_priv->vbt.child_dev[i].common.lspcon)

I think to be defensive we should also check for bdb version >=
192. That we could check before the loop along with the gen check.

Yes, this can be done.

Quoted 31 lines
Quoted 31 lines
drivers/gpu/drm/i915/intel_bios.c +27 -0
+			continue;
+
+		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
+		case DVO_PORT_DPB:
+			dvo_port = PORT_B;
+			break;
+
+		case DVO_PORT_DPC:
+			dvo_port = PORT_C;
+			break;
+
+		case DVO_PORT_DPD:
+			dvo_port = PORT_D;
+			break;
+
+		default:
+			continue;
+		}
+
+		if (dvo_port == port) {
+			DRM_DEBUG_DRIVER("LSPCON configured on port %c\n",
+			port_name(port));
+			return true;
+		}
+	}
+	return false;
+}
drivers/gpu/drm/i915/intel_vbt_defs.h +0 -0
index 749dcea..0066b24 100644
Quoted 9 lines

drivers/gpu/drm/i915/intel_vbt_defs.h struct common_child_dev_config { · line 279

Quoted 5 lines
drivers/gpu/drm/i915/intel_vbt_defs.h +1 -0
@@ -276,6 +276,7 @@ struct common_child_dev_config {
  	u8 flags_1;
  	u8 not_common3[13];
  	u8 iboost_level;
+	u8 lspcon:1;

Huh? AFAICT from the spec, lspcon is bit 2 in flags_1. You could define flags_1 in terms of bitfields, including IBOOST_ENABLE.

Quoted 2 lines

I am not sure about this, let me go to VBT spec again, if there is a recent change. Will update you on this.

There was a patch [1] posted recently which added the lspcon bit and others, and that at least matches the spec at the time when I looked at it (or I made a mistake). The patch just needs a rebase and it should be good to go I think, though someone else double checking wouldn't hurt.

[1] https://lists.freedesktop.org/archives/intel-gfx/2016-March/089759.html

Quoted 6 lines
Quoted 2 lines

drivers/gpu/drm/i915/intel_vbt_defs.h struct common_child_dev_config { · line 280

Quoted 1 line
drivers/gpu/drm/i915/intel_vbt_defs.h +0 -0
  } __packed;

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

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Re: [PATCH 1/7] drm/i915: add lspcon vbt bit parsing

Regards
Shashank

Quoted 115 lines · Ville Syrjälä
Quoted 111 lines · Shashank

Thanks for the review, Jani.

Regards
Shashank

Quoted 31 lines · Jani Nikula
Quoted 30 lines · Shashank Sharma

LSPCON can be configured on a port using VBT entry. This patch adds code to parse VBT and detect presence of LSPCON for a ddi port.

---
   drivers/gpu/drm/i915/i915_drv.h       |  1 +
   drivers/gpu/drm/i915/intel_bios.c     | 42 +++++++++++++++++++++++++++++++++++
   drivers/gpu/drm/i915/intel_vbt_defs.h |  1 +
   3 files changed, 44 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index f330a53..cbd40de 100644
@@ -3373,6 +3373,7 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv);
   bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin);
   bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
   bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
+bool intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port);
 
   /* intel_opregion.c */
   #ifdef CONFIG_ACPI
drivers/gpu/drm/i915/intel_bios.c +0 -0
index 083003b..a04ab5c 100644
@@ -1588,3 +1588,45 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1591

Quoted 3 lines
drivers/gpu/drm/i915/intel_bios.c +1 -0
   	return false;
   }
+

Please add kernel-doc comment like all the other intel_bios_is_* functions have.

Ok,

Quoted 5 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1593

Quoted 2 lines
drivers/gpu/drm/i915/intel_bios.c +2 -0
+bool
+intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port)

You mean is *present*?

Well, this is embarrassing :) yes it was supposed to be present.

Quoted 2 lines

Please pass struct drm_i915_private *dev_priv instead of dev.

Ok

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_bios.c +7 -0
+{
+	unsigned char i;
+	enum port dvo_port = 0;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* LSPCON is supported only for GEN 9 */
+	if (!IS_GEN9(dev))
Quoted 9 lines

drivers/gpu/drm/i915/intel_bios.c bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, · line 1605

Quoted 5 lines
drivers/gpu/drm/i915/intel_bios.c +5 -0
+		return false;
+
+	/* Check if lspcon is supported in VBT */
+	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
+		if (!dev_priv->vbt.child_dev[i].common.lspcon)

I think to be defensive we should also check for bdb version >=
192. That we could check before the loop along with the gen check.

Yes, this can be done.

Quoted 31 lines
Quoted 31 lines
drivers/gpu/drm/i915/intel_bios.c +27 -0
+			continue;
+
+		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
+		case DVO_PORT_DPB:
+			dvo_port = PORT_B;
+			break;
+
+		case DVO_PORT_DPC:
+			dvo_port = PORT_C;
+			break;
+
+		case DVO_PORT_DPD:
+			dvo_port = PORT_D;
+			break;
+
+		default:
+			continue;
+		}
+
+		if (dvo_port == port) {
+			DRM_DEBUG_DRIVER("LSPCON configured on port %c\n",
+			port_name(port));
+			return true;
+		}
+	}
+	return false;
+}
drivers/gpu/drm/i915/intel_vbt_defs.h +0 -0
index 749dcea..0066b24 100644
Quoted 9 lines

drivers/gpu/drm/i915/intel_vbt_defs.h struct common_child_dev_config { · line 279

Quoted 5 lines
drivers/gpu/drm/i915/intel_vbt_defs.h +1 -0
@@ -276,6 +276,7 @@ struct common_child_dev_config {
   	u8 flags_1;
   	u8 not_common3[13];
   	u8 iboost_level;
+	u8 lspcon:1;

Huh? AFAICT from the spec, lspcon is bit 2 in flags_1. You could define flags_1 in terms of bitfields, including IBOOST_ENABLE.

Quoted 2 lines

I am not sure about this, let me go to VBT spec again, if there is a recent change. Will update you on this.

Quoted 7 lines

There was a patch [1] posted recently which added the lspcon bit and others, and that at least matches the spec at the time when I looked at it (or I made a mistake). The patch just needs a rebase and it should be good to go I think, though someone else double checking wouldn't hurt.

[1] https://lists.freedesktop.org/archives/intel-gfx/2016-March/089759.html

Thanks for pointing this out.
I almost forgot about this patch, which Durga/Siva added.
Will sync up on this patch first, and if a rebase is the only thing required, we can proceed on this one.

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

drivers/gpu/drm/i915/intel_vbt_defs.h struct common_child_dev_config { · line 280

Quoted 2 lines
drivers/gpu/drm/i915/intel_vbt_defs.h +0 -0
   } __packed;

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

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

#6 lore raw

PATCH 2/7 drm/i915: Add lspcon data structures

In reply to Shashank Sharma

This patch adds lspcon structure in intel_dig_port. These strucres will be used to check runtime status of LSPCON device.

---
 drivers/gpu/drm/i915/intel_drv.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/i915/intel_drv.h +16 -0
index 5136eef..f3e7e52 100644
@@ -855,12 +855,28 @@ struct intel_dp {
 	bool compliance_test_active;
 };
 
+/* LSPCON possibe modes of operation */
+enum lspcon_mode {
+	/* Invalid */
+	lspcon_mode_invalid,
+	/* level shifter mode */
+	lspcon_mode_ls,
+	/* protocol converter mode */
+	lspcon_mode_pcon,
+};
+
+struct intel_lspcon {
+	bool active;
+	enum lspcon_mode mode_of_op;
+};
+
 struct intel_digital_port {
 	struct intel_encoder base;
 	enum port port;
 	u32 saved_port_bits;
 	struct intel_dp dp;
 	struct intel_hdmi hdmi;
+	struct intel_lspcon lspcon;
 	enum irqreturn (*hpd_pulse)(struct intel_digital_port *, bool);
 	bool release_cl2_override;
 	uint8_t max_lanes;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH 3/7 drm/i915: Add new lspcon file

In reply to Shashank Sharma

This patch adds a new file for lspcon with
some basic stuff like:
- Some read/wrire addresses for lspcon device
- Basic read/write functions, using i2c over aux channel
- Utility functions to get lspcon/encoder/connector

---
 drivers/gpu/drm/i915/Makefile       |   3 +-
 drivers/gpu/drm/i915/intel_lspcon.c | 114 ++++++++++++++++++++++++++++++++++++
 2 files changed, 116 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c
drivers/gpu/drm/i915/Makefile +2 -1
index 5558a03..00a531a 100644
@@ -90,7 +90,8 @@ i915-y += dvo_ch7017.o \
 	  intel_lvds.o \
 	  intel_panel.o \
 	  intel_sdvo.o \
-	  intel_tv.o
+	  intel_tv.o \
+	  intel_lspcon.o
 
 # virtual gpu code
 i915-y += i915_vgpu.o
drivers/gpu/drm/i915/intel_lspcon.c new file +114 -0

114 lines not on this page · raw message

Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH 4/7 drm/i915: Add and initialize lspcon connector

In reply to Shashank Sharma

lspcon is a tricky device which acts as DP in some cases and as HDMI in some. Here is how:
- lspcon needs DP for all the i2c_ove_aux read/write transitions so it needs to have some DP level initializations
- lspcon is detected by userspace/sink as HDMI device, so it needs to be detectd as HDMI device.

This patch adds a custom connector for lspcon device, which can pick and chose what it wants from existing functionality.

This patch also adds functions to init dp and hdmi to the minimum need, and then play around with them.

---
 drivers/gpu/drm/i915/intel_ddi.c    |  6 ++++
 drivers/gpu/drm/i915/intel_dp.c     | 31 ++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h    |  8 +++++
 drivers/gpu/drm/i915/intel_hdmi.c   | 17 +++++++++
 drivers/gpu/drm/i915/intel_lspcon.c | 72 +++++++++++++++++++++++++++++++++++++
 5 files changed, 134 insertions(+)
drivers/gpu/drm/i915/intel_ddi.c +6 -0
index 91654ff..f68c257 100644
@@ -2169,6 +2169,12 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
 	intel_encoder->cloneable = 0;
 
+	/* Check if LSPCON is configured on this port */
+	if (intel_bios_is_lspcon_preset(dev, intel_dig_port->port)) {
+		intel_lspcon_init_connector(intel_dig_port);
+		return;
+	}
+
 	if (init_dp) {
 		if (!intel_ddi_init_dp_connector(intel_dig_port))
 			goto err;
drivers/gpu/drm/i915/intel_dp.c +31 -0
index 3ff8f1d..6005c26 100644
@@ -5895,6 +5895,37 @@ fail:
 	return false;
 }
 
+int intel_dp_init_minimum(struct intel_digital_port *intel_dig_port,
+	struct intel_connector *intel_connector)
+{
+	int ret;
+	enum port port = intel_dig_port->port;
+	struct intel_dp *intel_dp = &intel_dig_port->dp;
+	struct drm_device *dev = intel_dig_port->base.base.dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
+	if (WARN(intel_dig_port->max_lanes < 1,
+		 "Not enough lanes (%d) for DP on port %c\n",
+		 intel_dig_port->max_lanes, port_name(port)))
+		return -EINVAL;
+
+	intel_dp->pps_pipe = INVALID_PIPE;
+	intel_dp->get_aux_clock_divider = skl_get_aux_clock_divider;
+	intel_dp->get_aux_send_ctl = skl_get_aux_send_ctl;
+	intel_dp->prepare_link_retrain = intel_ddi_prepare_link_retrain;
+	intel_dp->DP = I915_READ(intel_dp->output_reg);
+	intel_dp->attached_connector = intel_connector;
+	INIT_DELAYED_WORK(&intel_dp->panel_vdd_work,
+			  edp_panel_vdd_work);
+
+	ret = intel_dp_aux_init(intel_dp, intel_connector);
+	if (ret)
+		DRM_ERROR("Aux init for LSPCON failed\n");
+
+	return ret;
+}
+
 void
 intel_dp_init(struct drm_device *dev,
 	      i915_reg_t output_reg, enum port port)
drivers/gpu/drm/i915/intel_drv.h +8 -0
index f3e7e52..09273d5 100644
@@ -1327,6 +1327,9 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
 bool
 intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]);
+int intel_dp_init_minimum(struct intel_digital_port *intel_dig_port,
+		struct intel_connector *intel_connector);
+
 
 /* intel_dp_mst.c */
 int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);
@@ -1339,6 +1342,9 @@ void intel_dsi_init(struct drm_device *dev);
 void intel_dvo_init(struct drm_device *dev);
 
 
+/* intel_lspcon.c */
+void intel_lspcon_init_connector(struct intel_digital_port *intel_dig_port);
+
 /* legacy fbdev emulation in intel_fbdev.c */
 #ifdef CONFIG_DRM_FBDEV_EMULATION
 extern int intel_fbdev_init(struct drm_device *dev);
@@ -1392,6 +1398,8 @@ void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv);
 void intel_hdmi_init(struct drm_device *dev, i915_reg_t hdmi_reg, enum port port);
 void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 			       struct intel_connector *intel_connector);
+int intel_hdmi_init_minimum(struct intel_digital_port *intel_dig_port,
+				struct intel_connector *intel_connector);
 struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
 bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 			       struct intel_crtc_state *pipe_config);
drivers/gpu/drm/i915/intel_hdmi.c +17 -0
index e2dab48..9fcbbdf 100644
@@ -2035,6 +2035,23 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c
 	intel_hdmi->aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
 }
 
+int intel_hdmi_init_minimum(struct intel_digital_port *intel_dig_port,
+			       struct intel_connector *intel_connector)
+{
+	struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
+
+	if (WARN(intel_dig_port->max_lanes < 4,
+		"Not enough lanes (%d) for HDMI on port %c\n",
+		intel_dig_port->max_lanes, port_name(intel_dig_port->port)))
+		return -EINVAL;
+
+	intel_hdmi->write_infoframe = hsw_write_infoframe;
+	intel_hdmi->set_infoframes = hsw_set_infoframes;
+	intel_hdmi->infoframe_enabled = hsw_infoframe_enabled;
+	intel_hdmi->attached_connector = intel_connector;
+	return 0;
+}
+
 void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 			       struct intel_connector *intel_connector)
 {
drivers/gpu/drm/i915/intel_lspcon.c +72 -0

75 lines not on this page · raw message

Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

PATCH 5/7 drm/i915: Add and register lspcon connector functions

In reply to Shashank Sharma

This patch adds various lspcon connector functions. Some of the functions are newly written, to meet the specific needs of lspcon HW, whereas few of them are just an abstraction layer on existing HDMI connector functions.

---
 drivers/gpu/drm/i915/intel_drv.h     |  11 +-
 drivers/gpu/drm/i915/intel_hdmi.c    |   8 +-
 drivers/gpu/drm/i915/intel_hotplug.c |   2 +-
 drivers/gpu/drm/i915/intel_lspcon.c  | 238 ++++++++++++++++++++++++++++++++++-
 4 files changed, 251 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/intel_drv.h +10 -1
index 09273d5..7b19a2c 100644
@@ -1403,7 +1403,12 @@ int intel_hdmi_init_minimum(struct intel_digital_port *intel_dig_port,
 struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
 bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 			       struct intel_crtc_state *pipe_config);
-
+int intel_hdmi_get_modes(struct drm_connector *connector);
+int intel_hdmi_set_property(struct drm_connector *connector,
+		struct drm_property *property, uint64_t val);
+void intel_hdmi_destroy(struct drm_connector *connector);
+void intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi,
+		struct drm_connector *connector);
 
 /* intel_lvds.c */
 void intel_lvds_init(struct drm_device *dev);
@@ -1492,6 +1497,10 @@ bool intel_display_power_get_if_enabled(struct drm_i915_private *dev_priv,
 void intel_display_power_put(struct drm_i915_private *dev_priv,
 			     enum intel_display_power_domain domain);
 
+/* intel_hotplug.c */
+bool intel_hpd_irq_event(struct drm_device *dev,
+		struct drm_connector *connector);
+
 static inline void
 assert_rpm_device_not_suspended(struct drm_i915_private *dev_priv)
 {
drivers/gpu/drm/i915/intel_hdmi.c +4 -4
index 9fcbbdf..b67bb30 100644
@@ -1447,7 +1447,7 @@ intel_hdmi_force(struct drm_connector *connector)
 	hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI;
 }
 
-static int intel_hdmi_get_modes(struct drm_connector *connector)
+int intel_hdmi_get_modes(struct drm_connector *connector)
 {
 	struct edid *edid;
 
@@ -1471,7 +1471,7 @@ intel_hdmi_detect_audio(struct drm_connector *connector)
 	return has_audio;
 }
 
-static int
+int
 intel_hdmi_set_property(struct drm_connector *connector,
 			struct drm_property *property,
 			uint64_t val)
@@ -1996,7 +1996,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder)
 	}
 }
 
-static void intel_hdmi_destroy(struct drm_connector *connector)
+void intel_hdmi_destroy(struct drm_connector *connector)
 {
 	kfree(to_intel_connector(connector)->detect_edid);
 	drm_connector_cleanup(connector);
@@ -2025,7 +2025,7 @@ static const struct drm_encoder_funcs intel_hdmi_enc_funcs = {
 	.destroy = intel_encoder_destroy,
 };
 
-static void
+void
 intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector)
 {
 	intel_attach_force_audio_property(connector);
drivers/gpu/drm/i915/intel_hotplug.c +1 -1
index bee6730..11a3e02 100644
@@ -226,7 +226,7 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
 	intel_runtime_pm_put(dev_priv);
 }
 
-static bool intel_hpd_irq_event(struct drm_device *dev,
+bool intel_hpd_irq_event(struct drm_device *dev,
 				struct drm_connector *connector)
 {
 	enum drm_connector_status old_status;
drivers/gpu/drm/i915/intel_lspcon.c +236 -2

274 lines not on this page · raw message

Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

PATCH 6/7 drm/i915: Add lspcon core functions

In reply to Shashank Sharma

This patch adds lspcon's internal functions, which work on the probe layer, and indicate the working status of lspcon, which are mostly:

probe: A lspcon device is probed only once, during boot time, as its always present with the device, next to port. So the i2c_over_aux channel is alwyas read/writeable if DC is powered on. If VBT says that this port contains lspcon, we check and probe the HW to verify and initialize it.

get_mode: This function indicates the current mode of operation of lspcon (ls or pcon mode)

change_mode: This function can change the lspcon's mode of operation to desired mode.

---
 drivers/gpu/drm/i915/intel_lspcon.c | 165 ++++++++++++++++++++++++++++++++++++
 1 file changed, 165 insertions(+)
drivers/gpu/drm/i915/intel_lspcon.c +165 -0
index e64abd3..6ef320b 100644
@@ -120,6 +120,164 @@ int lspcon_ioa_write(struct i2c_adapter *adapter, u8 *buffer,
 	return err;
 }
 
+enum lspcon_mode lspcon_get_current_mode(struct intel_lspcon *lspcon)
+{
+	u8 data;
+	int err = 0;
+	struct intel_digital_port *dig_port = lspcon_to_dig_port(lspcon);
+	struct i2c_adapter *adapter = &dig_port->dp.aux.ddc;
+
+	/* Read Status: i2c over aux */
+	err = lspcon_ioa_read(adapter, &data, LSPCON_I2C_ADDRESS,
+			LSPCON_MODE_CHECK_OFFSET, 1);
+	if (err < 0) {
+		DRM_ERROR("LSPCON read mode ioa (0x80, 0x41) failed\n");
+		return lspcon_mode_invalid;
+	}
+
+	DRM_DEBUG_DRIVER("LSPCON mode (0x80, 0x41) = %x\n", (unsigned int)data);
+	return data & LSPCON_MODE_MASK ? lspcon_mode_pcon : lspcon_mode_ls;
+}
+
+int lspcon_change_mode(struct intel_lspcon *lspcon,
+	enum lspcon_mode mode, bool force)
+{
+	u8 data;
+	int err;
+	int time_out = 200;
+	enum lspcon_mode current_mode;
+	struct intel_digital_port *dig_port = lspcon_to_dig_port(lspcon);
+
+	current_mode = lspcon_get_current_mode(lspcon);
+	if (current_mode == lspcon_mode_invalid) {
+		DRM_ERROR("Failed to get current LSPCON mode\n");
+		return -EFAULT;
+	}
+
+	if (current_mode == mode && !force) {
+		DRM_DEBUG_DRIVER("Current mode = desired LSPCON mode\n");
+		return 0;
+	}
+
+	if (mode == lspcon_mode_ls)
+		data = ~LSPCON_MODE_MASK;
+	else
+		data = LSPCON_MODE_MASK;
+
+	/* Change mode */
+	err = lspcon_ioa_write(&dig_port->dp.aux.ddc, &data, LSPCON_I2C_ADDRESS,
+			LSPCON_MODE_CHANGE_OFFSET, 1);
+	if (err < 0) {
+		DRM_ERROR("LSPCON mode change failed\n");
+		return err;
+	}
+
+	/*
+	* Confirm mode change by reading the status bit.
+	* Sometimes, it takes a while to change the mode,
+	* so wait and retry until time out or done.
+	*/
+	while (time_out) {
+		current_mode = lspcon_get_current_mode(lspcon);
+		if (current_mode != mode) {
+			mdelay(10);
+			time_out -= 10;
+		} else {
+			lspcon->mode_of_op = mode;
+			DRM_DEBUG_DRIVER("LSPCON mode changed to %s\n",
+				mode == lspcon_mode_ls ? "LS" : "PCON");
+			return 0;
+		}
+	}
+
+	DRM_ERROR("LSPCON mode change timed out\n");
+	return -EFAULT;
+}
+
+bool lspcon_detect_identifier(struct intel_lspcon *lspcon)
+{
+	int err = 0;
+	u8 sign[LSPCON_IDENTIFIER_LENGTH + 1] = {'\0', };
+	struct intel_digital_port *dig_port = lspcon_to_dig_port(lspcon);
+	struct i2c_adapter *adapter = &dig_port->dp.aux.ddc;
+
+	/*
+	 * Identifier: First 15 bytes are ascii for "DP-HDMI ADAPTOR". The 16th
+	 * byte defines if thats a LSPCON or any other dongle. If byte 16 =0xa8
+	 * its LSPCON
+	 */
+
+	/* Read 16 bytes from I2C reg 0x80, offset 0x0 I2C-over-aux */
+	err = lspcon_ioa_read(adapter, sign, LSPCON_I2C_ADDRESS,
+			LSPCON_ADAPTER_SIGN_OFFSET, LSPCON_IDENTIFIER_LENGTH);
+	if (err < 0) {
+		DRM_ERROR("Error reading lspcon sign (0x80, 0x0)\n");
+		return false;
+	}
+
+	/* Check sign */
+	if (strncmp((void *)sign, "DP-HDMI ADAPTOR",
+		LSPCON_IDENTIFIER_LENGTH - 1)) {
+		DRM_ERROR("Cant detect adaptor sign, its %s\n", sign);
+		return false;
+	}
+
+	/* Identify LSPCON */
+	if (sign[LSPCON_IDENTIFIER_OFFSET] != LSPCON_ADAPTER) {
+		DRM_ERROR("Found non LSPCON adaptor\n");
+		return false;
+	}
+
+	/* yay ... found a LSPCON */
+	DRM_DEBUG_DRIVER("LSPCON adaptor detected\n");
+	return true;
+}
+
+enum lspcon_mode lspcon_probe(struct intel_lspcon *lspcon)
+{
+	enum lspcon_mode current_mode;
+
+	/* Detect a valid lspcon */
+	if (!lspcon_detect_identifier(lspcon)) {
+		DRM_DEBUG_DRIVER("Failed to find LSPCON identifier\n");
+		return false;
+	}
+
+	/* LSPCON's mode of operation */
+	current_mode = lspcon_get_current_mode(lspcon);
+	if (current_mode == lspcon_mode_invalid) {
+		DRM_ERROR("Failed to read LSPCON mode\n");
+		return false;
+	}
+
+	/* All is well */
+	lspcon->mode_of_op = current_mode;
+	lspcon->active = true;
+	return current_mode;
+}
+
+bool lspcon_device_init(struct intel_lspcon *lspcon)
+{
+
+	/* Lets check LSPCON now, probe the HW status */
+	lspcon->active = false;
+	lspcon->mode_of_op = lspcon_mode_invalid;
+	if (!lspcon_probe(lspcon)) {
+		DRM_ERROR("Failed to probe lspcon");
+		return false;
+	}
+
+	/* We wish to keep LSPCON in LS mode */
+	if (lspcon->active && lspcon->mode_of_op != lspcon_mode_ls) {
+		if (lspcon_change_mode(lspcon, lspcon_mode_ls, true) < 0) {
+			DRM_ERROR("LSPCON mode change to LS failed\n");
+			return false;
+		}
+	}
+	DRM_DEBUG_DRIVER("LSPCON init success\n");
+	return true;
+}
+
 static int lspcon_get_edid_over_aux(void *data,
 	u8 *buf, unsigned int block, size_t len)
 {
@@ -333,6 +491,7 @@ void intel_lspcon_init_connector(struct intel_digital_port *intel_dig_port)
 	struct intel_encoder *intel_encoder = &intel_dig_port->base;
 	struct drm_device *dev = intel_encoder->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_lspcon *lspcon = &intel_dig_port->lspcon;
 	struct intel_connector *intel_connector;
 	struct drm_connector *connector;
 	enum port port = intel_dig_port->port;
@@ -411,6 +570,12 @@ void intel_lspcon_init_connector(struct intel_digital_port *intel_dig_port)
 		I915_WRITE(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd);
 	}
 
+	/* Now initialize the LSPCON device */
+	if (!lspcon_device_init(lspcon)) {
+		DRM_ERROR("LSPCON device init failed\n");
+		goto fail;
+	}
+
 	DRM_DEBUG_DRIVER("LSPCON connector init done\n");
 	return;
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

PATCH 7/7 drm/i915: Add lspcon hpd handler

In reply to Shashank Sharma

This patch adds a new hpd handler for lspcon.
As lspcon has its own way of reading EDID and detecting the device, it wont be efficient to use the existing hpd functions to handle the hot_plug scenarios. This new function reads the EDID and checks the status of the sink device.

---
 drivers/gpu/drm/i915/intel_lspcon.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
drivers/gpu/drm/i915/intel_lspcon.c +35 -0
index 6ef320b..0c064b9 100644
@@ -278,6 +278,38 @@ bool lspcon_device_init(struct intel_lspcon *lspcon)
 	return true;
 }
 
+enum irqreturn
+lspcon_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
+{
+	struct drm_device *dev = intel_dig_port->base.base.dev;
+	struct intel_encoder *intel_encoder = &intel_dig_port->base;
+	struct intel_connector *intel_connector;
+	bool changed = false;
+
+	mutex_lock(&dev->mode_config.mutex);
+	if (intel_encoder->hot_plug)
+		intel_encoder->hot_plug(intel_encoder);
+
+	for_each_intel_connector(dev, intel_connector) {
+		if (intel_connector->encoder == intel_encoder) {
+			struct drm_connector *connector =
+				&intel_connector->base;
+
+			DRM_DEBUG_DRIVER("Hptplug: Connector %s (pin %i).\n",
+				connector->name, intel_encoder->hpd_pin);
+			if (intel_hpd_irq_event(dev, connector))
+				changed = true;
+		}
+	}
+	mutex_unlock(&dev->mode_config.mutex);
+
+	if (changed) {
+		DRM_DEBUG_DRIVER("Sending event for change\n");
+		drm_kms_helper_hotplug_event(dev);
+	}
+	return IRQ_HANDLED;
+}
+
 static int lspcon_get_edid_over_aux(void *data,
 	u8 *buf, unsigned int block, size_t len)
 {
@@ -516,6 +548,9 @@ void intel_lspcon_init_connector(struct intel_digital_port *intel_dig_port)
 	intel_connector->get_hw_state = intel_ddi_connector_get_hw_state;
 	i915_debugfs_connector_add(connector);
 
+	/* HPD handler */
+	intel_dig_port->hpd_pulse = lspcon_hpd_pulse;
+
 	/* init DP */
 	if (intel_dp_init_minimum(intel_dig_port, intel_connector)) {
 		DRM_ERROR("DP init for LSPCON failed\n");
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw
In reply to Shashank Sharma
Quoted 10 lines · Shashank Sharma

LSPCON is essentially an active DP-HDMI convertor. It has two modes of operations:
- ls mode (for upto HDMI 1.4 outputs, 4k@30 resoution / 297MHz)
- pcon mode (for upto HDMI 2.0 outputs, 4k@60 resolution / 600 MHz)

This patch set adds support for LS mode of operation for GEN9 platforms. It adds a new connector for lspcon, whcih is a mix and match of DP and HDMI connectors, matching dual personality of lspcon devices.

Quoted 11 lines

Notes:
- Daniel Vetter gave a review comment on LSPCON design, to make it a separate encoder. This patch set tries to match that expectations with a separate connector, as DDI encoder already fulfills all the requirements of a lspcon_encoder.
- This patch set tagrets LS mode of operations only.
- PCON mode of operation will be added later, based on the requirements. This is to primarily unbloc Linux devices with LSPCON port.
- This patch set is tested with BXT RVP + drm-nightly
- As we redesigned this code, to meet the review comments, this is a working patch set, but not upto commercial quality yet.

Quick glance tells me this is more or less just an in driver implementation of the DP dual mode standard at this point. I recently posted some patches [1] that implement dual mode support as a helper. So you should check it out and try to layer whatever lspcon specifics on top of that.

The only thing missing from my patches was basically using i2c-over-aux instead of gmbus for type2 adapters, but that's mostly just a matter of passing the right i2c adapter to places.

[1] https://lists.freedesktop.org/archives/dri-devel/2016-February/101494.html

Quoted 30 lines

Shashank Sharma (7):
drm/i915: add lspcon vbt bit parsing drm/i915: Add lspcon data structures drm/i915: Add new lspcon file
drm/i915: Add and initialize lspcon connector drm/i915: Add and register lspcon connector functions drm/i915: Add lspcon core functions drm/i915: Add lspcon hpd handler

 drivers/gpu/drm/i915/Makefile         |   3 +-
 drivers/gpu/drm/i915/i915_drv.h       |   1 +
 drivers/gpu/drm/i915/intel_bios.c     |  42 +++
 drivers/gpu/drm/i915/intel_ddi.c      |   6 +
 drivers/gpu/drm/i915/intel_dp.c       |  31 ++
 drivers/gpu/drm/i915/intel_drv.h      |  35 +-
 drivers/gpu/drm/i915/intel_hdmi.c     |  25 +-
 drivers/gpu/drm/i915/intel_hotplug.c  |   2 +-
 drivers/gpu/drm/i915/intel_lspcon.c   | 620 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_vbt_defs.h |   1 +
 10 files changed, 759 insertions(+), 7 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

Thanks Ville.
I will have a look at the series you posted, and if that's the case, will try to merge this implementation on top of yours.

Regards
Shashank

Quoted 28 lines · Ville Syrjälä
Quoted 10 lines · Shashank Sharma

LSPCON is essentially an active DP-HDMI convertor. It has two modes of operations:
- ls mode (for upto HDMI 1.4 outputs, 4k@30 resoution / 297MHz)
- pcon mode (for upto HDMI 2.0 outputs, 4k@60 resolution / 600 MHz)

This patch set adds support for LS mode of operation for GEN9 platforms. It adds a new connector for lspcon, whcih is a mix and match of DP and HDMI connectors, matching dual personality of lspcon devices.

Quoted 11 lines

Notes:
- Daniel Vetter gave a review comment on LSPCON design, to make it a separate encoder. This patch set tries to match that expectations with a separate connector, as DDI encoder already fulfills all the requirements of a lspcon_encoder.
- This patch set tagrets LS mode of operations only.
- PCON mode of operation will be added later, based on the requirements. This is to primarily unbloc Linux devices with LSPCON port.
- This patch set is tested with BXT RVP + drm-nightly
- As we redesigned this code, to meet the review comments, this is a working patch set, but not upto commercial quality yet.

Quick glance tells me this is more or less just an in driver implementation of the DP dual mode standard at this point. I recently posted some patches [1] that implement dual mode support as a helper. So you should check it out and try to layer whatever lspcon specifics on top of that.

Quoted 37 lines

The only thing missing from my patches was basically using i2c-over-aux instead of gmbus for type2 adapters, but that's mostly just a matter of passing the right i2c adapter to places.

[1] https://lists.freedesktop.org/archives/dri-devel/2016-February/101494.html

Quoted 30 lines

Shashank Sharma (7):
drm/i915: add lspcon vbt bit parsing drm/i915: Add lspcon data structures drm/i915: Add new lspcon file
drm/i915: Add and initialize lspcon connector drm/i915: Add and register lspcon connector functions drm/i915: Add lspcon core functions drm/i915: Add lspcon hpd handler

  drivers/gpu/drm/i915/Makefile         |   3 +-
  drivers/gpu/drm/i915/i915_drv.h       |   1 +
  drivers/gpu/drm/i915/intel_bios.c     |  42 +++
  drivers/gpu/drm/i915/intel_ddi.c      |   6 +
  drivers/gpu/drm/i915/intel_dp.c       |  31 ++
  drivers/gpu/drm/i915/intel_drv.h      |  35 +-
  drivers/gpu/drm/i915/intel_hdmi.c     |  25 +-
  drivers/gpu/drm/i915/intel_hotplug.c  |   2 +-
  drivers/gpu/drm/i915/intel_lspcon.c   | 620 ++++++++++++++++++++++++++++++++++
  drivers/gpu/drm/i915/intel_vbt_defs.h |   1 +
  10 files changed, 759 insertions(+), 7 deletions(-)

create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c

--
1.9.1

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

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

#14 lore raw
Quoted 3 lines · Shashank

Thanks Ville.
I will have a look at the series you posted, and if that's the case, will try to merge this implementation on top of yours.

Please try to review Ville's patches either way using the DP specs, so that we can pull it in. You have to read it carefully anyway to figure out whether it matches lspcon well enough, so might as well use that time ;-)

Thanks, Daniel

Quoted 74 lines

Regards
Shashank

Quoted 28 lines · Ville Syrjälä
Quoted 10 lines · Shashank Sharma

LSPCON is essentially an active DP-HDMI convertor. It has two modes of operations:
- ls mode (for upto HDMI 1.4 outputs, 4k@30 resoution / 297MHz)
- pcon mode (for upto HDMI 2.0 outputs, 4k@60 resolution / 600 MHz)

This patch set adds support for LS mode of operation for GEN9 platforms. It adds a new connector for lspcon, whcih is a mix and match of DP and HDMI connectors, matching dual personality of lspcon devices.

Quoted 11 lines

Notes:
- Daniel Vetter gave a review comment on LSPCON design, to make it a separate encoder. This patch set tries to match that expectations with a separate connector, as DDI encoder already fulfills all the requirements of a lspcon_encoder.
- This patch set tagrets LS mode of operations only.
- PCON mode of operation will be added later, based on the requirements. This is to primarily unbloc Linux devices with LSPCON port.
- This patch set is tested with BXT RVP + drm-nightly
- As we redesigned this code, to meet the review comments, this is a working patch set, but not upto commercial quality yet.

Quick glance tells me this is more or less just an in driver implementation of the DP dual mode standard at this point. I recently posted some patches [1] that implement dual mode support as a helper. So you should check it out and try to layer whatever lspcon specifics on top of that.

Quoted 37 lines

The only thing missing from my patches was basically using i2c-over-aux instead of gmbus for type2 adapters, but that's mostly just a matter of passing the right i2c adapter to places.

[1] https://lists.freedesktop.org/archives/dri-devel/2016-February/101494.html

Quoted 30 lines

Shashank Sharma (7):
drm/i915: add lspcon vbt bit parsing drm/i915: Add lspcon data structures drm/i915: Add new lspcon file
drm/i915: Add and initialize lspcon connector drm/i915: Add and register lspcon connector functions drm/i915: Add lspcon core functions drm/i915: Add lspcon hpd handler

 drivers/gpu/drm/i915/Makefile         |   3 +-
 drivers/gpu/drm/i915/i915_drv.h       |   1 +
 drivers/gpu/drm/i915/intel_bios.c     |  42 +++
 drivers/gpu/drm/i915/intel_ddi.c      |   6 +
 drivers/gpu/drm/i915/intel_dp.c       |  31 ++
 drivers/gpu/drm/i915/intel_drv.h      |  35 +-
 drivers/gpu/drm/i915/intel_hdmi.c     |  25 +-
 drivers/gpu/drm/i915/intel_hotplug.c  |   2 +-
 drivers/gpu/drm/i915/intel_lspcon.c   | 620 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_vbt_defs.h |   1 +
 10 files changed, 759 insertions(+), 7 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c

--
1.9.1

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

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

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

Regards
Shashank

Quoted 11 lines · Daniel Vetter
Quoted 3 lines · Shashank

Thanks Ville.
I will have a look at the series you posted, and if that's the case, will try to merge this implementation on top of yours.

Please try to review Ville's patches either way using the DP specs, so that we can pull it in. You have to read it carefully anyway to figure out whether it matches lspcon well enough, so might as well use that time ;-)

Thanks, Daniel

Got it :)

Quoted 70 lines
Quoted 70 lines

Regards
Shashank

Quoted 65 lines · Ville Syrjälä
Quoted 10 lines · Shashank Sharma

LSPCON is essentially an active DP-HDMI convertor. It has two modes of operations:
- ls mode (for upto HDMI 1.4 outputs, 4k@30 resoution / 297MHz)
- pcon mode (for upto HDMI 2.0 outputs, 4k@60 resolution / 600 MHz)

This patch set adds support for LS mode of operation for GEN9 platforms. It adds a new connector for lspcon, whcih is a mix and match of DP and HDMI connectors, matching dual personality of lspcon devices.

Quoted 11 lines

Notes:
- Daniel Vetter gave a review comment on LSPCON design, to make it a separate encoder. This patch set tries to match that expectations with a separate connector, as DDI encoder already fulfills all the requirements of a lspcon_encoder.
- This patch set tagrets LS mode of operations only.
- PCON mode of operation will be added later, based on the requirements. This is to primarily unbloc Linux devices with LSPCON port.
- This patch set is tested with BXT RVP + drm-nightly
- As we redesigned this code, to meet the review comments, this is a working patch set, but not upto commercial quality yet.

Quick glance tells me this is more or less just an in driver implementation of the DP dual mode standard at this point. I recently posted some patches [1] that implement dual mode support as a helper. So you should check it out and try to layer whatever lspcon specifics on top of that.

The only thing missing from my patches was basically using i2c-over-aux instead of gmbus for type2 adapters, but that's mostly just a matter of passing the right i2c adapter to places.

[1] https://lists.freedesktop.org/archives/dri-devel/2016-February/101494.html

Quoted 30 lines

Shashank Sharma (7):
drm/i915: add lspcon vbt bit parsing drm/i915: Add lspcon data structures drm/i915: Add new lspcon file
drm/i915: Add and initialize lspcon connector drm/i915: Add and register lspcon connector functions drm/i915: Add lspcon core functions drm/i915: Add lspcon hpd handler

  drivers/gpu/drm/i915/Makefile         |   3 +-
  drivers/gpu/drm/i915/i915_drv.h       |   1 +
  drivers/gpu/drm/i915/intel_bios.c     |  42 +++
  drivers/gpu/drm/i915/intel_ddi.c      |   6 +
  drivers/gpu/drm/i915/intel_dp.c       |  31 ++
  drivers/gpu/drm/i915/intel_drv.h      |  35 +-
  drivers/gpu/drm/i915/intel_hdmi.c     |  25 +-
  drivers/gpu/drm/i915/intel_hotplug.c  |   2 +-
  drivers/gpu/drm/i915/intel_lspcon.c   | 620 ++++++++++++++++++++++++++++++++++
  drivers/gpu/drm/i915/intel_vbt_defs.h |   1 +
  10 files changed, 759 insertions(+), 7 deletions(-)

create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c

--
1.9.1

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

Quoted 5 lines
Quoted 4 lines

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

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

#16 lore raw
In reply to Daniel Vetter

Hi Daniel, Ville,
I reviewed Ville's code for dp++ adaptors, and as Ville rightly mentioned, a lot of the code can be reused for LSPCON as it is, as LSPCON is also working as a type2 DP adaptor. I need to add i2c-over-aux functionality, and then LSPCON will become one of the consumers of this code.

How should we proceed on this?
- Should I pull those patches, and re-publish in intel-gfx, get the review done, and then write LSPCON layer on top of it ?
- Or Should I publish DP++ and modified LSPCON together ?

Please suggest.

Regards
Shashank
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Wednesday, March 23, 2016 2:33 PM
To: Sharma, Shashank
Cc: Ville Syrjälä; Vetter, Daniel; [email protected]; Sharma, Akashdeep
Subject: Re: [Intel-gfx] [PATCH 0/7] Add lspcon support

Quoted 3 lines · Shashank

Thanks Ville.
I will have a look at the series you posted, and if that's the case, will try to merge this implementation on top of yours.

Please try to review Ville's patches either way using the DP specs, so that we can pull it in. You have to read it carefully anyway to figure out whether it matches lspcon well enough, so might as well use that time ;-)

Thanks, Daniel

Quoted 72 lines

Regards
Shashank

Quoted 28 lines · Ville Syrjälä
Quoted 10 lines · Shashank Sharma

LSPCON is essentially an active DP-HDMI convertor. It has two modes of operations:
- ls mode (for upto HDMI 1.4 outputs, 4k@30 resoution / 297MHz)
- pcon mode (for upto HDMI 2.0 outputs, 4k@60 resolution / 600 MHz)

This patch set adds support for LS mode of operation for GEN9 platforms. It adds a new connector for lspcon, whcih is a mix and match of DP and HDMI connectors, matching dual personality of lspcon devices.

Quoted 11 lines

Notes:
- Daniel Vetter gave a review comment on LSPCON design, to make it a separate encoder. This patch set tries to match that expectations with a separate connector, as DDI encoder already fulfills all the requirements of a lspcon_encoder.
- This patch set tagrets LS mode of operations only.
- PCON mode of operation will be added later, based on the requirements. This is to primarily unbloc Linux devices with LSPCON port.
- This patch set is tested with BXT RVP + drm-nightly
- As we redesigned this code, to meet the review comments, this is a working patch set, but not upto commercial quality yet.

Quick glance tells me this is more or less just an in driver implementation of the DP dual mode standard at this point. I recently posted some patches [1] that implement dual mode support as a helper. So you should check it out and try to layer whatever lspcon specifics on top of that.

Quoted 39 lines

The only thing missing from my patches was basically using i2c-over-aux instead of gmbus for type2 adapters, but that's mostly just a matter of passing the right i2c adapter to places.

[1]
https://lists.freedesktop.org/archives/dri-devel/2016-February/101494
.html

Quoted 30 lines

Shashank Sharma (7):
drm/i915: add lspcon vbt bit parsing drm/i915: Add lspcon data structures drm/i915: Add new lspcon file
drm/i915: Add and initialize lspcon connector drm/i915: Add and register lspcon connector functions drm/i915: Add lspcon core functions drm/i915: Add lspcon hpd handler

 drivers/gpu/drm/i915/Makefile         |   3 +-
 drivers/gpu/drm/i915/i915_drv.h       |   1 +
 drivers/gpu/drm/i915/intel_bios.c     |  42 +++
 drivers/gpu/drm/i915/intel_ddi.c      |   6 +
 drivers/gpu/drm/i915/intel_dp.c       |  31 ++
 drivers/gpu/drm/i915/intel_drv.h      |  35 +-
 drivers/gpu/drm/i915/intel_hdmi.c     |  25 +-
 drivers/gpu/drm/i915/intel_hotplug.c  |   2 +-
 drivers/gpu/drm/i915/intel_lspcon.c   | 620 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_vbt_defs.h |   1 +
 10 files changed, 759 insertions(+), 7 deletions(-)  create mode 

100644 drivers/gpu/drm/i915/intel_lspcon.c

--
1.9.1

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

Quoted 4 lines

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

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#17 lore raw

✗ Fi.CI.BAT: warning for Add lspcon support

In reply to Shashank Sharma
== Series Details ==

== Series Details ==

Series: Add lspcon support
URL : https://patchwork.freedesktop.org/series/4756/
State : warning

== Summary ==

Series 4756v1 Add lspcon support
http://patchwork.freedesktop.org/api/1.0/series/4756/revisions/1/mbox/

Test kms_force_connector_basic:

        Subgroup force-load-detect:
                pass       -> SKIP       (snb-x220t)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                dmesg-warn -> PASS       (bsw-nuc-2)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                dmesg-warn -> PASS       (bsw-nuc-2)
                dmesg-warn -> PASS       (byt-nuc)
        Subgroup basic-rte:
                pass       -> DMESG-WARN (bsw-nuc-2)
bdw-nuci7        total:192  pass:180  dwarn:0   dfail:0   fail:0   skip:12 
bdw-ultra        total:192  pass:171  dwarn:0   dfail:0   fail:0   skip:21 
bsw-nuc-2        total:192  pass:154  dwarn:1   dfail:0   fail:0   skip:37 
byt-nuc          total:192  pass:157  dwarn:0   dfail:0   fail:0   skip:35 
hsw-brixbox      total:192  pass:170  dwarn:0   dfail:0   fail:0   skip:22 
hsw-gt2          total:192  pass:175  dwarn:0   dfail:0   fail:0   skip:17 
ivb-t430s        total:192  pass:167  dwarn:0   dfail:0   fail:0   skip:25 
skl-i5k-2        total:192  pass:169  dwarn:0   dfail:0   fail:0   skip:23 
skl-i7k-2        total:192  pass:169  dwarn:0   dfail:0   fail:0   skip:23 
skl-nuci5        total:192  pass:181  dwarn:0   dfail:0   fail:0   skip:11 
snb-dellxps      total:192  pass:158  dwarn:0   dfail:0   fail:0   skip:34 
snb-x220t        total:192  pass:157  dwarn:0   dfail:0   fail:1   skip:34 

Results at /archive/results/CI_IGT_test/Patchwork_1678/

83ed25fa1b956275542da63eb98dc8fd2291329d drm-intel-nightly: 2016y-03m-22d-15h-20m-55s UTC integration manifest 64d449abc86294f211a783404fb465e9f0bff70a drm/i915: Add lspcon hpd handler fdb8600c1166c8470954b518290cd35e08b02ae4 drm/i915: Add lspcon core functions 84fa946647056c440ab3197af2ad4c0a23e4c8c7 drm/i915: Add and register lspcon connector functions 507927d0999eb123b75abf62e302d53c63bf7e52 drm/i915: Add and initialize lspcon connector db55bf34f70937801eddd1279de9500f95477035 drm/i915: Add new lspcon file dab4018dab24476b7b50d131af2eaf4a7fe51fc3 drm/i915: Add lspcon data structures 2f098d39591a36161629e7cc8359bc88c1cbe033 drm/i915: add lspcon vbt bit parsing

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