* [PATCH 1/6] drm/i915: Splitting intel_dp_detect
2015-11-02 12:55 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
@ 2015-11-02 12:55 ` Shubhangi Shrivastava
2015-11-02 13:05 ` kbuild test robot
2015-11-02 12:55 ` [PATCH 2/6] drm/i915: Cleaning up intel_dp_hpd_pulse Shubhangi Shrivastava
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Shubhangi Shrivastava @ 2015-11-02 12:55 UTC (permalink / raw)
To: intel-gfx; +Cc: Shubhangi Shrivastava
This patch moves probing for panel, DPCD read etc to another
function intel_dp_long_pulse, while intel_dp_detect returns
the status as connected or disconnected depending on
whether the edid is available or not.
This change will be required by further patches in the series
to avoid performing multiple DPCD operations and removing
their duplication.
Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 65 ++++++++++++++++++++++++++++++-----------
1 file changed, 48 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 1cb1f3f..1677f7c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4785,8 +4785,8 @@ intel_dp_power_put(struct intel_dp *dp,
intel_display_power_put(to_i915(encoder->base.dev), power_domain);
}
-static enum drm_connector_status
-intel_dp_detect(struct drm_connector *connector, bool force)
+static void
+intel_dp_long_pulse(struct drm_connector *connector)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
@@ -4797,17 +4797,6 @@ intel_dp_detect(struct drm_connector *connector, bool force)
bool ret;
u8 sink_irq_vector;
- DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
- connector->base.id, connector->name);
- intel_dp_unset_edid(intel_dp);
-
- if (intel_dp->is_mst) {
- /* MST devices are disconnected from a monitor POV */
- if (intel_encoder->type != INTEL_OUTPUT_EDP)
- intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
- return connector_status_disconnected;
- }
-
power_domain = intel_dp_power_get(intel_dp);
/* Can't disconnect eDP, but you can close the lid... */
@@ -4817,19 +4806,35 @@ intel_dp_detect(struct drm_connector *connector, bool force)
status = ironlake_dp_detect(intel_dp);
else
status = g4x_dp_detect(intel_dp);
- if (status != connector_status_connected)
+ if (status != connector_status_connected) {
+ intel_dp_unset_edid(intel_dp);
goto out;
+ }
intel_dp_probe_oui(intel_dp);
ret = intel_dp_probe_mst(intel_dp);
if (ret) {
- /* if we are in MST mode then this connector
- won't appear connected or have anything with EDID on it */
+ /*
+ * if we are in MST mode then this connector
+ * won't appear connected or have anything with
+ * EDID on it
+ */
if (intel_encoder->type != INTEL_OUTPUT_EDP)
intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
status = connector_status_disconnected;
goto out;
+ } else if (connector->status == connector_status_connected) {
+
+ /*
+ * If display was connected already and is still connected
+ * check links status, there has been known issues of
+ * link loss triggerring long pulse!!!!
+ */
+ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
+ intel_dp_check_link_status(intel_dp);
+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
+ goto out;
}
intel_dp_set_edid(intel_dp);
@@ -4854,7 +4859,33 @@ intel_dp_detect(struct drm_connector *connector, bool force)
out:
intel_dp_power_put(intel_dp, power_domain);
- return status;
+ return;
+}
+
+static enum drm_connector_status
+intel_dp_detect(struct drm_connector *connector, bool force)
+{
+ struct intel_dp *intel_dp = intel_attached_dp(connector);
+ struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+ struct intel_encoder *intel_encoder = &intel_dig_port->base;
+ struct intel_connector *intel_connector = to_intel_connector(connector);
+
+ DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
+ connector->base.id, connector->name);
+
+ if (intel_dp->is_mst) {
+ /* MST devices are disconnected from a monitor POV */
+ if (intel_encoder->type != INTEL_OUTPUT_EDP)
+ intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
+ return connector_status_disconnected;
+ }
+
+ intel_dp_long_pulse(intel_dp->attached_connector);
+
+ if (intel_connector->detect_edid)
+ return connector_status_connected;
+ else
+ return connector_status_disconnected;
}
static void
--
2.6.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/6] drm/i915: Splitting intel_dp_detect
2015-11-02 12:55 ` [PATCH 1/6] drm/i915: Splitting intel_dp_detect Shubhangi Shrivastava
@ 2015-11-02 13:05 ` kbuild test robot
0 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2015-11-02 13:05 UTC (permalink / raw)
Cc: intel-gfx, Shubhangi Shrivastava, kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]
Hi Shubhangi,
[auto build test WARNING on drm-intel/for-linux-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]
url: https://github.com/0day-ci/linux/commits/Shubhangi-Shrivastava/Fixing-sink-count-related-detection-over/20151102-205435
config: i386-randconfig-x003-11010709 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/gpu/drm/i915/intel_dp.c: In function 'intel_dp_detect':
>> drivers/gpu/drm/i915/intel_dp.c:4883:22: warning: passing argument 1 of 'intel_dp_long_pulse' from incompatible pointer type [-Wincompatible-pointer-types]
intel_dp_long_pulse(intel_dp->attached_connector);
^
drivers/gpu/drm/i915/intel_dp.c:4789:1: note: expected 'struct drm_connector *' but argument is of type 'struct intel_connector *'
intel_dp_long_pulse(struct drm_connector *connector)
^
vim +/intel_dp_long_pulse +4883 drivers/gpu/drm/i915/intel_dp.c
4867 {
4868 struct intel_dp *intel_dp = intel_attached_dp(connector);
4869 struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
4870 struct intel_encoder *intel_encoder = &intel_dig_port->base;
4871 struct intel_connector *intel_connector = to_intel_connector(connector);
4872
4873 DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
4874 connector->base.id, connector->name);
4875
4876 if (intel_dp->is_mst) {
4877 /* MST devices are disconnected from a monitor POV */
4878 if (intel_encoder->type != INTEL_OUTPUT_EDP)
4879 intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
4880 return connector_status_disconnected;
4881 }
4882
> 4883 intel_dp_long_pulse(intel_dp->attached_connector);
4884
4885 if (intel_connector->detect_edid)
4886 return connector_status_connected;
4887 else
4888 return connector_status_disconnected;
4889 }
4890
4891 static void
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 28234 bytes --]
[-- Attachment #3: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/6] drm/i915: Cleaning up intel_dp_hpd_pulse
2015-11-02 12:55 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
2015-11-02 12:55 ` [PATCH 1/6] drm/i915: Splitting intel_dp_detect Shubhangi Shrivastava
@ 2015-11-02 12:55 ` Shubhangi Shrivastava
2015-11-02 12:55 ` [PATCH 3/6] drm/i915: Splitting intel_dp_check_link_status Shubhangi Shrivastava
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Shubhangi Shrivastava @ 2015-11-02 12:55 UTC (permalink / raw)
To: intel-gfx; +Cc: Shubhangi Shrivastava
Current DP detection has DPCD operations split across
intel_dp_hpd_pulse and intel_dp_detect which contains
duplicates as well. Also intel_dp_detect is called
during modes enumeration as well which will result
in multiple dpcd operations. So this patch tries
to solve both these by bringing all DPCD operations
in one single function and make intel_dp_detect
use existing values instead of repeating same steps.
Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 1677f7c..1826a95 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4880,7 +4880,8 @@ intel_dp_detect(struct drm_connector *connector, bool force)
return connector_status_disconnected;
}
- intel_dp_long_pulse(intel_dp->attached_connector);
+ if (force)
+ intel_dp_long_pulse(intel_dp->attached_connector);
if (intel_connector->detect_edid)
return connector_status_connected;
@@ -5210,21 +5211,9 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
/* indicate that we need to restart link training */
intel_dp->train_set_valid = false;
- if (!intel_digital_port_connected(dev_priv, intel_dig_port))
- goto mst_fail;
+ intel_dp_long_pulse(intel_dp->attached_connector);
+ goto put_power;
- if (!intel_dp_get_dpcd(intel_dp)) {
- goto mst_fail;
- }
-
- intel_dp_probe_oui(intel_dp);
-
- if (!intel_dp_probe_mst(intel_dp)) {
- drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
- intel_dp_check_link_status(intel_dp);
- drm_modeset_unlock(&dev->mode_config.connection_mutex);
- goto mst_fail;
- }
} else {
if (intel_dp->is_mst) {
if (intel_dp_check_mst_status(intel_dp) == -EINVAL)
--
2.6.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/6] drm/i915: Splitting intel_dp_check_link_status
2015-11-02 12:55 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
2015-11-02 12:55 ` [PATCH 1/6] drm/i915: Splitting intel_dp_detect Shubhangi Shrivastava
2015-11-02 12:55 ` [PATCH 2/6] drm/i915: Cleaning up intel_dp_hpd_pulse Shubhangi Shrivastava
@ 2015-11-02 12:55 ` Shubhangi Shrivastava
2015-11-02 13:11 ` kbuild test robot
2015-11-02 12:55 ` [PATCH 4/6] drm/i915: Save sink_count for tracking changes to it Shubhangi Shrivastava
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Shubhangi Shrivastava @ 2015-11-02 12:55 UTC (permalink / raw)
To: intel-gfx; +Cc: Shubhangi Shrivastava
The link retraining part when EQ is not correct is
retained to intel_dp_check_link_status whereas other
operations are handled as part of intel_dp_short_pulse.
This change is required to avoid performing all DPCD
related operations on performing link retraining.
Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 48 +++++++++++++++++++++++++----------------
1 file changed, 30 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 1826a95..f19945f 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4421,6 +4421,31 @@ go_again:
return -EINVAL;
}
+static void
+intel_dp_check_link_status(struct intel_dp *intel_dp)
+{
+ struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;
+ u8 link_status[DP_LINK_STATUS_SIZE];
+
+ if (!intel_dp_get_link_status(intel_dp, link_status)) {
+ DRM_ERROR("Failed to get link status\n");
+ return;
+ }
+
+ if (!intel_encoder->base.crtc)
+ return;
+
+ if (!to_intel_crtc(intel_encoder->base.crtc)->active)
+ return;
+
+ if (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) {
+ DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n",
+ intel_encoder->base.name);
+ intel_dp_start_link_train(intel_dp);
+ intel_dp_stop_link_train(intel_dp);
+ }
+}
+
/*
* According to DP spec
* 5.1.2:
@@ -4430,21 +4455,13 @@ go_again:
* 4. Check link status on receipt of hot-plug interrupt
*/
static void
-intel_dp_check_link_status(struct intel_dp *intel_dp)
+intel_dp_short_pulse(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;
u8 sink_irq_vector;
u8 link_status[DP_LINK_STATUS_SIZE];
- WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
-
- if (!intel_encoder->base.crtc)
- return;
-
- if (!to_intel_crtc(intel_encoder->base.crtc)->active)
- return;
-
/* Try to read receiver status if the link appears to be up */
if (!intel_dp_get_link_status(intel_dp, link_status)) {
return;
@@ -4469,12 +4486,9 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n");
}
- if (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) {
- DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n",
- intel_encoder->base.name);
- intel_dp_start_link_train(intel_dp);
- intel_dp_stop_link_train(intel_dp);
- }
+ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
+ intel_dp_check_link_status(intel_dp);
+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
}
/* XXX this is probably wrong for multiple downstream ports */
@@ -5221,9 +5235,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
}
if (!intel_dp->is_mst) {
- drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
- intel_dp_check_link_status(intel_dp);
- drm_modeset_unlock(&dev->mode_config.connection_mutex);
+ intel_dp_short_pulse(intel_dp);
}
}
--
2.6.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 3/6] drm/i915: Splitting intel_dp_check_link_status
2015-11-02 12:55 ` [PATCH 3/6] drm/i915: Splitting intel_dp_check_link_status Shubhangi Shrivastava
@ 2015-11-02 13:11 ` kbuild test robot
0 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2015-11-02 13:11 UTC (permalink / raw)
Cc: intel-gfx, Shubhangi Shrivastava, kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4159 bytes --]
Hi Shubhangi,
[auto build test WARNING on drm-intel/for-linux-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]
url: https://github.com/0day-ci/linux/commits/Shubhangi-Shrivastava/Fixing-sink-count-related-detection-over/20151102-205435
config: i386-randconfig-x003-11010709 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/gpu/drm/i915/intel_dp.c: In function 'intel_dp_short_pulse':
>> drivers/gpu/drm/i915/intel_dp.c:4461:24: warning: unused variable 'intel_encoder' [-Wunused-variable]
struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;
^
drivers/gpu/drm/i915/intel_dp.c: In function 'intel_dp_detect':
drivers/gpu/drm/i915/intel_dp.c:4898:23: warning: passing argument 1 of 'intel_dp_long_pulse' from incompatible pointer type [-Wincompatible-pointer-types]
intel_dp_long_pulse(intel_dp->attached_connector);
^
drivers/gpu/drm/i915/intel_dp.c:4803:1: note: expected 'struct drm_connector *' but argument is of type 'struct intel_connector *'
intel_dp_long_pulse(struct drm_connector *connector)
^
drivers/gpu/drm/i915/intel_dp.c: In function 'intel_dp_hpd_pulse':
drivers/gpu/drm/i915/intel_dp.c:5228:23: warning: passing argument 1 of 'intel_dp_long_pulse' from incompatible pointer type [-Wincompatible-pointer-types]
intel_dp_long_pulse(intel_dp->attached_connector);
^
drivers/gpu/drm/i915/intel_dp.c:4803:1: note: expected 'struct drm_connector *' but argument is of type 'struct intel_connector *'
intel_dp_long_pulse(struct drm_connector *connector)
^
vim +/intel_encoder +4461 drivers/gpu/drm/i915/intel_dp.c
b2008584e Shubhangi Shrivastava 2015-11-02 4445 intel_dp_stop_link_train(intel_dp);
b2008584e Shubhangi Shrivastava 2015-11-02 4446 }
b2008584e Shubhangi Shrivastava 2015-11-02 4447 }
b2008584e Shubhangi Shrivastava 2015-11-02 4448
a4fc5ed69 Keith Packard 2009-04-07 4449 /*
a4fc5ed69 Keith Packard 2009-04-07 4450 * According to DP spec
a4fc5ed69 Keith Packard 2009-04-07 4451 * 5.1.2:
a4fc5ed69 Keith Packard 2009-04-07 4452 * 1. Read DPCD
a4fc5ed69 Keith Packard 2009-04-07 4453 * 2. Configure link according to Receiver Capabilities
a4fc5ed69 Keith Packard 2009-04-07 4454 * 3. Use Link Training from 2.5.3.3 and 3.5.1.3
a4fc5ed69 Keith Packard 2009-04-07 4455 * 4. Check link status on receipt of hot-plug interrupt
a4fc5ed69 Keith Packard 2009-04-07 4456 */
a51462004 Damien Lespiau 2015-02-10 4457 static void
b2008584e Shubhangi Shrivastava 2015-11-02 4458 intel_dp_short_pulse(struct intel_dp *intel_dp)
a4fc5ed69 Keith Packard 2009-04-07 4459 {
5b215bcff Dave Airlie 2014-08-05 4460 struct drm_device *dev = intel_dp_to_dev(intel_dp);
da63a9f2e Paulo Zanoni 2012-10-26 @4461 struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;
a60f0e38d Jesse Barnes 2011-10-20 4462 u8 sink_irq_vector;
93f62dad5 Keith Packard 2011-11-01 4463 u8 link_status[DP_LINK_STATUS_SIZE];
a60f0e38d Jesse Barnes 2011-10-20 4464
92fd8fd13 Keith Packard 2011-07-25 4465 /* Try to read receiver status if the link appears to be up */
93f62dad5 Keith Packard 2011-11-01 4466 if (!intel_dp_get_link_status(intel_dp, link_status)) {
a4fc5ed69 Keith Packard 2009-04-07 4467 return;
a4fc5ed69 Keith Packard 2009-04-07 4468 }
a4fc5ed69 Keith Packard 2009-04-07 4469
:::::: The code at line 4461 was first introduced by commit
:::::: da63a9f2e4a1595f4890e38a0511d74bea1a51f0 drm/i915: create intel_digital_port and use it
:::::: TO: Paulo Zanoni <paulo.r.zanoni@intel.com>
:::::: CC: Daniel Vetter <daniel.vetter@ffwll.ch>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 28234 bytes --]
[-- Attachment #3: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 4/6] drm/i915: Save sink_count for tracking changes to it
2015-11-02 12:55 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
` (2 preceding siblings ...)
2015-11-02 12:55 ` [PATCH 3/6] drm/i915: Splitting intel_dp_check_link_status Shubhangi Shrivastava
@ 2015-11-02 12:55 ` Shubhangi Shrivastava
2015-11-02 12:55 ` [PATCH 5/6] drm/i915: read sink_count dpcd always Shubhangi Shrivastava
` (2 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Shubhangi Shrivastava @ 2015-11-02 12:55 UTC (permalink / raw)
To: intel-gfx; +Cc: Shubhangi Shrivastava
Sink count can change between short pulse hpd hence this patch
adds a member variable to intel_dp so we can track any changes
between short pulse interrupts.
Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 7 +++----
drivers/gpu/drm/i915/intel_drv.h | 1 +
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f19945f..e15d42b 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4508,14 +4508,13 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
/* If we're HPD-aware, SINK_COUNT changes dynamically */
if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
intel_dp->downstream_ports[0] & DP_DS_PORT_HPD) {
- uint8_t reg;
if (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_SINK_COUNT,
- ®, 1) < 0)
+ &intel_dp->sink_count, 1) < 0)
return connector_status_unknown;
- return DP_GET_SINK_COUNT(reg) ? connector_status_connected
- : connector_status_disconnected;
+ return DP_GET_SINK_COUNT(intel_dp->sink_count) ?
+ connector_status_connected : connector_status_disconnected;
}
/* If no HPD, poke DDC gently */
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 1a3bbdc..abcedc5 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -748,6 +748,7 @@ struct intel_dp {
uint32_t DP;
int link_rate;
uint8_t lane_count;
+ uint8_t sink_count;
bool has_audio;
enum hdmi_force_audio force_audio;
bool limited_color_range;
--
2.6.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/6] drm/i915: read sink_count dpcd always
2015-11-02 12:55 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
` (3 preceding siblings ...)
2015-11-02 12:55 ` [PATCH 4/6] drm/i915: Save sink_count for tracking changes to it Shubhangi Shrivastava
@ 2015-11-02 12:55 ` Shubhangi Shrivastava
2015-11-02 12:55 ` [PATCH 6/6] drm/i915: force full detect on sink count change Shubhangi Shrivastava
2015-11-17 19:53 ` [PATCH 0/6] Fixing sink count related detection over Daniel Vetter
6 siblings, 0 replies; 15+ messages in thread
From: Shubhangi Shrivastava @ 2015-11-02 12:55 UTC (permalink / raw)
To: intel-gfx; +Cc: Shubhangi Shrivastava
This patch reads sink_count dpcd always and removes its
read operation based on values in downstream port dpcd.
SINK_COUNT dpcd is not dependent on DOWNSTREAM_PORT_PRESENT dpcd.
SINK_COUNT denotes if a display is attached, while
DOWNSTREAM_PORT_PRESET indicates how many ports are available
in the dongle where display can be attached. so it is possible
for sink count to change irrespective of value in downstream
port dpcd.
Here is a table of possible values and scenarios
sink_count downstream_port
present
0 0 no display is attached
0 1 dongle is connected without display
1 0 display connected directly
1 1 display connected through dongle
v2: moved out crtc enabled checks to prior patch(Jani)
Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index e15d42b..9a22bec 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3988,6 +3988,13 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
if (intel_dp->dpcd[DP_DPCD_REV] == 0)
return false; /* DPCD not present */
+ if (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_SINK_COUNT,
+ &intel_dp->sink_count, 1) < 0)
+ return false;
+
+ if (!DP_GET_SINK_COUNT(intel_dp->sink_count))
+ return false;
+
/* Check if the panel supports PSR */
memset(intel_dp->psr_dpcd, 0, sizeof(intel_dp->psr_dpcd));
if (is_edp(intel_dp)) {
@@ -4509,10 +4516,6 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
intel_dp->downstream_ports[0] & DP_DS_PORT_HPD) {
- if (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_SINK_COUNT,
- &intel_dp->sink_count, 1) < 0)
- return connector_status_unknown;
-
return DP_GET_SINK_COUNT(intel_dp->sink_count) ?
connector_status_connected : connector_status_disconnected;
}
--
2.6.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 6/6] drm/i915: force full detect on sink count change
2015-11-02 12:55 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
` (4 preceding siblings ...)
2015-11-02 12:55 ` [PATCH 5/6] drm/i915: read sink_count dpcd always Shubhangi Shrivastava
@ 2015-11-02 12:55 ` Shubhangi Shrivastava
2015-11-17 19:53 ` [PATCH 0/6] Fixing sink count related detection over Daniel Vetter
6 siblings, 0 replies; 15+ messages in thread
From: Shubhangi Shrivastava @ 2015-11-02 12:55 UTC (permalink / raw)
To: intel-gfx; +Cc: Shubhangi Shrivastava
This patch checks for changes in sink count between short pulse
hpds and forces full detect when there is a change.
This will allow both detection of hotplug and unplug of panels
through dongles that give only short pulse for such events.
v2: changed variable type from u8 to bool (Jani)
return immediately if perform_full_detect is set(Siva)
v3: changed method of determining full detection from using
pointer to return code (Siva)
Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 9a22bec..445ec9c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4461,22 +4461,31 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
* 3. Use Link Training from 2.5.3.3 and 3.5.1.3
* 4. Check link status on receipt of hot-plug interrupt
*/
-static void
+static bool
intel_dp_short_pulse(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;
u8 sink_irq_vector;
u8 link_status[DP_LINK_STATUS_SIZE];
+ u8 old_sink_count = intel_dp->sink_count;
+ bool ret;
/* Try to read receiver status if the link appears to be up */
if (!intel_dp_get_link_status(intel_dp, link_status)) {
- return;
+ return false;
}
- /* Now read the DPCD to see if it's actually running */
- if (!intel_dp_get_dpcd(intel_dp)) {
- return;
+ /* Now read the DPCD to see if it's actually running
+ * Don't return immediately if dpcd read failed,
+ * if sink count was 1 and dpcd read failed we need
+ * to do full detection
+ */
+ ret = intel_dp_get_dpcd(intel_dp);
+
+ if ((old_sink_count != intel_dp->sink_count) || !ret) {
+ /* No need to proceed if we are going to do full detect */
+ return false;
}
/* Try to read the source of the interrupt */
@@ -4496,6 +4505,8 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)
drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
intel_dp_check_link_status(intel_dp);
drm_modeset_unlock(&dev->mode_config.connection_mutex);
+
+ return true;
}
/* XXX this is probably wrong for multiple downstream ports */
@@ -5237,7 +5248,10 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
}
if (!intel_dp->is_mst) {
- intel_dp_short_pulse(intel_dp);
+ if (!intel_dp_short_pulse(intel_dp)) {
+ intel_dp_long_pulse(intel_dp->attached_connector);
+ goto put_power;
+ }
}
}
--
2.6.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 0/6] Fixing sink count related detection over
2015-11-02 12:55 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
` (5 preceding siblings ...)
2015-11-02 12:55 ` [PATCH 6/6] drm/i915: force full detect on sink count change Shubhangi Shrivastava
@ 2015-11-17 19:53 ` Daniel Vetter
2015-11-18 5:42 ` Shubhangi Shrivastava
6 siblings, 1 reply; 15+ messages in thread
From: Daniel Vetter @ 2015-11-17 19:53 UTC (permalink / raw)
To: Shubhangi Shrivastava; +Cc: intel-gfx
On Mon, Nov 02, 2015 at 06:25:10PM +0530, Shubhangi Shrivastava wrote:
> This patch set cleans up DP detection logic to bring all DPCD
> operations at one place and to create a clear demarcation
> between handling of long and short pulses. This simplifies
> fixing of sink count related detection for DP panels.
>
> Patches:
> 1. First two patches clean up intel_dp_detect and form a new
> function which will include all DPCD related operations.
> 2. Second patch splits up intel_dp_check_link_status to form
> a new function which will handle short pulse requests.
> 3. Last three patches fixes the detection logic related to
> sink count i.e detect changes in sink count and handle them
> appropriately.
>
> Note: this is tested on BXT with non-mst panels,
> will get back ASAP with results for MST panels too.
Sivakumar and Ander are working on reorganizing all the DP hpd handling,
at least they have been before I went on vacation. I think it would make
sense to land that work first, before we start to apply functional fixes.
Please coordinate with them.
-Daniel
>
> Shubhangi Shrivastava (6):
> drm/i915: Splitting intel_dp_detect
> drm/i915: Cleaning up intel_dp_hpd_pulse
> drm/i915: Splitting intel_dp_check_link_status
> drm/i915: Save sink_count for tracking changes to it
> drm/i915: read sink_count dpcd always
> drm/i915: force full detect on sink count change
>
> drivers/gpu/drm/i915/intel_dp.c | 170 +++++++++++++++++++++++++--------------
> drivers/gpu/drm/i915/intel_drv.h | 1 +
> 2 files changed, 110 insertions(+), 61 deletions(-)
>
> --
> 2.6.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/6] Fixing sink count related detection over
2015-11-17 19:53 ` [PATCH 0/6] Fixing sink count related detection over Daniel Vetter
@ 2015-11-18 5:42 ` Shubhangi Shrivastava
2015-11-18 9:23 ` Ander Conselvan De Oliveira
0 siblings, 1 reply; 15+ messages in thread
From: Shubhangi Shrivastava @ 2015-11-18 5:42 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
On Wednesday 18 November 2015 01:23 AM, Daniel Vetter wrote:
> On Mon, Nov 02, 2015 at 06:25:10PM +0530, Shubhangi Shrivastava wrote:
>> This patch set cleans up DP detection logic to bring all DPCD
>> operations at one place and to create a clear demarcation
>> between handling of long and short pulses. This simplifies
>> fixing of sink count related detection for DP panels.
>>
>> Patches:
>> 1. First two patches clean up intel_dp_detect and form a new
>> function which will include all DPCD related operations.
>> 2. Second patch splits up intel_dp_check_link_status to form
>> a new function which will handle short pulse requests.
>> 3. Last three patches fixes the detection logic related to
>> sink count i.e detect changes in sink count and handle them
>> appropriately.
>>
>> Note: this is tested on BXT with non-mst panels,
>> will get back ASAP with results for MST panels too.
> Sivakumar and Ander are working on reorganizing all the DP hpd handling,
> at least they have been before I went on vacation. I think it would make
> sense to land that work first, before we start to apply functional fixes.
>
> Please coordinate with them.
> -Daniel
Yes.. The reorganization of DP HPD handling is in progress.
I am working with Siva on the same. :)
We have found certain bugs in MST related code, pointed out
by Ander. Once it is fixed, we will re-upload the patches.
>
>> Shubhangi Shrivastava (6):
>> drm/i915: Splitting intel_dp_detect
>> drm/i915: Cleaning up intel_dp_hpd_pulse
>> drm/i915: Splitting intel_dp_check_link_status
>> drm/i915: Save sink_count for tracking changes to it
>> drm/i915: read sink_count dpcd always
>> drm/i915: force full detect on sink count change
>>
>> drivers/gpu/drm/i915/intel_dp.c | 170 +++++++++++++++++++++++++--------------
>> drivers/gpu/drm/i915/intel_drv.h | 1 +
>> 2 files changed, 110 insertions(+), 61 deletions(-)
>>
>> --
>> 2.6.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/6] Fixing sink count related detection over
2015-11-18 5:42 ` Shubhangi Shrivastava
@ 2015-11-18 9:23 ` Ander Conselvan De Oliveira
2015-11-18 9:36 ` Shubhangi Shrivastava
0 siblings, 1 reply; 15+ messages in thread
From: Ander Conselvan De Oliveira @ 2015-11-18 9:23 UTC (permalink / raw)
To: Shubhangi Shrivastava, Daniel Vetter; +Cc: intel-gfx
On Wed, 2015-11-18 at 11:12 +0530, Shubhangi Shrivastava wrote:
>
> On Wednesday 18 November 2015 01:23 AM, Daniel Vetter wrote:
> > On Mon, Nov 02, 2015 at 06:25:10PM +0530, Shubhangi Shrivastava wrote:
> > > This patch set cleans up DP detection logic to bring all DPCD
> > > operations at one place and to create a clear demarcation
> > > between handling of long and short pulses. This simplifies
> > > fixing of sink count related detection for DP panels.
> > >
> > > Patches:
> > > 1. First two patches clean up intel_dp_detect and form a new
> > > function which will include all DPCD related operations.
> > > 2. Second patch splits up intel_dp_check_link_status to form
> > > a new function which will handle short pulse requests.
> > > 3. Last three patches fixes the detection logic related to
> > > sink count i.e detect changes in sink count and handle them
> > > appropriately.
> > >
> > > Note: this is tested on BXT with non-mst panels,
> > > will get back ASAP with results for MST panels too.
> > Sivakumar and Ander are working on reorganizing all the DP hpd handling,
> > at least they have been before I went on vacation. I think it would make
> > sense to land that work first, before we start to apply functional fixes.
> >
> > Please coordinate with them.
> > -Daniel
> Yes.. The reorganization of DP HPD handling is in progress.
> I am working with Siva on the same. :)
I thought this was the series that reorganizes HPD. Should I be looking at some
other patches too?
Ander
> We have found certain bugs in MST related code, pointed out
> by Ander. Once it is fixed, we will re-upload the patches.
> >
> > > Shubhangi Shrivastava (6):
> > > drm/i915: Splitting intel_dp_detect
> > > drm/i915: Cleaning up intel_dp_hpd_pulse
> > > drm/i915: Splitting intel_dp_check_link_status
> > > drm/i915: Save sink_count for tracking changes to it
> > > drm/i915: read sink_count dpcd always
> > > drm/i915: force full detect on sink count change
> > >
> > > drivers/gpu/drm/i915/intel_dp.c | 170 +++++++++++++++++++++++++--------
> > > ------
> > > drivers/gpu/drm/i915/intel_drv.h | 1 +
> > > 2 files changed, 110 insertions(+), 61 deletions(-)
> > >
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/6] Fixing sink count related detection over
2015-11-18 9:23 ` Ander Conselvan De Oliveira
@ 2015-11-18 9:36 ` Shubhangi Shrivastava
0 siblings, 0 replies; 15+ messages in thread
From: Shubhangi Shrivastava @ 2015-11-18 9:36 UTC (permalink / raw)
To: Ander Conselvan De Oliveira, Daniel Vetter; +Cc: intel-gfx
On Wednesday 18 November 2015 02:53 PM, Ander Conselvan De Oliveira wrote:
> On Wed, 2015-11-18 at 11:12 +0530, Shubhangi Shrivastava wrote:
>> On Wednesday 18 November 2015 01:23 AM, Daniel Vetter wrote:
>>> On Mon, Nov 02, 2015 at 06:25:10PM +0530, Shubhangi Shrivastava wrote:
>>>> This patch set cleans up DP detection logic to bring all DPCD
>>>> operations at one place and to create a clear demarcation
>>>> between handling of long and short pulses. This simplifies
>>>> fixing of sink count related detection for DP panels.
>>>>
>>>> Patches:
>>>> 1. First two patches clean up intel_dp_detect and form a new
>>>> function which will include all DPCD related operations.
>>>> 2. Second patch splits up intel_dp_check_link_status to form
>>>> a new function which will handle short pulse requests.
>>>> 3. Last three patches fixes the detection logic related to
>>>> sink count i.e detect changes in sink count and handle them
>>>> appropriately.
>>>>
>>>> Note: this is tested on BXT with non-mst panels,
>>>> will get back ASAP with results for MST panels too.
>>> Sivakumar and Ander are working on reorganizing all the DP hpd handling,
>>> at least they have been before I went on vacation. I think it would make
>>> sense to land that work first, before we start to apply functional fixes.
>>>
>>> Please coordinate with them.
>>> -Daniel
>> Yes.. The reorganization of DP HPD handling is in progress.
>> I am working with Siva on the same. :)
> I thought this was the series that reorganizes HPD. Should I be looking at some
> other patches too?
>
> Ander
Its the same Ander.. :)
>
>> We have found certain bugs in MST related code, pointed out
>> by Ander. Once it is fixed, we will re-upload the patches.
>>>> Shubhangi Shrivastava (6):
>>>> drm/i915: Splitting intel_dp_detect
>>>> drm/i915: Cleaning up intel_dp_hpd_pulse
>>>> drm/i915: Splitting intel_dp_check_link_status
>>>> drm/i915: Save sink_count for tracking changes to it
>>>> drm/i915: read sink_count dpcd always
>>>> drm/i915: force full detect on sink count change
>>>>
>>>> drivers/gpu/drm/i915/intel_dp.c | 170 +++++++++++++++++++++++++--------
>>>> ------
>>>> drivers/gpu/drm/i915/intel_drv.h | 1 +
>>>> 2 files changed, 110 insertions(+), 61 deletions(-)
>>>>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread