All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/5] Enable lspcon support for GEN9 devices
@ 2016-10-14 14:26 Shashank Sharma
  2016-10-14 14:26 ` [PATCH v6 1/5] drm: Helper for lspcon in drm_dp_dual_mode Shashank Sharma
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Shashank Sharma @ 2016-10-14 14:26 UTC (permalink / raw)
  To: imre.deak; +Cc: daniel.vetter, intel-gfx

LSPCON is essentially a dp++->hdmi adapter with dual mode of operation.

These modes are:
- Level Shifter mode: In LS mode, this device works as a type2 dp->hdmi
passive dongle, which steps up DP++ output to appropriate HDMI 1.4 signal.
This mode doesn't do any conversion at the protocol level.

- Protocol Converter mode: In PCON mode, this device acts as an
active DP++->HDMI 2.0 dongle, which converts the DP++ output to
compatible HDMI 2.0 output. In PCON mode, lspcon can support 4k@60
outputs, using DP HBR2 mode.

Many of Intel GEN9 devices come with in-built lspcon card
in motherboartd down mode. This patch series adds support for
lspcon devices in I915 driver.

While unit-testing this code, I was able to see a 4k@60 modeset with:
- BXT-T board
- Single HDMI 4k@60 display (ACER S)
- Ubuntu 14.04 desktop

V2: Worked on review comments from Ville
- In general, Ville suggested not to use the dual personality of
  DDI to drive lspcon, so this patch set drives it just as DP++ display.
  There is no separate detection for lspcon (hpd_pulse is good enough), and
  its being driven as a DP display with special initialization and EDID
  read sequence. To be able to do this, we driving lspcon in PCON mode only,
  where it can serve both HDMI1.3/HDMI1.4 sinks as well as 4k@60 capable
  HDMI 2.0 sinks. So compared to previous series, there is one patch less,
  as we have dropped lspcon detection patch.


V3: Addressed review comments from Rodrigo
    Details available with respective patch.

V4: Addressed review comments from Ville
    Details available with respective patch.

V5: Rebase, added a new patch for suspend/resume
V6: Rebase, addressed review comments from Imre

Shashank Sharma (5):
  drm: Helper for lspcon in drm_dp_dual_mode
  drm/i915: Add lspcon support for I915 driver
  drm/i915: Parse VBT data for lspcon
  drm/i915: Enable lspcon initialization
  drm/i915: Add lspcon resume function

 drivers/gpu/drm/drm_dp_dual_mode_helper.c | 103 ++++++++++++++++++++++
 drivers/gpu/drm/i915/Makefile             |   1 +
 drivers/gpu/drm/i915/i915_drv.h           |   5 ++
 drivers/gpu/drm/i915/intel_bios.c         |  49 +++++++++++
 drivers/gpu/drm/i915/intel_ddi.c          |  29 ++++++-
 drivers/gpu/drm/i915/intel_dp.c           |   7 +-
 drivers/gpu/drm/i915/intel_drv.h          |  10 +++
 drivers/gpu/drm/i915/intel_lspcon.c       | 136 ++++++++++++++++++++++++++++++
 include/drm/drm_dp_dual_mode_helper.h     |  26 ++++++
 9 files changed, 364 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c

-- 
1.9.1

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

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

* [PATCH v6 1/5] drm: Helper for lspcon in drm_dp_dual_mode
  2016-10-14 14:26 [PATCH v6 0/5] Enable lspcon support for GEN9 devices Shashank Sharma
@ 2016-10-14 14:26 ` Shashank Sharma
  2016-10-14 14:26 ` [PATCH v6 2/5] drm/i915: Add lspcon support for I915 driver Shashank Sharma
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Shashank Sharma @ 2016-10-14 14:26 UTC (permalink / raw)
  To: imre.deak; +Cc: daniel.vetter, intel-gfx

This patch adds lspcon support in dp_dual_mode helper.
lspcon is essentially a dp->hdmi dongle with dual personality.

LS mode: It works as a passive dongle, by level shifting DP++
signals to HDMI signals, in LS mode.
PCON mode: It works as a protocol converter active dongle
in pcon mode, by converting DP++ outputs to HDMI 2.0 outputs.

This patch adds support for lspcon detection and mode set
switch operations, as a dp dual mode dongle.

v2: Addressed review comments from Ville
- add adaptor id for lspcon devices (0x08), use it to identify lspcon
- change function names
  old: drm_lspcon_get_current_mode/drm_lspcon_change_mode
  new: drm_lspcon_get_mode/drm_lspcon_set_mode
- change drm_lspcon_get_mode type to int, to match
  drm_dp_dual_mode_get_tmds_output
- change 'err' to 'ret' to match the rest of the functions
- remove pointless typecasting during call to dual_mode_read
- fix the but while setting value of data, while writing lspcon mode
- fix indentation
- change mdelay(10) -> msleep(10)
- return ETIMEDOUT instead of EFAULT, when lspcon mode change times out
- Add an empty line to separate std regs macros and lspcon regs macros
  Indent bit definition

v3: Addressed review comments from Rodrigo
- change macro name from DP_DUAL_MODE_TYPE_LSPCON to
  DP_DUAL_MODE_TYPE_HAS_DPCD for better readability
- change macro name from DP_DUAL_MODE_LSPCON_MODE_PCON to
  DP_DUAL_MODE_LSPCON_MODE_PCON for better readability
- add comment for MCA specific offsets like 0x40 and 0x41
- remove DP_DUAL_MODE_REV_TYPE2 check while checking lspcon adapter id

v4: Addressed review comments from Ville
- Fixed indentation at few places
- s/current_mode/mode
- s/reqd_mode/mode
- remove unnecessary void* cast
- remove drm_edid.h from includes
- Add a comment for _HAS_DPCD
- Fix enum description, for lspcon_mode.

v5: Rebase
v6: Rebase

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/drm_dp_dual_mode_helper.c | 103 ++++++++++++++++++++++++++++++
 include/drm/drm_dp_dual_mode_helper.h     |  26 ++++++++
 2 files changed, 129 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
index a7b2a75..a7aeb1e 100644
--- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
+++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
@@ -148,6 +148,14 @@ static bool is_type2_adaptor(uint8_t adaptor_id)
 			      DP_DUAL_MODE_REV_TYPE2);
 }
 
+bool is_lspcon_adaptor(const char hdmi_id[DP_DUAL_MODE_HDMI_ID_LEN],
+	const uint8_t adaptor_id)
+{
+	return is_hdmi_adaptor(hdmi_id) &&
+		(adaptor_id == (DP_DUAL_MODE_TYPE_TYPE2 |
+		 DP_DUAL_MODE_TYPE_HAS_DPCD));
+}
+
 /**
  * drm_dp_dual_mode_detect - Identify the DP dual mode adaptor
  * @adapter: I2C adapter for the DDC bus
@@ -203,6 +211,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
 	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
 				    &adaptor_id, sizeof(adaptor_id));
 	if (ret == 0) {
+		if (is_lspcon_adaptor(hdmi_id, adaptor_id))
+			return DRM_DP_DUAL_MODE_LSPCON;
 		if (is_type2_adaptor(adaptor_id)) {
 			if (is_hdmi_adaptor(hdmi_id))
 				return DRM_DP_DUAL_MODE_TYPE2_HDMI;
@@ -364,3 +374,96 @@ const char *drm_dp_get_dual_mode_type_name(enum drm_dp_dual_mode_type type)
 	}
 }
 EXPORT_SYMBOL(drm_dp_get_dual_mode_type_name);
+
+/**
+ * drm_lspcon_get_mode: Get LSPCON's current mode of operation by
+ * by reading offset (0x80, 0x41)
+ * @i2c_adapter: I2C-over-aux adapter
+ * @current_mode: out vaiable, current lspcon mode of operation
+ *
+ * Returns:
+ * 0 on success, sets the current_mode value to appropriate mode
+ * -error on failure
+ */
+int drm_lspcon_get_mode(struct i2c_adapter *adapter,
+			enum drm_lspcon_mode *mode)
+{
+	u8 data;
+	int ret = 0;
+
+	if (!mode) {
+		DRM_ERROR("NULL input\n");
+		return -EINVAL;
+	}
+
+	/* Read Status: i2c over aux */
+	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_LSPCON_CURRENT_MODE,
+				    &data, sizeof(data));
+	if (ret < 0) {
+		DRM_ERROR("LSPCON read(0x80, 0x41) failed\n");
+		return -EFAULT;
+	}
+
+	if (data & DP_DUAL_MODE_LSPCON_MODE_PCON)
+		*mode = DRM_LSPCON_MODE_PCON;
+	else
+		*mode = DRM_LSPCON_MODE_LS;
+	return 0;
+}
+EXPORT_SYMBOL(drm_lspcon_get_mode);
+
+/**
+ * drm_lspcon_change_mode: Change LSPCON's mode of operation by
+ * by writing offset (0x80, 0x40)
+ * @i2c_adapter: I2C-over-aux adapter
+ * @reqd_mode: required mode of operation
+ *
+ * Returns:
+ * 0 on success, -error on failure/timeout
+ */
+int drm_lspcon_set_mode(struct i2c_adapter *adapter,
+			enum drm_lspcon_mode mode)
+{
+	u8 data = 0;
+	int ret;
+	int time_out = 200;
+	enum drm_lspcon_mode current_mode;
+
+	if (mode == DRM_LSPCON_MODE_PCON)
+		data = DP_DUAL_MODE_LSPCON_MODE_PCON;
+
+	/* Change mode */
+	ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_LSPCON_MODE_CHANGE,
+				     &data, sizeof(data));
+	if (ret < 0) {
+		DRM_ERROR("LSPCON mode change failed\n");
+		return ret;
+	}
+
+	/*
+	 * 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.
+	 */
+	do {
+		ret = drm_lspcon_get_mode(adapter, &current_mode);
+		if (ret) {
+			DRM_ERROR("can't confirm LSPCON mode change\n");
+			return ret;
+		} else {
+			if (current_mode != mode) {
+				msleep(10);
+				time_out -= 10;
+			} else {
+				DRM_DEBUG_KMS("LSPCON mode changed to %s\n",
+						mode == DRM_LSPCON_MODE_LS ?
+						"LS" : "PCON");
+				return 0;
+			}
+		}
+	} while (time_out);
+
+	DRM_ERROR("LSPCON mode change timed out\n");
+	return -ETIMEDOUT;
+}
+EXPORT_SYMBOL(drm_lspcon_set_mode);
diff --git a/include/drm/drm_dp_dual_mode_helper.h b/include/drm/drm_dp_dual_mode_helper.h
index e8a9dfd..5567770 100644
--- a/include/drm/drm_dp_dual_mode_helper.h
+++ b/include/drm/drm_dp_dual_mode_helper.h
@@ -40,6 +40,8 @@
 #define  DP_DUAL_MODE_REV_TYPE2 0x00
 #define  DP_DUAL_MODE_TYPE_MASK 0xf0
 #define  DP_DUAL_MODE_TYPE_TYPE2 0xa0
+/* This field is marked reserved in dual mode spec, used in LSPCON */
+#define  DP_DUAL_MODE_TYPE_HAS_DPCD 0x08
 #define DP_DUAL_MODE_IEEE_OUI 0x11 /* 11-13*/
 #define  DP_DUAL_IEEE_OUI_LEN 3
 #define DP_DUAL_DEVICE_ID 0x14 /* 14-19 */
@@ -55,6 +57,11 @@
 #define  DP_DUAL_MODE_CEC_ENABLE 0x01
 #define DP_DUAL_MODE_I2C_SPEED_CTRL 0x22
 
+/* LSPCON specific registers, defined by MCA */
+#define DP_DUAL_MODE_LSPCON_MODE_CHANGE		0x40
+#define DP_DUAL_MODE_LSPCON_CURRENT_MODE		0x41
+#define  DP_DUAL_MODE_LSPCON_MODE_PCON			0x1
+
 struct i2c_adapter;
 
 ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter,
@@ -63,6 +70,19 @@ ssize_t drm_dp_dual_mode_write(struct i2c_adapter *adapter,
 			       u8 offset, const void *buffer, size_t size);
 
 /**
+* enum drm_lspcon_mode
+* @lspcon_mode_ls: Level shifter mode of LSPCON
+*	which drives DP++ to HDMI 1.4 conversion.
+* @lspcon_mode_pcon: Protocol converter mode of LSPCON
+*	which drives DP++ to HDMI 2.0 active conversion.
+*/
+enum drm_lspcon_mode {
+	DRM_LSPCON_MODE_INVALID,
+	DRM_LSPCON_MODE_LS,
+	DRM_LSPCON_MODE_PCON,
+};
+
+/**
  * enum drm_dp_dual_mode_type - Type of the DP dual mode adaptor
  * @DRM_DP_DUAL_MODE_NONE: No DP dual mode adaptor
  * @DRM_DP_DUAL_MODE_UNKNOWN: Could be either none or type 1 DVI adaptor
@@ -70,6 +90,7 @@ ssize_t drm_dp_dual_mode_write(struct i2c_adapter *adapter,
  * @DRM_DP_DUAL_MODE_TYPE1_HDMI: Type 1 HDMI adaptor
  * @DRM_DP_DUAL_MODE_TYPE2_DVI: Type 2 DVI adaptor
  * @DRM_DP_DUAL_MODE_TYPE2_HDMI: Type 2 HDMI adaptor
+ * @DRM_DP_DUAL_MODE_TYPE2_LSPCON: Level shifter /protocol converter
  */
 enum drm_dp_dual_mode_type {
 	DRM_DP_DUAL_MODE_NONE,
@@ -78,6 +99,7 @@ enum drm_dp_dual_mode_type {
 	DRM_DP_DUAL_MODE_TYPE1_HDMI,
 	DRM_DP_DUAL_MODE_TYPE2_DVI,
 	DRM_DP_DUAL_MODE_TYPE2_HDMI,
+	DRM_DP_DUAL_MODE_LSPCON,
 };
 
 enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter);
@@ -89,4 +111,8 @@ int drm_dp_dual_mode_set_tmds_output(enum drm_dp_dual_mode_type type,
 				     struct i2c_adapter *adapter, bool enable);
 const char *drm_dp_get_dual_mode_type_name(enum drm_dp_dual_mode_type type);
 
+int drm_lspcon_get_mode(struct i2c_adapter *adapter,
+			enum drm_lspcon_mode *current_mode);
+int drm_lspcon_set_mode(struct i2c_adapter *adapter,
+			enum drm_lspcon_mode reqd_mode);
 #endif
-- 
1.9.1

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

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

* [PATCH v6 2/5] drm/i915: Add lspcon support for I915 driver
  2016-10-14 14:26 [PATCH v6 0/5] Enable lspcon support for GEN9 devices Shashank Sharma
  2016-10-14 14:26 ` [PATCH v6 1/5] drm: Helper for lspcon in drm_dp_dual_mode Shashank Sharma
