All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Return only active connectors for get_resources ioctl
@ 2018-11-28 13:55 Stanislav Lisovskiy
  2018-11-28 15:26 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Stanislav Lisovskiy @ 2018-11-28 13:55 UTC (permalink / raw)
  To: dri-devel
  Cc: martin.peres, ville.syrjala, chris, stable, stanislav.lisovskiy,
	intel-gfx

Currently kernel might allocate different connector ids
for the same outputs in case of DP MST, which seems to
confuse userspace. There are can be different connector
ids in the list, which could be assigned to the same
output, while being in different states.
This results in issues, like external displays staying
blank after quick unplugging and plugging back(bug #106250).
Returning only active DP connectors fixes the issue.

v2: Removed caps from the title

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106250
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 drivers/gpu/drm/drm_mode_config.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index ee80788f2c40..ec5b2b08a45e 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -143,6 +143,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
 	drm_connector_list_iter_begin(dev, &conn_iter);
 	count = 0;
 	connector_id = u64_to_user_ptr(card_res->connector_id_ptr);
+	DRM_DEBUG_KMS("GetResources: writing connectors start");
 	drm_for_each_connector_iter(connector, &conn_iter) {
 		/* only expose writeback connectors if userspace understands them */
 		if (!file_priv->writeback_connectors &&
@@ -150,15 +151,20 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
 			continue;
 
 		if (drm_lease_held(file_priv, connector->base.id)) {
-			if (count < card_res->count_connectors &&
-			    put_user(connector->base.id, connector_id + count)) {
-				drm_connector_list_iter_end(&conn_iter);
-				return -EFAULT;
+			if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort ||
+				connector->status != connector_status_disconnected) {
+				if (count < card_res->count_connectors &&
+				    put_user(connector->base.id, connector_id + count)) {
+					drm_connector_list_iter_end(&conn_iter);
+					return -EFAULT;
+				}
+				DRM_DEBUG_KMS("GetResources: connector %s", connector->name);
+				count++;
 			}
-			count++;
 		}
 	}
 	card_res->count_connectors = count;
+	DRM_DEBUG_KMS("GetResources: writing connectors end - count %d", count);
 	drm_connector_list_iter_end(&conn_iter);
 
 	return ret;
-- 
2.17.1

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

* ✗ Fi.CI.CHECKPATCH: warning for Return only active connectors for get_resources ioctl
  2018-11-28 13:55 [PATCH v2] Return only active connectors for get_resources ioctl Stanislav Lisovskiy
@ 2018-11-28 15:26 ` Patchwork
  2018-11-28 15:42 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-11-28 15:26 UTC (permalink / raw)
  To: Stanislav Lisovskiy; +Cc: intel-gfx

== Series Details ==

Series: Return only active connectors for get_resources ioctl
URL   : https://patchwork.freedesktop.org/series/53163/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
9e2ef2ea4d7b Return only active connectors for get_resources ioctl
-:41: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#41: FILE: drivers/gpu/drm/drm_mode_config.c:155:
+			if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort ||
+				connector->status != connector_status_disconnected) {

total: 0 errors, 0 warnings, 1 checks, 32 lines checked

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

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

* ✓ Fi.CI.BAT: success for Return only active connectors for get_resources ioctl
  2018-11-28 13:55 [PATCH v2] Return only active connectors for get_resources ioctl Stanislav Lisovskiy
  2018-11-28 15:26 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-11-28 15:42 ` Patchwork
  2018-11-28 20:51 ` [Intel-gfx] [PATCH v2] " Daniel Vetter
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-11-28 15:42 UTC (permalink / raw)
  To: Lisovskiy, Stanislav; +Cc: intel-gfx

== Series Details ==

Series: Return only active connectors for get_resources ioctl
URL   : https://patchwork.freedesktop.org/series/53163/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5213 -> Patchwork_10931
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

Possible new issues
-------------------

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

### IGT changes ###

#### Warnings ####

  * igt@kms_chamelium@dp-crc-fast:
    - {fi-kbl-7500u}:     PASS -> SKIP +3

  
Known issues
------------

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-blb-e6850:       PASS -> INCOMPLETE [fdo#107718]

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103191] / [fdo#107362]

  
#### Possible fixes ####

  * igt@gem_basic@create-fd-close:
    - fi-kbl-7560u:       INCOMPLETE -> PASS

  * igt@gem_ctx_create@basic-files:
    - fi-bsw-n3050:       FAIL [fdo#108656] -> PASS

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-ivb-3520m:       FAIL [fdo#108880] -> PASS

  * igt@kms_chamelium@common-hpd-after-suspend:
    - {fi-kbl-7500u}:     DMESG-WARN [fdo#102505] / [fdo#103558] / [fdo#105079] / [fdo#105602] -> SKIP

  * igt@kms_chamelium@hdmi-hpd-fast:
    - {fi-kbl-7500u}:     FAIL [fdo#108769] -> SKIP

  * igt@prime_vgem@basic-fence-flip:
    - fi-gdg-551:         FAIL [fdo#103182] -> PASS

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

  [fdo#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505
  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#105079]: https://bugs.freedesktop.org/show_bug.cgi?id=105079
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108656]: https://bugs.freedesktop.org/show_bug.cgi?id=108656
  [fdo#108769]: https://bugs.freedesktop.org/show_bug.cgi?id=108769
  [fdo#108880]: https://bugs.freedesktop.org/show_bug.cgi?id=108880


Participating hosts (51 -> 42)
------------------------------

  Missing    (9): fi-kbl-soraka fi-kbl-7567u fi-ilk-m540 fi-hsw-4200u fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 


Build changes
-------------

    * Linux: CI_DRM_5213 -> Patchwork_10931

  CI_DRM_5213: 5912c54d9804fb15d6a9fa2798bfef1e837c8938 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4735: b05c028ccdb6ac8e8d8499a041bb14dfe358ee26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10931: 9e2ef2ea4d7b3832772706ac56d77114c3043cb9 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

9e2ef2ea4d7b Return only active connectors for get_resources ioctl

== Logs ==

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

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

* Re: [Intel-gfx] [PATCH v2] Return only active connectors for get_resources ioctl
  2018-11-28 13:55 [PATCH v2] Return only active connectors for get_resources ioctl Stanislav Lisovskiy
  2018-11-28 15:26 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2018-11-28 15:42 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-11-28 20:51 ` Daniel Vetter
  2018-11-28 21:21     ` Daniel Vetter
  2018-11-28 21:51 ` ✗ Fi.CI.CHECKPATCH: warning for Return only active connectors for get_resources ioctl (rev3) Patchwork
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Daniel Vetter @ 2018-11-28 20:51 UTC (permalink / raw)
  To: Stanislav Lisovskiy
  Cc: dri-devel, ville.syrjala, intel-gfx, martin.peres, stable

On Wed, Nov 28, 2018 at 03:55:58PM +0200, Stanislav Lisovskiy wrote:
> Currently kernel might allocate different connector ids
> for the same outputs in case of DP MST, which seems to
> confuse userspace. There are can be different connector
> ids in the list, which could be assigned to the same
> output, while being in different states.
> This results in issues, like external displays staying
> blank after quick unplugging and plugging back(bug #106250).
> Returning only active DP connectors fixes the issue.
> 
> v2: Removed caps from the title
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106250
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
>  drivers/gpu/drm/drm_mode_config.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> index ee80788f2c40..ec5b2b08a45e 100644
> --- a/drivers/gpu/drm/drm_mode_config.c
> +++ b/drivers/gpu/drm/drm_mode_config.c
> @@ -143,6 +143,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
>  	drm_connector_list_iter_begin(dev, &conn_iter);
>  	count = 0;
>  	connector_id = u64_to_user_ptr(card_res->connector_id_ptr);
> +	DRM_DEBUG_KMS("GetResources: writing connectors start");
>  	drm_for_each_connector_iter(connector, &conn_iter) {
>  		/* only expose writeback connectors if userspace understands them */
>  		if (!file_priv->writeback_connectors &&
> @@ -150,15 +151,20 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
>  			continue;
>  
>  		if (drm_lease_held(file_priv, connector->base.id)) {
> -			if (count < card_res->count_connectors &&
> -			    put_user(connector->base.id, connector_id + count)) {
> -				drm_connector_list_iter_end(&conn_iter);
> -				return -EFAULT;
> +			if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort ||
> +				connector->status != connector_status_disconnected) {
> +				if (count < card_res->count_connectors &&
> +				    put_user(connector->base.id, connector_id + count)) {
> +					drm_connector_list_iter_end(&conn_iter);
> +					return -EFAULT;
> +				}
> +				DRM_DEBUG_KMS("GetResources: connector %s", connector->name);
> +				count++;

I tried to read the bug and I have no idea what's going on here. Userspace
is supposed to shut off outputs that are disconnected, whether that's DP,
DP MST or something else shouldn't matter. New connectors can come&go as
they see fit. Also not really something special.

Why do we need to dynamically hide an output here? Note that this also
affects normal DP ports, which I have no idea is actually what you want to
do or not.
-Daniel

>  			}
> -			count++;
>  		}
>  	}
>  	card_res->count_connectors = count;
> +	DRM_DEBUG_KMS("GetResources: writing connectors end - count %d", count);
>  	drm_connector_list_iter_end(&conn_iter);
>  
>  	return ret;
> -- 
> 2.17.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [Intel-gfx] [PATCH v2] Return only active connectors for get_resources ioctl
  2018-11-28 20:51 ` [Intel-gfx] [PATCH v2] " Daniel Vetter
@ 2018-11-28 21:21     ` Daniel Vetter
  0 siblings, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2018-11-28 21:21 UTC (permalink / raw)
  To: Stanislav Lisovskiy
  Cc: dri-devel, ville.syrjala, intel-gfx, martin.peres, stable

On Wed, Nov 28, 2018 at 09:51:13PM +0100, Daniel Vetter wrote:
> On Wed, Nov 28, 2018 at 03:55:58PM +0200, Stanislav Lisovskiy wrote:
> > Currently kernel might allocate different connector ids
> > for the same outputs in case of DP MST, which seems to
> > confuse userspace. There are can be different connector
> > ids in the list, which could be assigned to the same
> > output, while being in different states.
> > This results in issues, like external displays staying
> > blank after quick unplugging and plugging back(bug #106250).
> > Returning only active DP connectors fixes the issue.
> > 
> > v2: Removed caps from the title
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106250
> > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> > ---
> >  drivers/gpu/drm/drm_mode_config.c | 16 +++++++++++-----
> >  1 file changed, 11 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> > index ee80788f2c40..ec5b2b08a45e 100644
> > --- a/drivers/gpu/drm/drm_mode_config.c
> > +++ b/drivers/gpu/drm/drm_mode_config.c
> > @@ -143,6 +143,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
> >  	drm_connector_list_iter_begin(dev, &conn_iter);
> >  	count = 0;
> >  	connector_id = u64_to_user_ptr(card_res->connector_id_ptr);
> > +	DRM_DEBUG_KMS("GetResources: writing connectors start");
> >  	drm_for_each_connector_iter(connector, &conn_iter) {
> >  		/* only expose writeback connectors if userspace understands them */
> >  		if (!file_priv->writeback_connectors &&
> > @@ -150,15 +151,20 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
> >  			continue;
> >  
> >  		if (drm_lease_held(file_priv, connector->base.id)) {
> > -			if (count < card_res->count_connectors &&
> > -			    put_user(connector->base.id, connector_id + count)) {
> > -				drm_connector_list_iter_end(&conn_iter);
> > -				return -EFAULT;
> > +			if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort ||
> > +				connector->status != connector_status_disconnected) {
> > +				if (count < card_res->count_connectors &&
> > +				    put_user(connector->base.id, connector_id + count)) {
> > +					drm_connector_list_iter_end(&conn_iter);
> > +					return -EFAULT;
> > +				}
> > +				DRM_DEBUG_KMS("GetResources: connector %s", connector->name);
> > +				count++;
> 
> I tried to read the bug and I have no idea what's going on here. Userspace
> is supposed to shut off outputs that are disconnected, whether that's DP,
> DP MST or something else shouldn't matter. New connectors can come&go as
> they see fit. Also not really something special.
> 
> Why do we need to dynamically hide an output here? Note that this also
> affects normal DP ports, which I have no idea is actually what you want to
> do or not.

For entertainment and other reasons, testing the below diff would be
interesting.


diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 4de247ddf05f..e1b66396c83b 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -499,6 +499,8 @@ static void intel_dp_register_mst_connector(struct drm_connector *connector)
 		drm_fb_helper_add_one_connector(&dev_priv->fbdev->helper,
 						connector);
 
+	list_move(&connector->head, &connector->dev->mode_config.connector_list);
+
 	drm_connector_register(connector);
 }
 
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH v2] Return only active connectors for get_resources ioctl
@ 2018-11-28 21:21     ` Daniel Vetter
  0 siblings, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2018-11-28 21:21 UTC (permalink / raw)
  To: Stanislav Lisovskiy
  Cc: stable, intel-gfx, ville.syrjala, martin.peres, dri-devel

On Wed, Nov 28, 2018 at 09:51:13PM +0100, Daniel Vetter wrote:
> On Wed, Nov 28, 2018 at 03:55:58PM +0200, Stanislav Lisovskiy wrote:
> > Currently kernel might allocate different connector ids
> > for the same outputs in case of DP MST, which seems to
> > confuse userspace. There are can be different connector
> > ids in the list, which could be assigned to the same
> > output, while being in different states.
> > This results in issues, like external displays staying
> > blank after quick unplugging and plugging back(bug #106250).
> > Returning only active DP connectors fixes the issue.
> > 
> > v2: Removed caps from the title
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106250
> > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> > ---
> >  drivers/gpu/drm/drm_mode_config.c | 16 +++++++++++-----
> >  1 file changed, 11 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> > index ee80788f2c40..ec5b2b08a45e 100644
> > --- a/drivers/gpu/drm/drm_mode_config.c
> > +++ b/drivers/gpu/drm/drm_mode_config.c
> > @@ -143,6 +143,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
> >  	drm_connector_list_iter_begin(dev, &conn_iter);
> >  	count = 0;
> >  	connector_id = u64_to_user_ptr(card_res->connector_id_ptr);
> > +	DRM_DEBUG_KMS("GetResources: writing connectors start");
> >  	drm_for_each_connector_iter(connector, &conn_iter) {
> >  		/* only expose writeback connectors if userspace understands them */
> >  		if (!file_priv->writeback_connectors &&
> > @@ -150,15 +151,20 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
> >  			continue;
> >  
> >  		if (drm_lease_held(file_priv, connector->base.id)) {
> > -			if (count < card_res->count_connectors &&
> > -			    put_user(connector->base.id, connector_id + count)) {
> > -				drm_connector_list_iter_end(&conn_iter);
> > -				return -EFAULT;
> > +			if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort ||
> > +				connector->status != connector_status_disconnected) {
> > +				if (count < card_res->count_connectors &&
> > +				    put_user(connector->base.id, connector_id + count)) {
> > +					drm_connector_list_iter_end(&conn_iter);
> > +					return -EFAULT;
> > +				}
> > +				DRM_DEBUG_KMS("GetResources: connector %s", connector->name);
> > +				count++;
> 
> I tried to read the bug and I have no idea what's going on here. Userspace
> is supposed to shut off outputs that are disconnected, whether that's DP,
> DP MST or something else shouldn't matter. New connectors can come&go as
> they see fit. Also not really something special.
> 
> Why do we need to dynamically hide an output here? Note that this also
> affects normal DP ports, which I have no idea is actually what you want to
> do or not.

For entertainment and other reasons, testing the below diff would be
interesting.


diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 4de247ddf05f..e1b66396c83b 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -499,6 +499,8 @@ static void intel_dp_register_mst_connector(struct drm_connector *connector)
 		drm_fb_helper_add_one_connector(&dev_priv->fbdev->helper,
 						connector);
 
+	list_move(&connector->head, &connector->dev->mode_config.connector_list);
+
 	drm_connector_register(connector);
 }
 
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH v2] Return only active connectors for get_resources ioctl
  2018-11-28 21:21     ` Daniel Vetter
  (?)
@ 2018-11-28 21:24     ` Daniel Vetter
  -1 siblings, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2018-11-28 21:24 UTC (permalink / raw)
  To: Stanislav Lisovskiy
  Cc: dri-devel, ville.syrjala, intel-gfx, martin.peres, stable

On Wed, Nov 28, 2018 at 10:21:33PM +0100, Daniel Vetter wrote:
> On Wed, Nov 28, 2018 at 09:51:13PM +0100, Daniel Vetter wrote:
> > On Wed, Nov 28, 2018 at 03:55:58PM +0200, Stanislav Lisovskiy wrote:
> > > Currently kernel might allocate different connector ids
> > > for the same outputs in case of DP MST, which seems to
> > > confuse userspace. There are can be different connector
> > > ids in the list, which could be assigned to the same
> > > output, while being in different states.
> > > This results in issues, like external displays staying
> > > blank after quick unplugging and plugging back(bug #106250).
> > > Returning only active DP connectors fixes the issue.
> > > 
> > > v2: Removed caps from the title
> > > 
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106250
> > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> > > ---
> > >  drivers/gpu/drm/drm_mode_config.c | 16 +++++++++++-----
> > >  1 file changed, 11 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> > > index ee80788f2c40..ec5b2b08a45e 100644
> > > --- a/drivers/gpu/drm/drm_mode_config.c
> > > +++ b/drivers/gpu/drm/drm_mode_config.c
> > > @@ -143,6 +143,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
> > >  	drm_connector_list_iter_begin(dev, &conn_iter);
> > >  	count = 0;
> > >  	connector_id = u64_to_user_ptr(card_res->connector_id_ptr);
> > > +	DRM_DEBUG_KMS("GetResources: writing connectors start");
> > >  	drm_for_each_connector_iter(connector, &conn_iter) {
> > >  		/* only expose writeback connectors if userspace understands them */
> > >  		if (!file_priv->writeback_connectors &&
> > > @@ -150,15 +151,20 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
> > >  			continue;
> > >  
> > >  		if (drm_lease_held(file_priv, connector->base.id)) {
> > > -			if (count < card_res->count_connectors &&
> > > -			    put_user(connector->base.id, connector_id + count)) {
> > > -				drm_connector_list_iter_end(&conn_iter);
> > > -				return -EFAULT;
> > > +			if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort ||
> > > +				connector->status != connector_status_disconnected) {
> > > +				if (count < card_res->count_connectors &&
> > > +				    put_user(connector->base.id, connector_id + count)) {
> > > +					drm_connector_list_iter_end(&conn_iter);
> > > +					return -EFAULT;
> > > +				}
> > > +				DRM_DEBUG_KMS("GetResources: connector %s", connector->name);
> > > +				count++;
> > 
> > I tried to read the bug and I have no idea what's going on here. Userspace
> > is supposed to shut off outputs that are disconnected, whether that's DP,
> > DP MST or something else shouldn't matter. New connectors can come&go as
> > they see fit. Also not really something special.
> > 
> > Why do we need to dynamically hide an output here? Note that this also
> > affects normal DP ports, which I have no idea is actually what you want to
> > do or not.
> 
> For entertainment and other reasons, testing the below diff would be
> interesting.

Now also with real locking:

diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 4de247ddf05f..1b83567aa922 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -494,11 +494,16 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
 static void intel_dp_register_mst_connector(struct drm_connector *connector)
 {
 	struct drm_i915_private *dev_priv = to_i915(connector->dev);
+	struct drm_mode_config *config = &connector->dev->mode_config;
 
 	if (dev_priv->fbdev)
 		drm_fb_helper_add_one_connector(&dev_priv->fbdev->helper,
 						connector);
 
+	spin_lock_irq(&config->connector_list_lock);
+	list_move(&connector->head, &config->connector_list);
+	spin_unlock_irq(&config->connector_list_lock);
+
 	drm_connector_register(connector);
 }
 
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* ✗ Fi.CI.CHECKPATCH: warning for Return only active connectors for get_resources ioctl (rev3)
  2018-11-28 13:55 [PATCH v2] Return only active connectors for get_resources ioctl Stanislav Lisovskiy
                   ` (2 preceding siblings ...)
  2018-11-28 20:51 ` [Intel-gfx] [PATCH v2] " Daniel Vetter
@ 2018-11-28 21:51 ` Patchwork
  2018-11-28 22:17 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-11-28 21:51 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: Return only active connectors for get_resources ioctl (rev3)
URL   : https://patchwork.freedesktop.org/series/53163/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
14116c78b12f Return only active connectors for get_resources ioctl
-:26: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#26: 
> > > diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c

-:90: ERROR:MISSING_SIGN_OFF: Missing Signed-off-by: line(s)

total: 1 errors, 1 warnings, 0 checks, 16 lines checked

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

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

* ✓ Fi.CI.BAT: success for Return only active connectors for get_resources ioctl (rev3)
  2018-11-28 13:55 [PATCH v2] Return only active connectors for get_resources ioctl Stanislav Lisovskiy
                   ` (3 preceding siblings ...)
  2018-11-28 21:51 ` ✗ Fi.CI.CHECKPATCH: warning for Return only active connectors for get_resources ioctl (rev3) Patchwork
@ 2018-11-28 22:17 ` Patchwork
  2018-11-28 23:13 ` ✗ Fi.CI.IGT: failure for Return only active connectors for get_resources ioctl Patchwork
  2018-11-29  9:37 ` ✓ Fi.CI.IGT: success for Return only active connectors for get_resources ioctl (rev3) Patchwork
  6 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-11-28 22:17 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: Return only active connectors for get_resources ioctl (rev3)
URL   : https://patchwork.freedesktop.org/series/53163/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5217 -> Patchwork_10937
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/53163/revisions/3/mbox/

Known issues
------------

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_create@basic-files:
    - fi-bsw-kefka:       PASS -> FAIL [fdo#108656]

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-ivb-3520m:       PASS -> FAIL [fdo#108880]

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103167]

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
    - fi-cfl-8109u:       PASS -> INCOMPLETE [fdo#106070] / [fdo#108126]

  * {igt@runner@aborted}:
    - {fi-icl-u3}:        NOTRUN -> FAIL [fdo#108315]

  
#### Possible fixes ####

  * igt@kms_chamelium@hdmi-hpd-fast:
    - {fi-kbl-7500u}:     FAIL [fdo#108769] -> PASS

  
#### Warnings ####

  * igt@i915_selftest@live_contexts:
    - {fi-icl-u3}:        DMESG-FAIL [fdo#108569] -> INCOMPLETE [fdo#108315]

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

  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#106070]: https://bugs.freedesktop.org/show_bug.cgi?id=106070
  [fdo#108126]: https://bugs.freedesktop.org/show_bug.cgi?id=108126
  [fdo#108315]: https://bugs.freedesktop.org/show_bug.cgi?id=108315
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#108656]: https://bugs.freedesktop.org/show_bug.cgi?id=108656
  [fdo#108769]: https://bugs.freedesktop.org/show_bug.cgi?id=108769
  [fdo#108880]: https://bugs.freedesktop.org/show_bug.cgi?id=108880


Participating hosts (49 -> 44)
------------------------------

  Additional (1): fi-pnv-d510 
  Missing    (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 


Build changes
-------------

    * Linux: CI_DRM_5217 -> Patchwork_10937

  CI_DRM_5217: 3b8acd938b1edc326fb69d377cbceca8791df177 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4735: b05c028ccdb6ac8e8d8499a041bb14dfe358ee26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10937: 14116c78b12f59eb6e2b7de6f07730fa261360d6 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

14116c78b12f Return only active connectors for get_resources ioctl

== Logs ==

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

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

* ✗ Fi.CI.IGT: failure for Return only active connectors for get_resources ioctl
  2018-11-28 13:55 [PATCH v2] Return only active connectors for get_resources ioctl Stanislav Lisovskiy
                   ` (4 preceding siblings ...)
  2018-11-28 22:17 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-11-28 23:13 ` Patchwork
  2018-11-29  9:37 ` ✓ Fi.CI.IGT: success for Return only active connectors for get_resources ioctl (rev3) Patchwork
  6 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-11-28 23:13 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: Return only active connectors for get_resources ioctl
URL   : https://patchwork.freedesktop.org/series/53163/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5213_full -> Patchwork_10931_full
====================================================

Summary
-------

  **FAILURE**

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

  

Possible new issues
-------------------

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

### IGT changes ###

#### Possible regressions ####

  * igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-untiled:
    - shard-skl:          NOTRUN -> FAIL

  
#### Warnings ####

  * igt@kms_lease@lease_unleased_connector:
    - shard-apl:          PASS -> SKIP

  * igt@perf_pmu@rc6:
    - shard-kbl:          PASS -> SKIP

  * igt@tools_test@tools_test:
    - shard-snb:          PASS -> SKIP

  
Known issues
------------

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_schedule@pi-ringfull-blt:
    - shard-skl:          NOTRUN -> FAIL [fdo#103158]

  * igt@gem_ppgtt@blt-vs-render-ctxn:
    - shard-skl:          NOTRUN -> INCOMPLETE [fdo#106887]

  * igt@gem_softpin@softpin:
    - shard-apl:          PASS -> INCOMPLETE [fdo#103927]

  * igt@i915_suspend@shrink:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#108784]

  * igt@kms_atomic_transition@plane-all-modeset-transition-internal-panels:
    - {shard-iclb}:       PASS -> DMESG-WARN [fdo#107724] +16

  * igt@kms_available_modes_crc@available_mode_test_crc:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#106641]

  * igt@kms_busy@extended-modeset-hang-newfb-render-a:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-snb:          NOTRUN -> DMESG-WARN [fdo#107956]
    - {shard-iclb}:       NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_ccs@pipe-c-crc-primary-basic:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#107725]

  * igt@kms_cursor_crc@cursor-128x128-offscreen:
    - shard-glk:          PASS -> DMESG-WARN [fdo#105763] / [fdo#106538] +2

  * igt@kms_cursor_crc@cursor-256x256-dpms:
    - shard-skl:          NOTRUN -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x21-random:
    - shard-skl:          PASS -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x64-dpms:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#103232]

  * igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-xtiled:
    - {shard-iclb}:       PASS -> WARN [fdo#108336]

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-skl:          NOTRUN -> FAIL [fdo#105363]

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
    - shard-glk:          PASS -> FAIL [fdo#105363]

  * igt@kms_flip_tiling@flip-to-y-tiled:
    - shard-skl:          PASS -> FAIL [fdo#107931]

  * igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-gtt:
    - {shard-iclb}:       PASS -> DMESG-FAIL [fdo#107724] +3

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
    - shard-skl:          NOTRUN -> FAIL [fdo#105682] +2

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
    - shard-glk:          PASS -> FAIL [fdo#103167] +3

  * igt@kms_frontbuffer_tracking@fbc-shrfb-scaledprimary:
    - shard-skl:          NOTRUN -> FAIL [fdo#103167] +3

  * igt@kms_frontbuffer_tracking@fbcpsr-indfb-scaledprimary:
    - shard-skl:          PASS -> FAIL [fdo#105682]

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-render:
    - {shard-iclb}:       PASS -> DMESG-WARN [fdo#107724] / [fdo#108336] +5

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-mmap-wc:
    - {shard-iclb}:       PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@psr-suspend:
    - shard-skl:          PASS -> INCOMPLETE [fdo#104108] / [fdo#106978] / [fdo#107773]

  * igt@kms_plane@pixel-format-pipe-c-planes:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#106885]

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
    - {shard-iclb}:       PASS -> DMESG-FAIL [fdo#103166] / [fdo#107724]

  * igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
    - shard-skl:          NOTRUN -> FAIL [fdo#107815] / [fdo#108145]

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-skl:          PASS -> FAIL [fdo#107815] / [fdo#108145]

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
    - shard-skl:          NOTRUN -> FAIL [fdo#108145]

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
    - shard-glk:          PASS -> FAIL [fdo#103166]

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
    - shard-apl:          PASS -> FAIL [fdo#103166]
    - {shard-iclb}:       PASS -> FAIL [fdo#103166] +1

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
    - shard-kbl:          NOTRUN -> FAIL [fdo#103166]
    - shard-skl:          NOTRUN -> FAIL [fdo#103166] / [fdo#107815]

  * igt@kms_plane_scaling@pipe-c-scaler-with-rotation:
    - {shard-iclb}:       NOTRUN -> DMESG-WARN [fdo#107724]

  * igt@kms_rotation_crc@primary-rotation-180:
    - shard-snb:          NOTRUN -> FAIL [fdo#103925]

  * igt@kms_setmode@basic:
    - shard-hsw:          PASS -> FAIL [fdo#99912]

  * igt@pm_rpm@pm-caching:
    - shard-skl:          PASS -> INCOMPLETE [fdo#107807]

  
#### Possible fixes ####

  * igt@gem_ctx_isolation@vecs0-s3:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS

  * igt@kms_atomic_transition@plane-use-after-nonblocking-unbind-fencing:
    - shard-apl:          INCOMPLETE [fdo#103927] -> PASS +1

  * igt@kms_color@pipe-a-ctm-max:
    - shard-apl:          FAIL [fdo#108147] -> PASS

  * igt@kms_cursor_crc@cursor-256x256-dpms:
    - shard-glk:          FAIL [fdo#103232] -> PASS +2

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
    - shard-skl:          FAIL [fdo#105363] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
    - shard-apl:          FAIL [fdo#103167] -> PASS +1

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
    - {shard-iclb}:       FAIL [fdo#103167] -> PASS +3

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-glk:          FAIL [fdo#103167] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-stridechange:
    - {shard-iclb}:       FAIL [fdo#105683] -> PASS +1

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
    - shard-apl:          DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +27

  * igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
    - shard-skl:          FAIL [fdo#107815] -> PASS

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-yf:
    - {shard-iclb}:       FAIL [fdo#103166] -> PASS
    - shard-apl:          FAIL [fdo#103166] -> PASS

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
    - shard-glk:          FAIL [fdo#103166] -> PASS

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
    - shard-kbl:          DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +13

  * igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
    - {shard-iclb}:       DMESG-WARN [fdo#107724] -> PASS

  * igt@pm_rpm@modeset-non-lpsp:
    - shard-skl:          INCOMPLETE [fdo#107807] -> SKIP

  * igt@pm_rpm@system-suspend-execbuf:
    - shard-skl:          INCOMPLETE [fdo#104108] / [fdo#107807] -> PASS

  * igt@pm_rpm@universal-planes-dpms:
    - shard-skl:          INCOMPLETE [fdo#107807] -> PASS

  
#### Warnings ####

  * igt@i915_suspend@shrink:
    - shard-kbl:          INCOMPLETE [fdo#103665] / [fdo#106886] -> DMESG-WARN [fdo#108784]

  * igt@kms_cursor_crc@cursor-64x64-suspend:
    - {shard-iclb}:       FAIL [fdo#103232] -> DMESG-FAIL [fdo#103232] / [fdo#107724]

  * igt@kms_plane_alpha_blend@pipe-b-alpha-basic:
    - shard-glk:          FAIL [fdo#108145] -> DMESG-WARN [fdo#105763] / [fdo#106538]

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

  [fdo#103158]: https://bugs.freedesktop.org/show_bug.cgi?id=103158
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103925]: https://bugs.freedesktop.org/show_bug.cgi?id=103925
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
  [fdo#105683]: https://bugs.freedesktop.org/show_bug.cgi?id=105683
  [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
  [fdo#106538]: https://bugs.freedesktop.org/show_bug.cgi?id=106538
  [fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
  [fdo#106885]: https://bugs.freedesktop.org/show_bug.cgi?id=106885
  [fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
  [fdo#106887]: https://bugs.freedesktop.org/show_bug.cgi?id=106887
  [fdo#106978]: https://bugs.freedesktop.org/show_bug.cgi?id=106978
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
  [fdo#107773]: https://bugs.freedesktop.org/show_bug.cgi?id=107773
  [fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
  [fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
  [fdo#107931]: https://bugs.freedesktop.org/show_bug.cgi?id=107931
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
  [fdo#108784]: https://bugs.freedesktop.org/show_bug.cgi?id=108784
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (7 -> 7)
------------------------------

  No changes in participating hosts


Build changes
-------------

    * Linux: CI_DRM_5213 -> Patchwork_10931

  CI_DRM_5213: 5912c54d9804fb15d6a9fa2798bfef1e837c8938 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4735: b05c028ccdb6ac8e8d8499a041bb14dfe358ee26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10931: 9e2ef2ea4d7b3832772706ac56d77114c3043cb9 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* Re: [Intel-gfx] [PATCH v2] Return only active connectors for get_resources ioctl
  2018-11-28 21:21     ` Daniel Vetter
  (?)
  (?)
@ 2018-11-29  7:37     ` Lisovskiy, Stanislav
  2018-11-29  8:17       ` Lisovskiy, Stanislav
  2018-11-29  8:48       ` Daniel Vetter
  -1 siblings, 2 replies; 16+ messages in thread
From: Lisovskiy, Stanislav @ 2018-11-29  7:37 UTC (permalink / raw)
  To: daniel; +Cc: dri-devel, intel-gfx, Syrjala, Ville, stable, Peres, Martin

On Wed, 2018-11-28 at 22:21 +0100, Daniel Vetter wrote:
> On Wed, Nov 28, 2018 at 09:51:13PM +0100, Daniel Vetter wrote:
> > On Wed, Nov 28, 2018 at 03:55:58PM +0200, Stanislav Lisovskiy
> > wrote:
> > > Currently kernel might allocate different connector ids
> > > for the same outputs in case of DP MST, which seems to
> > > confuse userspace. There are can be different connector
> > > ids in the list, which could be assigned to the same
> > > output, while being in different states.
> > > This results in issues, like external displays staying
> > > blank after quick unplugging and plugging back(bug #106250).
> > > Returning only active DP connectors fixes the issue.
> > > 
> > > v2: Removed caps from the title
> > > 
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106250
> > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com
> > > >
> > > ---
> > >  drivers/gpu/drm/drm_mode_config.c | 16 +++++++++++-----
> > >  1 file changed, 11 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_mode_config.c
> > > b/drivers/gpu/drm/drm_mode_config.c
> > > index ee80788f2c40..ec5b2b08a45e 100644
> > > --- a/drivers/gpu/drm/drm_mode_config.c
> > > +++ b/drivers/gpu/drm/drm_mode_config.c
> > > @@ -143,6 +143,7 @@ int drm_mode_getresources(struct drm_device
> > > *dev, void *data,
> > >  	drm_connector_list_iter_begin(dev, &conn_iter);
> > >  	count = 0;
> > >  	connector_id = u64_to_user_ptr(card_res-
> > > >connector_id_ptr);
> > > +	DRM_DEBUG_KMS("GetResources: writing connectors start");
> > >  	drm_for_each_connector_iter(connector, &conn_iter) {
> > >  		/* only expose writeback connectors if userspace
> > > understands them */
> > >  		if (!file_priv->writeback_connectors &&
> > > @@ -150,15 +151,20 @@ int drm_mode_getresources(struct drm_device
> > > *dev, void *data,
> > >  			continue;
> > >  
> > >  		if (drm_lease_held(file_priv, connector-
> > > >base.id)) {
> > > -			if (count < card_res->count_connectors
> > > &&
> > > -			    put_user(connector->base.id,
> > > connector_id + count)) {
> > > -				drm_connector_list_iter_end(&con
> > > n_iter);
> > > -				return -EFAULT;
> > > +			if (connector->connector_type !=
> > > DRM_MODE_CONNECTOR_DisplayPort ||
> > > +				connector->status !=
> > > connector_status_disconnected) {
> > > +				if (count < card_res-
> > > >count_connectors &&
> > > +				    put_user(connector->base.id, 
> > > connector_id + count)) {
> > > +					drm_connector_list_iter_
> > > end(&conn_iter);
> > > +					return -EFAULT;
> > > +				}
> > > +				DRM_DEBUG_KMS("GetResources:
> > > connector %s", connector->name);
> > > +				count++;
> > 
> > I tried to read the bug and I have no idea what's going on here.
> > Userspace
> > is supposed to shut off outputs that are disconnected, whether
> > that's DP,
> > DP MST or something else shouldn't matter. New connectors can
> > come&go as
> > they see fit. Also not really something special.
> > 
> > Why do we need to dynamically hide an output here? Note that this
> > also
> > affects normal DP ports, which I have no idea is actually what you
> > want to
> > do or not.

This bug is real and easily reproducible with recent drm-tip.
Unplugging and then quickly plugging back periodically leaves both my
external displays connected to the docking station blank, there are
also many duplicate bugs for this, which I simply didn't track. This
patch at least fixes that annoying thing. 
The userspace seems to get confused when we are returning two different
connector ids, one in disconnected state and another in connected state
for the same output. This results in userspace believing that nothing
had changed and drm_mode_setcrtc call is not required( I have done
traces confirming that theory). 

This could be also fixed in userspace by checking connectors more
carefully - that fix I've also implemented for Intel DDX and attached
to the bug, however seems that this happens also for Wayland.

> 
> For entertainment and other reasons, testing the below diff would be
> interesting.
> 
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
> b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 4de247ddf05f..e1b66396c83b 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -499,6 +499,8 @@ static void
> intel_dp_register_mst_connector(struct drm_connector *connector)
>  		drm_fb_helper_add_one_connector(&dev_priv->fbdev-
> >helper,
>  						connector);
>  
> +	list_move(&connector->head, &connector->dev-
> >mode_config.connector_list);
> +
>  	drm_connector_register(connector);
>  }
>  
-- 
Best Regards,

Lisovskiy Stanislav

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

* Re: [Intel-gfx] [PATCH v2] Return only active connectors for get_resources ioctl
  2018-11-29  7:37     ` Lisovskiy, Stanislav
@ 2018-11-29  8:17       ` Lisovskiy, Stanislav
  2018-11-29  8:48       ` Daniel Vetter
  1 sibling, 0 replies; 16+ messages in thread
From: Lisovskiy, Stanislav @ 2018-11-29  8:17 UTC (permalink / raw)
  To: daniel; +Cc: dri-devel, intel-gfx, Syrjala, Ville, stable, Peres, Martin

On Thu, 2018-11-29 at 07:37 +0000, Lisovskiy, Stanislav wrote:
> On Wed, 2018-11-28 at 22:21 +0100, Daniel Vetter wrote:
> > 
> > > I tried to read the bug and I have no idea what's going on here.
> > > Userspace
> > > is supposed to shut off outputs that are disconnected, whether
> > > that's DP,
> > > DP MST or something else shouldn't matter. New connectors can
> > > come&go as
> > > they see fit. Also not really something special.
> > > 
> > > Why do we need to dynamically hide an output here? Note that this
> > > also
> > > affects normal DP ports, which I have no idea is actually what
> > > you
> > > want to
> > > do or not.
> 
> This bug is real and easily reproducible with recent drm-tip.
> Unplugging and then quickly plugging back periodically leaves both my
> external displays connected to the docking station blank, there are
> also many duplicate bugs for this, which I simply didn't track. This
> patch at least fixes that annoying thing. 
> The userspace seems to get confused when we are returning two
> different
> connector ids, one in disconnected state and another in connected
> state
> for the same output. This results in userspace believing that nothing
> had changed and drm_mode_setcrtc call is not required( I have done
> traces confirming that theory). 
> 
> This could be also fixed in userspace by checking connectors more
> carefully - that fix I've also implemented for Intel DDX and attached
> to the bug, however seems that this happens also for Wayland.
> 

In addition to what I said above, I checked your changes instead of
proposed(also with locking) - it doesn't help, the displays get blank
after unplug/plug.


> > 
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
> > b/drivers/gpu/drm/i915/intel_dp_mst.c
> > index 4de247ddf05f..e1b66396c83b 100644
> > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> > @@ -499,6 +499,8 @@ static void
> > intel_dp_register_mst_connector(struct drm_connector *connector)
> >  		drm_fb_helper_add_one_connector(&dev_priv->fbdev-
> > > helper,
> > 
> >  						connector);
> >  
> > +	list_move(&connector->head, &connector->dev-
> > > mode_config.connector_list);
> > 
> > +
> >  	drm_connector_register(connector);
> >  }
> >  
> 
> -- 
> Best Regards,
> 
> Lisovskiy Stanislav
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
-- 
Best Regards,

Lisovskiy Stanislav

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

* Re: [Intel-gfx] [PATCH v2] Return only active connectors for get_resources ioctl
  2018-11-29  7:37     ` Lisovskiy, Stanislav
  2018-11-29  8:17       ` Lisovskiy, Stanislav
@ 2018-11-29  8:48       ` Daniel Vetter
  2018-11-29  9:15           ` Lisovskiy, Stanislav
  1 sibling, 1 reply; 16+ messages in thread
From: Daniel Vetter @ 2018-11-29  8:48 UTC (permalink / raw)
  To: StanLis, Lyude
  Cc: dri-devel, intel-gfx, Syrjala, Ville, stable, Peres, Martin

On Thu, Nov 29, 2018 at 8:37 AM Lisovskiy, Stanislav
<stanislav.lisovskiy@intel.com> wrote:
>
> On Wed, 2018-11-28 at 22:21 +0100, Daniel Vetter wrote:
> > On Wed, Nov 28, 2018 at 09:51:13PM +0100, Daniel Vetter wrote:
> > > On Wed, Nov 28, 2018 at 03:55:58PM +0200, Stanislav Lisovskiy
> > > wrote:
> > > > Currently kernel might allocate different connector ids
> > > > for the same outputs in case of DP MST, which seems to
> > > > confuse userspace. There are can be different connector
> > > > ids in the list, which could be assigned to the same
> > > > output, while being in different states.
> > > > This results in issues, like external displays staying
> > > > blank after quick unplugging and plugging back(bug #106250).
> > > > Returning only active DP connectors fixes the issue.
> > > >
> > > > v2: Removed caps from the title
> > > >
> > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106250
> > > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com
> > > > >
> > > > ---
> > > >  drivers/gpu/drm/drm_mode_config.c | 16 +++++++++++-----
> > > >  1 file changed, 11 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/drm_mode_config.c
> > > > b/drivers/gpu/drm/drm_mode_config.c
> > > > index ee80788f2c40..ec5b2b08a45e 100644
> > > > --- a/drivers/gpu/drm/drm_mode_config.c
> > > > +++ b/drivers/gpu/drm/drm_mode_config.c
> > > > @@ -143,6 +143,7 @@ int drm_mode_getresources(struct drm_device
> > > > *dev, void *data,
> > > >   drm_connector_list_iter_begin(dev, &conn_iter);
> > > >   count = 0;
> > > >   connector_id = u64_to_user_ptr(card_res-
> > > > >connector_id_ptr);
> > > > + DRM_DEBUG_KMS("GetResources: writing connectors start");
> > > >   drm_for_each_connector_iter(connector, &conn_iter) {
> > > >           /* only expose writeback connectors if userspace
> > > > understands them */
> > > >           if (!file_priv->writeback_connectors &&
> > > > @@ -150,15 +151,20 @@ int drm_mode_getresources(struct drm_device
> > > > *dev, void *data,
> > > >                   continue;
> > > >
> > > >           if (drm_lease_held(file_priv, connector-
> > > > >base.id)) {
> > > > -                 if (count < card_res->count_connectors
> > > > &&
> > > > -                     put_user(connector->base.id,
> > > > connector_id + count)) {
> > > > -                         drm_connector_list_iter_end(&con
> > > > n_iter);
> > > > -                         return -EFAULT;
> > > > +                 if (connector->connector_type !=
> > > > DRM_MODE_CONNECTOR_DisplayPort ||
> > > > +                         connector->status !=
> > > > connector_status_disconnected) {
> > > > +                         if (count < card_res-
> > > > >count_connectors &&
> > > > +                             put_user(connector->base.id,
> > > > connector_id + count)) {
> > > > +                                 drm_connector_list_iter_
> > > > end(&conn_iter);
> > > > +                                 return -EFAULT;
> > > > +                         }
> > > > +                         DRM_DEBUG_KMS("GetResources:
> > > > connector %s", connector->name);
> > > > +                         count++;
> > >
> > > I tried to read the bug and I have no idea what's going on here.
> > > Userspace
> > > is supposed to shut off outputs that are disconnected, whether
> > > that's DP,
> > > DP MST or something else shouldn't matter. New connectors can
> > > come&go as
> > > they see fit. Also not really something special.
> > >
> > > Why do we need to dynamically hide an output here? Note that this
> > > also
> > > affects normal DP ports, which I have no idea is actually what you
> > > want to
> > > do or not.
>
> This bug is real and easily reproducible with recent drm-tip.
> Unplugging and then quickly plugging back periodically leaves both my
> external displays connected to the docking station blank, there are
> also many duplicate bugs for this, which I simply didn't track. This
> patch at least fixes that annoying thing.
> The userspace seems to get confused when we are returning two different
> connector ids, one in disconnected state and another in connected state
> for the same output. This results in userspace believing that nothing
> had changed and drm_mode_setcrtc call is not required( I have done
> traces confirming that theory).
>
> This could be also fixed in userspace by checking connectors more
> carefully - that fix I've also implemented for Intel DDX and attached
> to the bug, however seems that this happens also for Wayland.

I didn't check wayland (well, weston or any of the others, wayland
doesn't exist as an implementation), but -modesetting and -amdgpu. And
they all have the same issue. It's roughly:
- You unplug
- Kernel sends out uevent
- Userspace is slow with shutting down that output
- You replug
- Kernel creates a new connector (it's always a new connector from the
kernel's pov for MST, which might or might not happen to have the same
id as a previous one).
- Userspace sees the hotplug, and uses the PATH property to check
whether it has seen this mst connector already. This is needed on X
since you can't unplug connectors in xrandr ever, so reusing old ones
is a good idea.
- Userspace is confused.

Your fix essentially goes back to really old MST world where the
kernel yanked the MST output right away, without waiting for
userspace. That's kinda not nice. Except it's only hidden, not even
shut off, so userspace has a hard time shutting it down. It also has
the fundamental problem that if you yank&replug fast enough (fast
enough that userspace can't see the in-between unplugged state), then
nothing happens, and userspace is again confused. Aside: You want
Chris patch to implement your idea.

There's a few ways to fix this in proper fashion I think:
- We wait on the kernel side with registering the new connector until
userspace has caught up. Would be a bit a hack, and I haven't figured
out a good way yet where to put that hack. Probably the least hacky
way would be:
1. In getresources we scan all the previous connector's PATH property,
if it matches we don't (yet) expose that connector. This should only
expose the older connector.
2. In the connector cleanup work we need to fire another uevent, to
make sure userspace notices.

My little patch to order connectors the other way round was kinda
aimed at implementing this the cheap way (I think userspace ignores
all but the last connector it sees), but I guess that didn't work.

- 2nd option, and what I think we should aim for long-term: Kernel
reuses the same connector if it notices that userspace hasn't cleaned
it up yet. This is going to be real tricky to implement from a object
lifetime pov. Since the link won't work anymore we also need to send a
link_status update to inform userspace that it needs to do a modeset
(like in other cases with DP link issues). Lyude's port lifetime
rework should at least get us closer to this I think.

Cheers, Daniel

> >
> > For entertainment and other reasons, testing the below diff would be
> > interesting.
> >
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
> > b/drivers/gpu/drm/i915/intel_dp_mst.c
> > index 4de247ddf05f..e1b66396c83b 100644
> > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> > @@ -499,6 +499,8 @@ static void
> > intel_dp_register_mst_connector(struct drm_connector *connector)
> >               drm_fb_helper_add_one_connector(&dev_priv->fbdev-
> > >helper,
> >                                               connector);
> >
> > +     list_move(&connector->head, &connector->dev-
> > >mode_config.connector_list);
> > +
> >       drm_connector_register(connector);
> >  }
> >
> --
> Best Regards,
>
> Lisovskiy Stanislav



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [Intel-gfx] [PATCH v2] Return only active connectors for get_resources ioctl
  2018-11-29  8:48       ` Daniel Vetter
@ 2018-11-29  9:15           ` Lisovskiy, Stanislav
  0 siblings, 0 replies; 16+ messages in thread
From: Lisovskiy, Stanislav @ 2018-11-29  9:15 UTC (permalink / raw)
  To: daniel, lyude; +Cc: dri-devel, intel-gfx, Syrjala, Ville, stable, Peres, Martin

On Thu, 2018-11-29 at 09:48 +0100, Daniel Vetter wrote:
> I didn't check wayland (well, weston or any of the others, wayland
> doesn't exist as an implementation), but -modesetting and -amdgpu.
> And
> they all have the same issue. It's roughly:
> - You unplug
> - Kernel sends out uevent
> - Userspace is slow with shutting down that output
> - You replug
> - Kernel creates a new connector (it's always a new connector from
> the
> kernel's pov for MST, which might or might not happen to have the
> same
> id as a previous one).
> - Userspace sees the hotplug, and uses the PATH property to check
> whether it has seen this mst connector already. This is needed on X
> since you can't unplug connectors in xrandr ever, so reusing old ones
> is a good idea.
> - Userspace is confused.
> 
> Your fix essentially goes back to really old MST world where the
> kernel yanked the MST output right away, without waiting for
> userspace. That's kinda not nice. Except it's only hidden, not even
> shut off, so userspace has a hard time shutting it down. It also has
> the fundamental problem that if you yank&replug fast enough (fast
> enough that userspace can't see the in-between unplugged state), then
> nothing happens, and userspace is again confused. Aside: You want
> Chris patch to implement your idea.

To be honest, I didn't check anything except xf86-video-intel driver,
however at least it removes immediately that output from the list, if
it wasn't available with recent get_resources ioctl. So far with that
patch I didn't notice any issues(been using it for 3 weeks already).
However I agree, this might be not the best way to fix that.
Another way I could fix that is just analyze connector state like this
in ddx:

		if (sna_output->serial == serial) {
-			if (output_check_status(sna, sna_output)) {
+			if (output_check_status(sna, sna_output,
&status)) {
 				DBG(("%s: output %s (id=%d), retained
state\n",
 				     __FUNCTION__, output->name,
sna_output->id));
 				sna_output->last_detect = now;
@@ -5653,7 +5653,8 @@ void sna_mode_discover(struct sna *sna, bool
tell)
 				sna_output->last_detect = 0;
 				changed |= 4;
 			}
-			continue;
+			if (status != XF86OutputStatusDisconnected)
+				continue;
		}

DBG(("%s: removing output %s (id=%d), serial=%u [now %u]\n",
		     __FUNCTION__, output->name, sna_output->id,
		    sna_output->serial, serial));

		xf86DrvMsg(sna->scrn->scrnIndex, X_INFO,
			   "Disabled output %s\n",
			   output->name);
		sna_output->id = 0;
		sna_output->last_detect = 0;
		output->crtc = NULL;
		RROutputChanged(output->randr_output, TRUE);
		changed |= 2;

If status is disconnected, it then calls removes the output,
which does the trick. 

> 
> - 2nd option, and what I think we should aim for long-term: Kernel
> reuses the same connector if it notices that userspace hasn't cleaned
> it up yet. This is going to be real tricky to implement from a object
> lifetime pov. Since the link won't work anymore we also need to send
> a
> link_status update to inform userspace that it needs to do a modeset
> (like in other cases with DP link issues). Lyude's port lifetime
> rework should at least get us closer to this I think.

I'm actually already trying to implement this as reusing same connector
id looks correct to me, however
that fix seems to be much more complex from coding perspective and 
potentially bringing more issues. 
That is why I decided to post this patch, as at least it gives some
way to cope with that ugly behaviour - considering that the bug I'm
tracking was opened 7 month ago and this is still not fixed.

> 
> Cheers, Daniel
> 
> > > 
> > > For entertainment and other reasons, testing the below diff would
> > > be
> > > interesting.
> > > 
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
> > > b/drivers/gpu/drm/i915/intel_dp_mst.c
> > > index 4de247ddf05f..e1b66396c83b 100644
> > > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> > > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> > > @@ -499,6 +499,8 @@ static void
> > > intel_dp_register_mst_connector(struct drm_connector *connector)
> > >               drm_fb_helper_add_one_connector(&dev_priv->fbdev-
> > > > helper,
> > > 
> > >                                               connector);
> > > 
> > > +     list_move(&connector->head, &connector->dev-
> > > > mode_config.connector_list);
> > > 
> > > +
> > >       drm_connector_register(connector);
> > >  }
> > > 
> > 
> > --
> > Best Regards,
> > 
> > Lisovskiy Stanislav
> 
> 
> 
-- 
Best Regards,

Lisovskiy Stanislav

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

* Re: [PATCH v2] Return only active connectors for get_resources ioctl
@ 2018-11-29  9:15           ` Lisovskiy, Stanislav
  0 siblings, 0 replies; 16+ messages in thread
From: Lisovskiy, Stanislav @ 2018-11-29  9:15 UTC (permalink / raw)
  To: daniel, lyude; +Cc: intel-gfx, Syrjala, Ville, stable, dri-devel, Peres, Martin

On Thu, 2018-11-29 at 09:48 +0100, Daniel Vetter wrote:
> I didn't check wayland (well, weston or any of the others, wayland
> doesn't exist as an implementation), but -modesetting and -amdgpu.
> And
> they all have the same issue. It's roughly:
> - You unplug
> - Kernel sends out uevent
> - Userspace is slow with shutting down that output
> - You replug
> - Kernel creates a new connector (it's always a new connector from
> the
> kernel's pov for MST, which might or might not happen to have the
> same
> id as a previous one).
> - Userspace sees the hotplug, and uses the PATH property to check
> whether it has seen this mst connector already. This is needed on X
> since you can't unplug connectors in xrandr ever, so reusing old ones
> is a good idea.
> - Userspace is confused.
> 
> Your fix essentially goes back to really old MST world where the
> kernel yanked the MST output right away, without waiting for
> userspace. That's kinda not nice. Except it's only hidden, not even
> shut off, so userspace has a hard time shutting it down. It also has
> the fundamental problem that if you yank&replug fast enough (fast
> enough that userspace can't see the in-between unplugged state), then
> nothing happens, and userspace is again confused. Aside: You want
> Chris patch to implement your idea.

To be honest, I didn't check anything except xf86-video-intel driver,
however at least it removes immediately that output from the list, if
it wasn't available with recent get_resources ioctl. So far with that
patch I didn't notice any issues(been using it for 3 weeks already).
However I agree, this might be not the best way to fix that.
Another way I could fix that is just analyze connector state like this
in ddx:

		if (sna_output->serial == serial) {
-			if (output_check_status(sna, sna_output)) {
+			if (output_check_status(sna, sna_output,
&status)) {
 				DBG(("%s: output %s (id=%d), retained
state\n",
 				     __FUNCTION__, output->name,
sna_output->id));
 				sna_output->last_detect = now;
@@ -5653,7 +5653,8 @@ void sna_mode_discover(struct sna *sna, bool
tell)
 				sna_output->last_detect = 0;
 				changed |= 4;
 			}
-			continue;
+			if (status != XF86OutputStatusDisconnected)
+				continue;
		}

DBG(("%s: removing output %s (id=%d), serial=%u [now %u]\n",
		     __FUNCTION__, output->name, sna_output->id,
		    sna_output->serial, serial));

		xf86DrvMsg(sna->scrn->scrnIndex, X_INFO,
			   "Disabled output %s\n",
			   output->name);
		sna_output->id = 0;
		sna_output->last_detect = 0;
		output->crtc = NULL;
		RROutputChanged(output->randr_output, TRUE);
		changed |= 2;

If status is disconnected, it then calls removes the output,
which does the trick. 

> 
> - 2nd option, and what I think we should aim for long-term: Kernel
> reuses the same connector if it notices that userspace hasn't cleaned
> it up yet. This is going to be real tricky to implement from a object
> lifetime pov. Since the link won't work anymore we also need to send
> a
> link_status update to inform userspace that it needs to do a modeset
> (like in other cases with DP link issues). Lyude's port lifetime
> rework should at least get us closer to this I think.

I'm actually already trying to implement this as reusing same connector
id looks correct to me, however
that fix seems to be much more complex from coding perspective and 
potentially bringing more issues. 
That is why I decided to post this patch, as at least it gives some
way to cope with that ugly behaviour - considering that the bug I'm
tracking was opened 7 month ago and this is still not fixed.

> 
> Cheers, Daniel
> 
> > > 
> > > For entertainment and other reasons, testing the below diff would
> > > be
> > > interesting.
> > > 
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
> > > b/drivers/gpu/drm/i915/intel_dp_mst.c
> > > index 4de247ddf05f..e1b66396c83b 100644
> > > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> > > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> > > @@ -499,6 +499,8 @@ static void
> > > intel_dp_register_mst_connector(struct drm_connector *connector)
> > >               drm_fb_helper_add_one_connector(&dev_priv->fbdev-
> > > > helper,
> > > 
> > >                                               connector);
> > > 
> > > +     list_move(&connector->head, &connector->dev-
> > > > mode_config.connector_list);
> > > 
> > > +
> > >       drm_connector_register(connector);
> > >  }
> > > 
> > 
> > --
> > Best Regards,
> > 
> > Lisovskiy Stanislav
> 
> 
> 
-- 
Best Regards,

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

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

* ✓ Fi.CI.IGT: success for Return only active connectors for get_resources ioctl (rev3)
  2018-11-28 13:55 [PATCH v2] Return only active connectors for get_resources ioctl Stanislav Lisovskiy
                   ` (5 preceding siblings ...)
  2018-11-28 23:13 ` ✗ Fi.CI.IGT: failure for Return only active connectors for get_resources ioctl Patchwork
@ 2018-11-29  9:37 ` Patchwork
  6 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-11-29  9:37 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: Return only active connectors for get_resources ioctl (rev3)
URL   : https://patchwork.freedesktop.org/series/53163/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5217_full -> Patchwork_10937_full
====================================================

Summary
-------

  **WARNING**

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

  

Possible new issues
-------------------

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

### IGT changes ###

#### Warnings ####

  * igt@kms_vblank@pipe-a-ts-continuation-modeset-hang:
    - shard-snb:          SKIP -> PASS

  * igt@pm_rc6_residency@rc6-accuracy:
    - shard-snb:          PASS -> SKIP

  
Known issues
------------

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@bcs0-s3:
    - shard-skl:          PASS -> INCOMPLETE [fdo#104108] / [fdo#107773]

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
    - shard-skl:          PASS -> DMESG-WARN [fdo#107956]

  * igt@kms_ccs@pipe-c-crc-primary-rotation-180:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#107725]

  * igt@kms_color@pipe-a-legacy-gamma-reset:
    - shard-apl:          PASS -> DMESG-WARN [fdo#103558] / [fdo#105602] +3

  * igt@kms_cursor_crc@cursor-128x128-random:
    - shard-apl:          PASS -> FAIL [fdo#103232] +2

  * igt@kms_cursor_crc@cursor-128x128-suspend:
    - shard-glk:          PASS -> FAIL [fdo#103232] +1
    - shard-apl:          PASS -> FAIL [fdo#103191] / [fdo#103232]

  * igt@kms_cursor_crc@cursor-256x256-dpms:
    - shard-skl:          NOTRUN -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-256x256-sliding:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#103232] +2

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-skl:          PASS -> FAIL [fdo#105363]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-onoff:
    - shard-apl:          PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-pwrite:
    - shard-glk:          PASS -> FAIL [fdo#103167] +2

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-cpu:
    - {shard-iclb}:       PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbcpsr-stridechange:
    - shard-skl:          NOTRUN -> FAIL [fdo#105683]

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-render:
    - shard-skl:          NOTRUN -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@psr-suspend:
    - {shard-iclb}:       PASS -> INCOMPLETE [fdo#107713]

  * igt@kms_plane@plane-position-covered-pipe-b-planes:
    - shard-glk:          PASS -> FAIL [fdo#103166]

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-apl:          PASS -> FAIL [fdo#108145]

  * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
    - shard-glk:          PASS -> FAIL [fdo#108145]

  * igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
    - shard-skl:          NOTRUN -> FAIL [fdo#108145] +2

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
    - {shard-iclb}:       PASS -> FAIL [fdo#103166]

  * igt@kms_plane_scaling@pipe-b-scaler-with-pixel-format:
    - {shard-iclb}:       PASS -> DMESG-WARN [fdo#107724]

  * igt@kms_setmode@basic:
    - shard-hsw:          PASS -> FAIL [fdo#99912]

  * igt@pm_rpm@modeset-non-lpsp-stress:
    - {shard-iclb}:       SKIP -> INCOMPLETE [fdo#108840]

  * igt@pm_rpm@sysfs-read:
    - shard-skl:          PASS -> INCOMPLETE [fdo#107807]
    - {shard-iclb}:       PASS -> INCOMPLETE [fdo#107713] / [fdo#108840]

  * igt@pm_rps@waitboost:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#102250] / [fdo#108059]

  
#### Possible fixes ####

  * igt@gem_softpin@noreloc-s3:
    - shard-skl:          INCOMPLETE [fdo#104108] / [fdo#107773] -> PASS

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
    - {shard-iclb}:       DMESG-WARN [fdo#107956] -> PASS

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
    - {shard-iclb}:       DMESG-WARN [fdo#107724] / [fdo#107956] -> PASS

  * igt@kms_ccs@pipe-a-crc-primary-basic:
    - shard-skl:          FAIL [fdo#107725] -> PASS

  * igt@kms_color@pipe-a-ctm-max:
    - shard-apl:          FAIL [fdo#108147] -> PASS

  * igt@kms_color@pipe-a-gamma:
    - shard-skl:          FAIL [fdo#104782] -> PASS

  * igt@kms_cursor_crc@cursor-128x42-random:
    - shard-glk:          FAIL [fdo#103232] -> PASS

  * igt@kms_cursor_crc@cursor-64x64-sliding:
    - shard-apl:          FAIL [fdo#103232] -> PASS +1

  * igt@kms_draw_crc@draw-method-rgb565-mmap-wc-xtiled:
    - {shard-iclb}:       WARN [fdo#108336] -> PASS

  * igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-xtiled:
    - shard-skl:          FAIL [fdo#107791] -> PASS

  * igt@kms_flip@plain-flip-fb-recreate:
    - shard-skl:          FAIL [fdo#100368] -> PASS

  * igt@kms_flip_tiling@flip-to-y-tiled:
    - shard-skl:          FAIL [fdo#107931] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
    - {shard-iclb}:       FAIL [fdo#103167] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move:
    - {shard-iclb}:       DMESG-FAIL [fdo#107724] -> PASS +3

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
    - shard-apl:          FAIL [fdo#103167] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
    - shard-glk:          FAIL [fdo#103167] -> PASS +5

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-mmap-gtt:
    - {shard-iclb}:       DMESG-WARN [fdo#107724] / [fdo#108336] -> PASS +6

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
    - shard-apl:          DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +25
    - shard-skl:          FAIL [fdo#103191] / [fdo#107362] -> PASS

  * igt@kms_plane@plane-position-covered-pipe-c-planes:
    - shard-apl:          FAIL [fdo#103166] -> PASS
    - shard-glk:          FAIL [fdo#103166] -> PASS +1

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max:
    - shard-apl:          FAIL [fdo#108145] -> PASS

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          FAIL [fdo#107815] -> PASS

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
    - {shard-iclb}:       FAIL [fdo#103166] -> PASS +1

  * igt@kms_psr@no_drrs:
    - {shard-iclb}:       FAIL [fdo#108341] -> PASS

  * igt@kms_setmode@basic:
    - shard-apl:          FAIL [fdo#99912] -> PASS

  * igt@pm_rpm@cursor:
    - shard-skl:          INCOMPLETE [fdo#107807] -> PASS

  * igt@pm_rpm@debugfs-read:
    - {shard-iclb}:       DMESG-WARN [fdo#107724] -> PASS +10

  * igt@pm_rpm@i2c:
    - {shard-iclb}:       FAIL [fdo#104097] -> PASS

  * igt@pm_rpm@modeset-pc8-residency-stress:
    - shard-skl:          INCOMPLETE [fdo#107807] -> SKIP +1

  * igt@pm_rpm@universal-planes:
    - {shard-iclb}:       DMESG-WARN [fdo#108654] / [fdo#108756] -> PASS

  
#### Warnings ####

  * igt@i915_suspend@shrink:
    - shard-skl:          DMESG-WARN [fdo#108784] -> INCOMPLETE [fdo#106886]
    - shard-glk:          DMESG-WARN [fdo#108784] -> INCOMPLETE [fdo#103359] / [fdo#106886] / [k.org#198133]

  * igt@kms_cursor_crc@cursor-128x42-random:
    - {shard-iclb}:       DMESG-WARN [fdo#107724] / [fdo#108336] -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x21-random:
    - shard-apl:          DMESG-WARN [fdo#103558] / [fdo#105602] -> FAIL [fdo#103232] +1

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt:
    - {shard-iclb}:       DMESG-FAIL [fdo#107724] -> FAIL [fdo#103167]

  * igt@kms_plane@pixel-format-pipe-a-planes:
    - {shard-iclb}:       DMESG-WARN [fdo#107724] / [fdo#108336] -> FAIL [fdo#103166]

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

  [fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
  [fdo#102250]: https://bugs.freedesktop.org/show_bug.cgi?id=102250
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#105683]: https://bugs.freedesktop.org/show_bug.cgi?id=105683
  [fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
  [fdo#107773]: https://bugs.freedesktop.org/show_bug.cgi?id=107773
  [fdo#107791]: https://bugs.freedesktop.org/show_bug.cgi?id=107791
  [fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
  [fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
  [fdo#107931]: https://bugs.freedesktop.org/show_bug.cgi?id=107931
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108059]: https://bugs.freedesktop.org/show_bug.cgi?id=108059
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
  [fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
  [fdo#108654]: https://bugs.freedesktop.org/show_bug.cgi?id=108654
  [fdo#108756]: https://bugs.freedesktop.org/show_bug.cgi?id=108756
  [fdo#108784]: https://bugs.freedesktop.org/show_bug.cgi?id=108784
  [fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (7 -> 7)
------------------------------

  No changes in participating hosts


Build changes
-------------

    * Linux: CI_DRM_5217 -> Patchwork_10937

  CI_DRM_5217: 3b8acd938b1edc326fb69d377cbceca8791df177 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4735: b05c028ccdb6ac8e8d8499a041bb14dfe358ee26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10937: 14116c78b12f59eb6e2b7de6f07730fa261360d6 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

end of thread, other threads:[~2018-11-29 20:21 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28 13:55 [PATCH v2] Return only active connectors for get_resources ioctl Stanislav Lisovskiy
2018-11-28 15:26 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-11-28 15:42 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-28 20:51 ` [Intel-gfx] [PATCH v2] " Daniel Vetter
2018-11-28 21:21   ` Daniel Vetter
2018-11-28 21:21     ` Daniel Vetter
2018-11-28 21:24     ` [Intel-gfx] " Daniel Vetter
2018-11-29  7:37     ` Lisovskiy, Stanislav
2018-11-29  8:17       ` Lisovskiy, Stanislav
2018-11-29  8:48       ` Daniel Vetter
2018-11-29  9:15         ` Lisovskiy, Stanislav
2018-11-29  9:15           ` Lisovskiy, Stanislav
2018-11-28 21:51 ` ✗ Fi.CI.CHECKPATCH: warning for Return only active connectors for get_resources ioctl (rev3) Patchwork
2018-11-28 22:17 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-28 23:13 ` ✗ Fi.CI.IGT: failure for Return only active connectors for get_resources ioctl Patchwork
2018-11-29  9:37 ` ✓ Fi.CI.IGT: success for Return only active connectors for get_resources ioctl (rev3) 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.