@ 2016-10-14 14:26 ` Shashank Sharma
  2016-10-14 14:26 ` [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon Shashank Sharma
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Shashank Sharma @ 2016-10-14 14:26 UTC (permalink / raw)
  To: imre.deak; +Cc: daniel.vetter, intel-gfx

This patch adds a new file, to accommodate lspcon support
for I915 driver. These functions probe, detect, initialize
and configure an on-board lspcon device during the driver
init time.

Also, this patch adds a small structure for lspcon device,
which will provide the runtime status of the device.

V2: addressed ville's review comments
- Clean the leftover macros from previous patch set

V3: Rebase
V4: addressed ville's review comments
- make internal functions static
- remove lspcon_detect_identifier, make it inline with lspcon_probe
- remove is_lspcon_active function
- remove force check while setting a lspcon mode

V5: Rebase
V6: Pass dev_priv to IS_GEN9 check

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Akashdeep Sharma <akashdeep.sharma@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/Makefile       |   1 +
 drivers/gpu/drm/i915/intel_drv.h    |   9 +++
 drivers/gpu/drm/i915/intel_lspcon.c | 128 ++++++++++++++++++++++++++++++++++++
 3 files changed, 138 insertions(+)
 create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 8790ae4..6123400 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -101,6 +101,7 @@ i915-y += dvo_ch7017.o \
 	  intel_dvo.o \
 	  intel_hdmi.o \
 	  intel_i2c.o \
+	  intel_lspcon.o \
 	  intel_lvds.o \
 	  intel_panel.o \
 	  intel_sdvo.o \
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index a885b2a..abff78f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -953,12 +953,19 @@ struct intel_dp {
 	bool compliance_test_active;
 };
 
+struct intel_lspcon {
+	bool active;
+	enum drm_lspcon_mode mode;
+	struct drm_dp_aux *aux;
+};
+
 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;
@@ -1841,4 +1848,6 @@ int intel_color_check(struct drm_crtc *crtc, struct drm_crtc_state *state);
 void intel_color_set_csc(struct drm_crtc_state *crtc_state);
 void intel_color_load_luts(struct drm_crtc_state *crtc_state);
 
+/* intel_lspcon.c */
+bool lspcon_init(struct intel_digital_port *intel_dig_port);
 #endif /* __INTEL_DRV_H__ */
diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
new file mode 100644
index 0000000..628ae6fb
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_lspcon.c
@@ -0,0 +1,128 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ *
+ */
+#include <drm/drm_edid.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_dp_dual_mode_helper.h>
+#include "intel_drv.h"
+
+enum drm_lspcon_mode lspcon_get_current_mode(struct intel_lspcon *lspcon)
+{
+	enum drm_lspcon_mode current_mode = DRM_LSPCON_MODE_INVALID;
+	struct i2c_adapter *adapter = &lspcon->aux->ddc;
+
+	if (drm_lspcon_get_mode(adapter, &current_mode))
+		DRM_ERROR("Error reading LSPCON mode\n");
+	else
+		DRM_DEBUG_KMS("Current LSPCON mode %s\n",
+			current_mode == DRM_LSPCON_MODE_PCON ? "PCON" : "LS");
+	return current_mode;
+}
+
+static int lspcon_change_mode(struct intel_lspcon *lspcon,
+	enum drm_lspcon_mode mode, bool force)
+{
+	int err;
+	enum drm_lspcon_mode current_mode;
+	struct i2c_adapter *adapter = &lspcon->aux->ddc;
+
+	err = drm_lspcon_get_mode(adapter, &current_mode);
+	if (err) {
+		DRM_ERROR("Error reading LSPCON mode\n");
+		return err;
+	}
+
+	if (current_mode == mode) {
+		DRM_DEBUG_KMS("Current mode = desired LSPCON mode\n");
+		return 0;
+	}
+
+	err = drm_lspcon_set_mode(adapter, mode);
+	if (err < 0) {
+		DRM_ERROR("LSPCON mode change failed\n");
+		return err;
+	}
+
+	lspcon->mode = mode;
+	DRM_DEBUG_KMS("LSPCON mode changed done\n");
+	return 0;
+}
+
+static bool lspcon_probe(struct intel_lspcon *lspcon)
+{
+	enum drm_dp_dual_mode_type adaptor_type;
+	struct i2c_adapter *adapter = &lspcon->aux->ddc;
+
+	/* Lets probe the adaptor and check its type */
+	adaptor_type = drm_dp_dual_mode_detect(adapter);
+	if (adaptor_type != DRM_DP_DUAL_MODE_LSPCON) {
+		DRM_DEBUG_KMS("No LSPCON detected, found %s\n",
+			drm_dp_get_dual_mode_type_name(adaptor_type));
+		return false;
+	}
+
+	/* Yay ... got a LSPCON device */
+	DRM_DEBUG_KMS("LSPCON detected\n");
+	lspcon->mode = lspcon_get_current_mode(lspcon);
+	lspcon->active = true;
+	return true;
+}
+
+bool lspcon_init(struct intel_digital_port *intel_dig_port)
+{
+	struct intel_dp *dp = &intel_dig_port->dp;
+	struct intel_lspcon *lspcon = &intel_dig_port->lspcon;
+	struct drm_device *dev = intel_dig_port->base.base.dev;
+	struct drm_i915_private *dev_priv = to_i915(dev);
+
+	if (!IS_GEN9(dev_priv)) {
+		DRM_ERROR("LSPCON is supported on GEN9 only\n");
+		return false;
+	}
+
+	lspcon->active = false;
+	lspcon->mode = DRM_LSPCON_MODE_INVALID;
+	lspcon->aux = &dp->aux;
+
+	if (!lspcon_probe(lspcon)) {
+		DRM_ERROR("Failed to probe lspcon\n");
+		return false;
+	}
+
+	/*
+	* In the SW state machine, lets Put LSPCON in PCON mode only.
+	* In this way, it will work with both HDMI 1.4 sinks as well as HDMI
+	* 2.0 sinks.
+	*/
+	if (lspcon->active && lspcon->mode != DRM_LSPCON_MODE_PCON) {
+		if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON,
+			true) < 0) {
+			DRM_ERROR("LSPCON mode change to PCON failed\n");
+			return false;
+		}
+	}
+
+	DRM_DEBUG_KMS("Success: LSPCON init\n");
+	return true;
+}
-- 
1.9.1

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

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

* [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon
  2016-10-14 14:26 [PATCH v6 0/5] Enable lspcon support for GEN9 devices Shashank Sharma
  2016-10-14 14:26 ` [PATCH v6 1/5] drm: Helper for lspcon in drm_dp_dual_mode Shashank Sharma
  2016-10-14 14:26 ` [PATCH v6 2/5] drm/i915: Add lspcon support for I915 driver Shashank Sharma
@ 2016-10-14 14:26 ` Shashank Sharma
  2016-10-14 14:32   ` Jani Nikula
  2016-10-14 14:26 ` [PATCH v6 4/5] drm/i915: Enable lspcon initialization Shashank Sharma
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Shashank Sharma @ 2016-10-14 14:26 UTC (permalink / raw)
  To: imre.deak; +Cc: daniel.vetter, intel-gfx

Many GEN9 boards come with on-board lspcon cards.
Fot these boards, VBT configuration should properly point out
if a particular port contains lspcon device, so that driver can
initialize it properly.

This patch adds a utility function, which checks the VBT flag
for lspcon bit, and tells us if a port is configured to have a
lspcon device or not.

V2: Fixed review comments from Ville
- Do not forget PORT_D while checking lspcon for GEN9

V3: Addressed review comments from Rodrigo
- Create a HAS_LSPCON() macro for better use case handling.
- Do not dump warnings for non-gen-9 platforms, it will be noise.

V4: Rebase
V5: Rebase
V6: Pass dev_priv to HAS_LSPCON() macro

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h   |  5 ++++
 drivers/gpu/drm/i915/intel_bios.c | 49 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index fe875b2..7bab2f1 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2864,6 +2864,8 @@ struct drm_i915_cmd_table {
 
 #define HAS_GMCH_DISPLAY(dev_priv) ((dev_priv)->info.has_gmch_display)
 
+#define HAS_LSPCON(dev_priv) (IS_GEN9(dev_priv))
+
 /* DPF == dynamic parity feature */
 #define HAS_L3_DPF(dev_priv) ((dev_priv)->info.has_l3_dpf)
 #define NUM_L3_SLICES(dev_priv) (IS_HSW_GT3(dev_priv) ? \
@@ -3631,6 +3633,9 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por
 bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
 bool intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
 				     enum port port);
+bool intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
+				enum port port);
+
 
 /* intel_opregion.c */
 #ifdef CONFIG_ACPI
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 83667e8..32e1def 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -1763,3 +1763,52 @@ intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
 
 	return false;
 }
+
+/**
+ * intel_bios_is_lspcon_present - if LSPCON is attached on %port
+ * @dev_priv:	i915 device instance
+ * @port:	port to check
+ *
+ * Return true if LSPCON is present on this port
+ */
+bool
+intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
+				enum port port)
+{
+	int i;
+
+	if (!HAS_LSPCON(dev_priv))
+		return false;
+
+	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
+		if (!dev_priv->vbt.child_dev[i].common.lspcon)
+			continue;
+
+		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
+		case DVO_PORT_DPA:
+		case DVO_PORT_HDMIA:
+			if (port == PORT_A)
+				return true;
+			break;
+		case DVO_PORT_DPB:
+		case DVO_PORT_HDMIB:
+			if (port == PORT_B)
+				return true;
+			break;
+		case DVO_PORT_DPC:
+		case DVO_PORT_HDMIC:
+			if (port == PORT_C)
+				return true;
+			break;
+		case DVO_PORT_DPD:
+		case DVO_PORT_HDMID:
+			if (port == PORT_D)
+				return true;
+			break;
+		default:
+			break;
+		}
+	}
+
+	return false;
+}
-- 
1.9.1

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

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

* [PATCH v6 4/5] drm/i915: Enable lspcon initialization
  2016-10-14 14:26 [PATCH v6 0/5] Enable lspcon support for GEN9 devices Shashank Sharma
                   ` (2 preceding siblings ...)
  2016-10-14 14:26 ` [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon Shashank Sharma
@ 2016-10-14 14:26 ` Shashank Sharma
  2016-10-14 14:26 ` [PATCH v6 5/5] drm/i915: Add lspcon resume function Shashank Sharma
  2016-10-14 16:53 ` ✗ Fi.CI.BAT: warning for Enable lspcon support for GEN9 devices (rev6) Patchwork
  5 siblings, 0 replies; 12+ messages in thread
From: Shashank Sharma @ 2016-10-14 14:26 UTC (permalink / raw)
  To: imre.deak; +Cc: daniel.vetter, intel-gfx

This patch adds initialization code for lspcon.
What we are doing here is:
	- Check if lspcon is configured in VBT for this port
	- If lspcon is configured, initialize it and configure it
          as DP port.

V2: Addressed Ville's review comments:
- Not adding AVI IF functions for LSPCON display now.
  This part will be added once the dig_port level AVI-IF series
  gets merged.

V3: Rebase
V4: Rebase
V5: Rebase
V6: Rebase

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index a76afd7..7f7741c 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2438,7 +2438,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 	struct intel_digital_port *intel_dig_port;
 	struct intel_encoder *intel_encoder;
 	struct drm_encoder *encoder;
-	bool init_hdmi, init_dp;
+	bool init_hdmi, init_dp, init_lspcon = false;
 	int max_lanes;
 
 	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
@@ -2470,6 +2470,19 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
 		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
 	init_dp = dev_priv->vbt.ddi_port_info[port].supports_dp;
+
+	if (intel_bios_is_lspcon_present(dev_priv, port)) {
+		/*
+		 * Lspcon device needs to be driven with DP connector
+		 * with special detection sequence. So make sure DP
+		 * is initialized before lspcon.
+		 */
+		init_dp = true;
+		init_lspcon = true;
+		init_hdmi = false;
+		DRM_DEBUG_KMS("VBT says port %c has lspcon\n", port_name(port));
+	}
+
 	if (!init_dp && !init_hdmi) {
 		DRM_DEBUG_KMS("VBT says port %c is not DVI/HDMI/DP compatible, respect it\n",
 			      port_name(port));
@@ -2546,6 +2559,20 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 			goto err;
 	}
 
+	if (init_lspcon) {
+		if (lspcon_init(intel_dig_port))
+			/* TODO: handle hdmi info frame part */
+			DRM_DEBUG_KMS("LSPCON init success on port %c\n",
+				port_name(port));
+		else
+			/*
+			 * LSPCON init faied, but DP init was success, so
+			 * lets try to drive as DP++ port.
+			 */
+			DRM_ERROR("LSPCON init failed on port %c\n",
+				port_name(port));
+	}
+
 	return;
 
 err:
-- 
1.9.1

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

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

* [PATCH v6 5/5] drm/i915: Add lspcon resume function
  2016-10-14 14:26 [PATCH v6 0/5] Enable lspcon support for GEN9 devices Shashank Sharma
                   ` (3 preceding siblings ...)
  2016-10-14 14:26 ` [PATCH v6 4/5] drm/i915: Enable lspcon initialization Shashank Sharma
@ 2016-10-14 14:26 ` Shashank Sharma
  2016-10-17 10:42   ` Imre Deak
  2016-10-14 16:53 ` ✗ Fi.CI.BAT: warning for Enable lspcon support for GEN9 devices (rev6) Patchwork
  5 siblings, 1 reply; 12+ messages in thread
From: Shashank Sharma @ 2016-10-14 14:26 UTC (permalink / raw)
  To: imre.deak; +Cc: daniel.vetter, intel-gfx

As per the software design, we are driving lspcon in
PCON mode. But while resuming from suspend, lspcon can go
in LS mode (which is its default operating mode on power on)

This patch adds a resume function for lspcon, which makes sure
its operating in PCON mode, post resume.

V2: Address review comments from Imre
	- move lspcon_resume call to encoder->reset()
	- use early returns

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c     | 7 ++++++-
 drivers/gpu/drm/i915/intel_drv.h    | 1 +
 drivers/gpu/drm/i915/intel_lspcon.c | 8 ++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index bc03f61..25f4060 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4755,11 +4755,16 @@ static void intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp)
 void intel_dp_encoder_reset(struct drm_encoder *encoder)
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->dev);
-	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+	struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
+	struct intel_lspcon *lspcon = &intel_dig_port->lspcon;
+	struct intel_dp *intel_dp = &intel_dig_port->dp;
 
 	if (!HAS_DDI(dev_priv))
 		intel_dp->DP = I915_READ(intel_dp->output_reg);
 
+	if (IS_GEN9(dev_priv) && lspcon->active)
+		lspcon_resume(lspcon);
+
 	if (to_intel_encoder(encoder)->type != INTEL_OUTPUT_EDP)
 		return;
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index abff78f..0d0de3a 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1850,4 +1850,5 @@ void intel_color_load_luts(struct drm_crtc_state *crtc_state);
 
 /* intel_lspcon.c */
 bool lspcon_init(struct intel_digital_port *intel_dig_port);
+void lspcon_resume(struct intel_lspcon *lspcon);
 #endif /* __INTEL_DRV_H__ */
diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
index 628ae6fb..d606f1a 100644
--- a/drivers/gpu/drm/i915/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/intel_lspcon.c
@@ -89,6 +89,14 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
 	return true;
 }
 
+void lspcon_resume(struct intel_lspcon *lspcon)
+{
+	if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON, true))
+		DRM_ERROR("LSPCON resume failed\n");
+	else
+		DRM_DEBUG_KMS("LSPCON resume success\n");
+}
+
 bool lspcon_init(struct intel_digital_port *intel_dig_port)
 {
 	struct intel_dp *dp = &intel_dig_port->dp;
-- 
1.9.1

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

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

* Re: [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon
  2016-10-14 14:26 ` [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon Shashank Sharma
@ 2016-10-14 14:32   ` Jani Nikula
  2016-10-14 16:33     ` Sharma, Shashank
  0 siblings, 1 reply; 12+ messages in thread
From: Jani Nikula @ 2016-10-14 14:32 UTC (permalink / raw)
  To: Shashank Sharma, imre.deak; +Cc: daniel.vetter, intel-gfx

On Fri, 14 Oct 2016, Shashank Sharma <shashank.sharma@intel.com> wrote:
> Many GEN9 boards come with on-board lspcon cards.
> Fot these boards, VBT configuration should properly point out
> if a particular port contains lspcon device, so that driver can
> initialize it properly.
>
> This patch adds a utility function, which checks the VBT flag
> for lspcon bit, and tells us if a port is configured to have a
> lspcon device or not.
>
> V2: Fixed review comments from Ville
> - Do not forget PORT_D while checking lspcon for GEN9
>
> V3: Addressed review comments from Rodrigo
> - Create a HAS_LSPCON() macro for better use case handling.
> - Do not dump warnings for non-gen-9 platforms, it will be noise.
>
> V4: Rebase
> V5: Rebase
> V6: Pass dev_priv to HAS_LSPCON() macro
>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

I was hoping you'd use the version I rebased and sent, put it first in
the series, and rebase the rest on that. The point is, this series has
taken so long that lspcon devices have proliferated all over the place,
and we'll be getting more and more bugs about them. If this patch was
first, with the debug logging, we could at least get that to 4.9, maybe
stable kernels, and we'd immediately know the reason. I think it'll be a
hard sell to get the whole series to 4.9 kernel.

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/i915_drv.h   |  5 ++++
>  drivers/gpu/drm/i915/intel_bios.c | 49 +++++++++++++++++++++++++++++++++++++++
>  2 files changed, 54 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index fe875b2..7bab2f1 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2864,6 +2864,8 @@ struct drm_i915_cmd_table {
>  
>  #define HAS_GMCH_DISPLAY(dev_priv) ((dev_priv)->info.has_gmch_display)
>  
> +#define HAS_LSPCON(dev_priv) (IS_GEN9(dev_priv))
> +
>  /* DPF == dynamic parity feature */
>  #define HAS_L3_DPF(dev_priv) ((dev_priv)->info.has_l3_dpf)
>  #define NUM_L3_SLICES(dev_priv) (IS_HSW_GT3(dev_priv) ? \
> @@ -3631,6 +3633,9 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por
>  bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
>  bool intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
>  				     enum port port);
> +bool intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
> +				enum port port);
> +
>  
>  /* intel_opregion.c */
>  #ifdef CONFIG_ACPI
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 83667e8..32e1def 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -1763,3 +1763,52 @@ intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
>  
>  	return false;
>  }
> +
> +/**
> + * intel_bios_is_lspcon_present - if LSPCON is attached on %port
> + * @dev_priv:	i915 device instance
> + * @port:	port to check
> + *
> + * Return true if LSPCON is present on this port
> + */
> +bool
> +intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
> +				enum port port)
> +{
> +	int i;
> +
> +	if (!HAS_LSPCON(dev_priv))
> +		return false;
> +
> +	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
> +		if (!dev_priv->vbt.child_dev[i].common.lspcon)
> +			continue;
> +
> +		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
> +		case DVO_PORT_DPA:
> +		case DVO_PORT_HDMIA:
> +			if (port == PORT_A)
> +				return true;
> +			break;
> +		case DVO_PORT_DPB:
> +		case DVO_PORT_HDMIB:
> +			if (port == PORT_B)
> +				return true;
> +			break;
> +		case DVO_PORT_DPC:
> +		case DVO_PORT_HDMIC:
> +			if (port == PORT_C)
> +				return true;
> +			break;
> +		case DVO_PORT_DPD:
> +		case DVO_PORT_HDMID:
> +			if (port == PORT_D)
> +				return true;
> +			break;
> +		default:
> +			break;
> +		}
> +	}
> +
> +	return false;
> +}

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon
  2016-10-14 14:32   ` Jani Nikula
@ 2016-10-14 16:33     ` Sharma, Shashank
  2016-10-17 12:34       ` Jani Nikula
  0 siblings, 1 reply; 12+ messages in thread
From: Sharma, Shashank @ 2016-10-14 16:33 UTC (permalink / raw)
  To: Jani Nikula, imre.deak; +Cc: daniel.vetter, intel-gfx

Regards

Shashank


On 10/14/2016 8:02 PM, Jani Nikula wrote:
> On Fri, 14 Oct 2016, Shashank Sharma <shashank.sharma@intel.com> wrote:
>> Many GEN9 boards come with on-board lspcon cards.
>> Fot these boards, VBT configuration should properly point out
>> if a particular port contains lspcon device, so that driver can
>> initialize it properly.
>>
>> This patch adds a utility function, which checks the VBT flag
>> for lspcon bit, and tells us if a port is configured to have a
>> lspcon device or not.
>>
>> V2: Fixed review comments from Ville
>> - Do not forget PORT_D while checking lspcon for GEN9
>>
>> V3: Addressed review comments from Rodrigo
>> - Create a HAS_LSPCON() macro for better use case handling.
>> - Do not dump warnings for non-gen-9 platforms, it will be noise.
>>
>> V4: Rebase
>> V5: Rebase
>> V6: Pass dev_priv to HAS_LSPCON() macro
>>
>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> I was hoping you'd use the version I rebased and sent, put it first in
> the series, and rebase the rest on that. The point is, this series has
> taken so long that lspcon devices have proliferated all over the place,
> and we'll be getting more and more bugs about them. If this patch was
> first, with the debug logging, we could at least get that to 4.9, maybe
> stable kernels, and we'd immediately know the reason. I think it'll be a
> hard sell to get the whole series to 4.9 kernel.
>
> BR,
> Jani.
Jani,
The patch got its first r-b since a long time.
After that, it was waiting to be merged, for long time.

Recently, when Imre was asked to test the patches, and he found one 
issue specific to APL.
We were trying to fix a suspend-resume issue, which was fixed with the 
last patch.
Now this patch is ready to be merged, just waiting for Imre's r-b.

Third patch just gives information about if LSPCON is available or not, 
which is not a big help for anything as such.
So instead of changing the sequence, and confusing the reviewers, I 
thought it would be better to send the whole series and
get this merged as-it-is.

Regards
Shashank
>
>> ---
>>   drivers/gpu/drm/i915/i915_drv.h   |  5 ++++
>>   drivers/gpu/drm/i915/intel_bios.c | 49 +++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 54 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> index fe875b2..7bab2f1 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -2864,6 +2864,8 @@ struct drm_i915_cmd_table {
>>   
>>   #define HAS_GMCH_DISPLAY(dev_priv) ((dev_priv)->info.has_gmch_display)
>>   
>> +#define HAS_LSPCON(dev_priv) (IS_GEN9(dev_priv))
>> +
>>   /* DPF == dynamic parity feature */
>>   #define HAS_L3_DPF(dev_priv) ((dev_priv)->info.has_l3_dpf)
>>   #define NUM_L3_SLICES(dev_priv) (IS_HSW_GT3(dev_priv) ? \
>> @@ -3631,6 +3633,9 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por
>>   bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
>>   bool intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
>>   				     enum port port);
>> +bool intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
>> +				enum port port);
>> +
>>   
>>   /* intel_opregion.c */
>>   #ifdef CONFIG_ACPI
>> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
>> index 83667e8..32e1def 100644
>> --- a/drivers/gpu/drm/i915/intel_bios.c
>> +++ b/drivers/gpu/drm/i915/intel_bios.c
>> @@ -1763,3 +1763,52 @@ intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
>>   
>>   	return false;
>>   }
>> +
>> +/**
>> + * intel_bios_is_lspcon_present - if LSPCON is attached on %port
>> + * @dev_priv:	i915 device instance
>> + * @port:	port to check
>> + *
>> + * Return true if LSPCON is present on this port
>> + */
>> +bool
>> +intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
>> +				enum port port)
>> +{
>> +	int i;
>> +
>> +	if (!HAS_LSPCON(dev_priv))
>> +		return false;
>> +
>> +	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
>> +		if (!dev_priv->vbt.child_dev[i].common.lspcon)
>> +			continue;
>> +
>> +		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
>> +		case DVO_PORT_DPA:
>> +		case DVO_PORT_HDMIA:
>> +			if (port == PORT_A)
>> +				return true;
>> +			break;
>> +		case DVO_PORT_DPB:
>> +		case DVO_PORT_HDMIB:
>> +			if (port == PORT_B)
>> +				return true;
>> +			break;
>> +		case DVO_PORT_DPC:
>> +		case DVO_PORT_HDMIC:
>> +			if (port == PORT_C)
>> +				return true;
>> +			break;
>> +		case DVO_PORT_DPD:
>> +		case DVO_PORT_HDMID:
>> +			if (port == PORT_D)
>> +				return true;
>> +			break;
>> +		default:
>> +			break;
>> +		}
>> +	}
>> +
>> +	return false;
>> +}

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

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

* ✗ Fi.CI.BAT: warning for Enable lspcon support for GEN9 devices (rev6)
  2016-10-14 14:26 [PATCH v6 0/5] Enable lspcon support for GEN9 devices Shashank Sharma
                   ` (4 preceding siblings ...)
  2016-10-14 14:26 ` [PATCH v6 5/5] drm/i915: Add lspcon resume function Shashank Sharma
@ 2016-10-14 16:53 ` Patchwork
  5 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2016-10-14 16:53 UTC (permalink / raw)
  To: Shashank Sharma; +Cc: intel-gfx

== Series Details ==

Series: Enable lspcon support for GEN9 devices (rev6)
URL   : https://patchwork.freedesktop.org/series/8024/
State : warning

== Summary ==

Series 8024v6 Enable lspcon support for GEN9 devices
https://patchwork.freedesktop.org/api/1.0/series/8024/revisions/6/mbox/

Test gem_exec_suspend:
        Subgroup basic-s3:
                dmesg-warn -> PASS       (fi-skl-6770hq)
                pass       -> DMESG-WARN (fi-skl-6700hq)
Test kms_busy:
        Subgroup basic-flip-default-a:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-flip-default-b:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-flip-default-c:
                pass       -> DMESG-WARN (fi-skl-6770hq)
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-busy-flip-before-cursor-varying-size:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-flip-after-cursor-legacy:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-flip-after-cursor-varying-size:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-flip-before-cursor-legacy:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-flip-before-cursor-varying-size:
                pass       -> DMESG-WARN (fi-skl-6770hq)
Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-flip-vs-modeset:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-plain-flip:
                pass       -> DMESG-WARN (fi-skl-6770hq)
Test kms_frontbuffer_tracking:
        Subgroup basic:
                fail       -> DMESG-WARN (fi-skl-6770hq)
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup hang-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup hang-read-crc-pipe-c:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup nonblocking-crc-pipe-a:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup nonblocking-crc-pipe-b:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup nonblocking-crc-pipe-b-frame-sequence:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup nonblocking-crc-pipe-c:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup read-crc-pipe-a-frame-sequence:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup read-crc-pipe-c:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup read-crc-pipe-c-frame-sequence:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup suspend-read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-skl-6770hq)
                pass       -> DMESG-WARN (fi-skl-6700hq)
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-skl-6770hq)
                pass       -> DMESG-WARN (fi-skl-6700hq)
                pass       -> DMESG-WARN (fi-byt-j1900)
        Subgroup suspend-read-crc-pipe-c:
                pass       -> DMESG-WARN (fi-skl-6770hq)
                pass       -> DMESG-WARN (fi-skl-6700hq)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> DMESG-WARN (fi-skl-6770hq)
        Subgroup basic-rte:
                pass       -> DMESG-WARN (fi-skl-6770hq)
Test prime_vgem:
        Subgroup basic-fence-flip:
                pass       -> DMESG-WARN (fi-skl-6770hq)
Test vgem_basic:
        Subgroup unload:
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-hsw-4770)
                skip       -> PASS       (fi-skl-6700k)
                skip       -> PASS       (fi-kbl-7200u)

fi-bdw-5557u     total:246  pass:231  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:246  pass:204  dwarn:0   dfail:0   fail:0   skip:42 
fi-bxt-t5700     total:246  pass:216  dwarn:0   dfail:0   fail:0   skip:30 
fi-byt-j1900     total:246  pass:213  dwarn:1   dfail:0   fail:1   skip:31 
fi-byt-n2820     total:246  pass:210  dwarn:0   dfail:0   fail:1   skip:35 
fi-hsw-4770      total:246  pass:223  dwarn:0   dfail:0   fail:0   skip:23 
fi-hsw-4770r     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
WARNING: Long output truncated

Results at /archive/results/CI_IGT_test/Patchwork_2724/

e086610ff079f1bf1fe91d4ab175443590cacb8d drm-intel-nightly: 2016y-10m-14d-11h-43m-09s UTC integration manifest
dcd064b drm/i915: Add lspcon resume function
272f741 drm/i915: Enable lspcon initialization
e8f2580 drm/i915: Parse VBT data for lspcon
f2872bb drm/i915: Add lspcon support for I915 driver
7363f2f drm: Helper for lspcon in drm_dp_dual_mode

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

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

* Re: [PATCH v6 5/5] drm/i915: Add lspcon resume function
  2016-10-14 14:26 ` [PATCH v6 5/5] drm/i915: Add lspcon resume function Shashank Sharma
@ 2016-10-17 10:42   ` Imre Deak
  0 siblings, 0 replies; 12+ messages in thread
From: Imre Deak @ 2016-10-17 10:42 UTC (permalink / raw)
  To: Shashank Sharma; +Cc: daniel.vetter, intel-gfx

On pe, 2016-10-14 at 19:56 +0530, Shashank Sharma wrote:
> As per the software design, we are driving lspcon in
> PCON mode. But while resuming from suspend, lspcon can go
> in LS mode (which is its default operating mode on power on)
> 
> This patch adds a resume function for lspcon, which makes sure
> its operating in PCON mode, post resume.
> 
> V2: Address review comments from Imre
> 	- move lspcon_resume call to encoder->reset()
> 	- use early returns
> 
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>

Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_dp.c     | 7 ++++++-
>  drivers/gpu/drm/i915/intel_drv.h    | 1 +
>  drivers/gpu/drm/i915/intel_lspcon.c | 8 ++++++++
>  3 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index bc03f61..25f4060 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4755,11 +4755,16 @@ static void
> intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp)
>  void intel_dp_encoder_reset(struct drm_encoder *encoder)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->dev);
> -	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> +	struct intel_digital_port *intel_dig_port =
> enc_to_dig_port(encoder);
> +	struct intel_lspcon *lspcon = &intel_dig_port->lspcon;
> +	struct intel_dp *intel_dp = &intel_dig_port->dp;
>  
>  	if (!HAS_DDI(dev_priv))
>  		intel_dp->DP = I915_READ(intel_dp->output_reg);
>  
> +	if (IS_GEN9(dev_priv) && lspcon->active)
> +		lspcon_resume(lspcon);
> +
>  	if (to_intel_encoder(encoder)->type != INTEL_OUTPUT_EDP)
>  		return;
>  
> diff --git a/drivers/gpu/drm/i915/intel_drv.h
> b/drivers/gpu/drm/i915/intel_drv.h
> index abff78f..0d0de3a 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1850,4 +1850,5 @@ void intel_color_load_luts(struct
> drm_crtc_state *crtc_state);
>  
>  /* intel_lspcon.c */
>  bool lspcon_init(struct intel_digital_port *intel_dig_port);
> +void lspcon_resume(struct intel_lspcon *lspcon);
>  #endif /* __INTEL_DRV_H__ */
> diff --git a/drivers/gpu/drm/i915/intel_lspcon.c
> b/drivers/gpu/drm/i915/intel_lspcon.c
> index 628ae6fb..d606f1a 100644
> --- a/drivers/gpu/drm/i915/intel_lspcon.c
> +++ b/drivers/gpu/drm/i915/intel_lspcon.c
> @@ -89,6 +89,14 @@ static bool lspcon_probe(struct intel_lspcon
> *lspcon)
>  	return true;
>  }
>  
> +void lspcon_resume(struct intel_lspcon *lspcon)
> +{
> +	if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON, true))
> +		DRM_ERROR("LSPCON resume failed\n");
> +	else
> +		DRM_DEBUG_KMS("LSPCON resume success\n");
> +}
> +
>  bool lspcon_init(struct intel_digital_port *intel_dig_port)
>  {
>  	struct intel_dp *dp = &intel_dig_port->dp;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon
  2016-10-14 16:33     ` Sharma, Shashank
@ 2016-10-17 12:34       ` Jani Nikula
  2016-10-17 13:53         ` Sharma, Shashank
  0 siblings, 1 reply; 12+ messages in thread
From: Jani Nikula @ 2016-10-17 12:34 UTC (permalink / raw)
  To: Sharma, Shashank, imre.deak; +Cc: daniel.vetter, intel-gfx

On Fri, 14 Oct 2016, "Sharma, Shashank" <shashank.sharma@intel.com> wrote:
> Regards
>
> Shashank
>
>
> On 10/14/2016 8:02 PM, Jani Nikula wrote:
>> On Fri, 14 Oct 2016, Shashank Sharma <shashank.sharma@intel.com> wrote:
>>> Many GEN9 boards come with on-board lspcon cards.
>>> Fot these boards, VBT configuration should properly point out
>>> if a particular port contains lspcon device, so that driver can
>>> initialize it properly.
>>>
>>> This patch adds a utility function, which checks the VBT flag
>>> for lspcon bit, and tells us if a port is configured to have a
>>> lspcon device or not.
>>>
>>> V2: Fixed review comments from Ville
>>> - Do not forget PORT_D while checking lspcon for GEN9
>>>
>>> V3: Addressed review comments from Rodrigo
>>> - Create a HAS_LSPCON() macro for better use case handling.
>>> - Do not dump warnings for non-gen-9 platforms, it will be noise.
>>>
>>> V4: Rebase
>>> V5: Rebase
>>> V6: Pass dev_priv to HAS_LSPCON() macro
>>>
>>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>>> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> I was hoping you'd use the version I rebased and sent, put it first in
>> the series, and rebase the rest on that. The point is, this series has
>> taken so long that lspcon devices have proliferated all over the place,
>> and we'll be getting more and more bugs about them. If this patch was
>> first, with the debug logging, we could at least get that to 4.9, maybe
>> stable kernels, and we'd immediately know the reason. I think it'll be a
>> hard sell to get the whole series to 4.9 kernel.
>>
>> BR,
>> Jani.
> Jani,
> The patch got its first r-b since a long time.
> After that, it was waiting to be merged, for long time.
>
> Recently, when Imre was asked to test the patches, and he found one 
> issue specific to APL.
> We were trying to fix a suspend-resume issue, which was fixed with the 
> last patch.
> Now this patch is ready to be merged, just waiting for Imre's r-b.
>
> Third patch just gives information about if LSPCON is available or not, 
> which is not a big help for anything as such.
> So instead of changing the sequence, and confusing the reviewers, I 
> thought it would be better to send the whole series and
> get this merged as-it-is.

Fine, let's merge this as-is... after patch 1/5 has been posted to
dri-devel and/or has received an ack from Dave Airlie that it's fine to
merge through our tree.

In the bigger scheme of things, if this patch 3/5 had been first in the
series all along, we could have merged this *months* ago. This is how
series should be organized. Simple things first.

Having the debug information *is* valuable. You'd see that if you had to
go through our incoming bugs. We've had plenty of LSPCON bugs since the
day Skylake was launched. Yes, quite a long time now. If 3/5 was first
in the series, we could backport that to v4.9 and older and reduce our
debugging time.

BR,
Jani.






>
> Regards
> Shashank
>>
>>> ---
>>>   drivers/gpu/drm/i915/i915_drv.h   |  5 ++++
>>>   drivers/gpu/drm/i915/intel_bios.c | 49 +++++++++++++++++++++++++++++++++++++++
>>>   2 files changed, 54 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>>> index fe875b2..7bab2f1 100644
>>> --- a/drivers/gpu/drm/i915/i915_drv.h
>>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>>> @@ -2864,6 +2864,8 @@ struct drm_i915_cmd_table {
>>>   
>>>   #define HAS_GMCH_DISPLAY(dev_priv) ((dev_priv)->info.has_gmch_display)
>>>   
>>> +#define HAS_LSPCON(dev_priv) (IS_GEN9(dev_priv))
>>> +
>>>   /* DPF == dynamic parity feature */
>>>   #define HAS_L3_DPF(dev_priv) ((dev_priv)->info.has_l3_dpf)
>>>   #define NUM_L3_SLICES(dev_priv) (IS_HSW_GT3(dev_priv) ? \
>>> @@ -3631,6 +3633,9 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por
>>>   bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
>>>   bool intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
>>>   				     enum port port);
>>> +bool intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
>>> +				enum port port);
>>> +
>>>   
>>>   /* intel_opregion.c */
>>>   #ifdef CONFIG_ACPI
>>> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
>>> index 83667e8..32e1def 100644
>>> --- a/drivers/gpu/drm/i915/intel_bios.c
>>> +++ b/drivers/gpu/drm/i915/intel_bios.c
>>> @@ -1763,3 +1763,52 @@ intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
>>>   
>>>   	return false;
>>>   }
>>> +
>>> +/**
>>> + * intel_bios_is_lspcon_present - if LSPCON is attached on %port
>>> + * @dev_priv:	i915 device instance
>>> + * @port:	port to check
>>> + *
>>> + * Return true if LSPCON is present on this port
>>> + */
>>> +bool
>>> +intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
>>> +				enum port port)
>>> +{
>>> +	int i;
>>> +
>>> +	if (!HAS_LSPCON(dev_priv))
>>> +		return false;
>>> +
>>> +	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
>>> +		if (!dev_priv->vbt.child_dev[i].common.lspcon)
>>> +			continue;
>>> +
>>> +		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
>>> +		case DVO_PORT_DPA:
>>> +		case DVO_PORT_HDMIA:
>>> +			if (port == PORT_A)
>>> +				return true;
>>> +			break;
>>> +		case DVO_PORT_DPB:
>>> +		case DVO_PORT_HDMIB:
>>> +			if (port == PORT_B)
>>> +				return true;
>>> +			break;
>>> +		case DVO_PORT_DPC:
>>> +		case DVO_PORT_HDMIC:
>>> +			if (port == PORT_C)
>>> +				return true;
>>> +			break;
>>> +		case DVO_PORT_DPD:
>>> +		case DVO_PORT_HDMID:
>>> +			if (port == PORT_D)
>>> +				return true;
>>> +			break;
>>> +		default:
>>> +			break;
>>> +		}
>>> +	}
>>> +
>>> +	return false;
>>> +}
>

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon
  2016-10-17 12:34       ` Jani Nikula
@ 2016-10-17 13:53         ` Sharma, Shashank
  0 siblings, 0 replies; 12+ messages in thread
From: Sharma, Shashank @ 2016-10-17 13:53 UTC (permalink / raw)
  To: Jani Nikula, imre.deak; +Cc: daniel.vetter, intel-gfx

Regards

Shashank


On 10/17/2016 6:04 PM, Jani Nikula wrote:
> On Fri, 14 Oct 2016, "Sharma, Shashank" <shashank.sharma@intel.com> wrote:
>> Regards
>>
>> Shashank
>>
>>
>> On 10/14/2016 8:02 PM, Jani Nikula wrote:
>>> On Fri, 14 Oct 2016, Shashank Sharma <shashank.sharma@intel.com> wrote:
>>>> Many GEN9 boards come with on-board lspcon cards.
>>>> Fot these boards, VBT configuration should properly point out
>>>> if a particular port contains lspcon device, so that driver can
>>>> initialize it properly.
>>>>
>>>> This patch adds a utility function, which checks the VBT flag
>>>> for lspcon bit, and tells us if a port is configured to have a
>>>> lspcon device or not.
>>>>
>>>> V2: Fixed review comments from Ville
>>>> - Do not forget PORT_D while checking lspcon for GEN9
>>>>
>>>> V3: Addressed review comments from Rodrigo
>>>> - Create a HAS_LSPCON() macro for better use case handling.
>>>> - Do not dump warnings for non-gen-9 platforms, it will be noise.
>>>>
>>>> V4: Rebase
>>>> V5: Rebase
>>>> V6: Pass dev_priv to HAS_LSPCON() macro
>>>>
>>>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>>>> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>>> I was hoping you'd use the version I rebased and sent, put it first in
>>> the series, and rebase the rest on that. The point is, this series has
>>> taken so long that lspcon devices have proliferated all over the place,
>>> and we'll be getting more and more bugs about them. If this patch was
>>> first, with the debug logging, we could at least get that to 4.9, maybe
>>> stable kernels, and we'd immediately know the reason. I think it'll be a
>>> hard sell to get the whole series to 4.9 kernel.
>>>
>>> BR,
>>> Jani.
>> Jani,
>> The patch got its first r-b since a long time.
>> After that, it was waiting to be merged, for long time.
>>
>> Recently, when Imre was asked to test the patches, and he found one
>> issue specific to APL.
>> We were trying to fix a suspend-resume issue, which was fixed with the
>> last patch.
>> Now this patch is ready to be merged, just waiting for Imre's r-b.
>>
>> Third patch just gives information about if LSPCON is available or not,
>> which is not a big help for anything as such.
>> So instead of changing the sequence, and confusing the reviewers, I
>> thought it would be better to send the whole series and
>> get this merged as-it-is.
> Fine, let's merge this as-is... after patch 1/5 has been posted to
> dri-devel and/or has received an ack from Dave Airlie that it's fine to
> merge through our tree.
>
> In the bigger scheme of things, if this patch 3/5 had been first in the
> series all along, we could have merged this *months* ago. This is how
> series should be organized. Simple things first.
Please note that this was in continuation with Ville's dp_dual_mode 
series, so I had to start series with lspcon support in DP helper layer, 
and then come to I915 layer.
Also, IMHO, It was in the simplest form :).
>
> Having the debug information *is* valuable. You'd see that if you had to
> go through our incoming bugs. We've had plenty of LSPCON bugs since the
> day Skylake was launched. Yes, quite a long time now. If 3/5 was first
> in the series, we could backport that to v4.9 and older and reduce our
> debugging time.
I was already debugging the LSPCON issues on SKL for various devices 
(Like Skullcandy), with Paul's team, and they had proper information 
about this series, along with how to detect LSPCON, since the whole time.
They were also waiting for the merge itself, and the progress was 
recorded in this Jira VIZ-2800. Please see the comments from me since 
25th march, and from Manasi on 17th May.
This patch series had r-b since few months, I am not sure what else I 
could have done better.

Regards
Shashank
>
> BR,
> Jani.
>
>
>
>
>
>
>> Regards
>> Shashank
>>>> ---
>>>>    drivers/gpu/drm/i915/i915_drv.h   |  5 ++++
>>>>    drivers/gpu/drm/i915/intel_bios.c | 49 +++++++++++++++++++++++++++++++++++++++
>>>>    2 files changed, 54 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>>>> index fe875b2..7bab2f1 100644
>>>> --- a/drivers/gpu/drm/i915/i915_drv.h
>>>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>>>> @@ -2864,6 +2864,8 @@ struct drm_i915_cmd_table {
>>>>    
>>>>    #define HAS_GMCH_DISPLAY(dev_priv) ((dev_priv)->info.has_gmch_display)
>>>>    
>>>> +#define HAS_LSPCON(dev_priv) (IS_GEN9(dev_priv))
>>>> +
>>>>    /* DPF == dynamic parity feature */
>>>>    #define HAS_L3_DPF(dev_priv) ((dev_priv)->info.has_l3_dpf)
>>>>    #define NUM_L3_SLICES(dev_priv) (IS_HSW_GT3(dev_priv) ? \
>>>> @@ -3631,6 +3633,9 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por
>>>>    bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
>>>>    bool intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
>>>>    				     enum port port);
>>>> +bool intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
>>>> +				enum port port);
>>>> +
>>>>    
>>>>    /* intel_opregion.c */
>>>>    #ifdef CONFIG_ACPI
>>>> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
>>>> index 83667e8..32e1def 100644
>>>> --- a/drivers/gpu/drm/i915/intel_bios.c
>>>> +++ b/drivers/gpu/drm/i915/intel_bios.c
>>>> @@ -1763,3 +1763,52 @@ intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
>>>>    
>>>>    	return false;
>>>>    }
>>>> +
>>>> +/**
>>>> + * intel_bios_is_lspcon_present - if LSPCON is attached on %port
>>>> + * @dev_priv:	i915 device instance
>>>> + * @port:	port to check
>>>> + *
>>>> + * Return true if LSPCON is present on this port
>>>> + */
>>>> +bool
>>>> +intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
>>>> +				enum port port)
>>>> +{
>>>> +	int i;
>>>> +
>>>> +	if (!HAS_LSPCON(dev_priv))
>>>> +		return false;
>>>> +
>>>> +	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
>>>> +		if (!dev_priv->vbt.child_dev[i].common.lspcon)
>>>> +			continue;
>>>> +
>>>> +		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
>>>> +		case DVO_PORT_DPA:
>>>> +		case DVO_PORT_HDMIA:
>>>> +			if (port == PORT_A)
>>>> +				return true;
>>>> +			break;
>>>> +		case DVO_PORT_DPB:
>>>> +		case DVO_PORT_HDMIB:
>>>> +			if (port == PORT_B)
>>>> +				return true;
>>>> +			break;
>>>> +		case DVO_PORT_DPC:
>>>> +		case DVO_PORT_HDMIC:
>>>> +			if (port == PORT_C)
>>>> +				return true;
>>>> +			break;
>>>> +		case DVO_PORT_DPD:
>>>> +		case DVO_PORT_HDMID:
>>>> +			if (port == PORT_D)
>>>> +				return true;
>>>> +			break;
>>>> +		default:
>>>> +			break;
>>>> +		}
>>>> +	}
>>>> +
>>>> +	return false;
>>>> +}

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

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

end of thread, other threads:[~2016-10-17 13:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14 14:26 [PATCH v6 0/5] Enable lspcon support for GEN9 devices Shashank Sharma
2016-10-14 14:26 ` [PATCH v6 1/5] drm: Helper for lspcon in drm_dp_dual_mode Shashank Sharma
2016-10-14 14:26 ` [PATCH v6 2/5] drm/i915: Add lspcon support for I915 driver Shashank Sharma
2016-10-14 14:26 ` [PATCH v6 3/5] drm/i915: Parse VBT data for lspcon Shashank Sharma
2016-10-14 14:32   ` Jani Nikula
2016-10-14 16:33     ` Sharma, Shashank
2016-10-17 12:34       ` Jani Nikula
2016-10-17 13:53         ` Sharma, Shashank
2016-10-14 14:26 ` [PATCH v6 4/5] drm/i915: Enable lspcon initialization Shashank Sharma
2016-10-14 14:26 ` [PATCH v6 5/5] drm/i915: Add lspcon resume function Shashank Sharma
2016-10-17 10:42   ` Imre Deak
2016-10-14 16:53 ` ✗ Fi.CI.BAT: warning for Enable lspcon support for GEN9 devices (rev6) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.