All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks
@ 2019-09-17 12:09 Daniel Vetter
  2019-09-17 12:09 ` [PATCH 2/2] drm/doc: Improve docs around connector (un)registration Daniel Vetter
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Daniel Vetter @ 2019-09-17 12:09 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter,
	Michel Dänzer

commit 4f5368b5541a902f6596558b05f5c21a9770dd32
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Jun 14 08:17:23 2019 +0200

    drm/kms: Catch mode_object lifetime errors

uncovered a bit a mess in dp drivers. Most drivers (from a quick look,
all except i915) register all the dp stuff in their init code, which
is too early. With CONFIG_DRM_DP_AUX_CHARDEV this will blow up,
because drm_dp_aux_register tries to add a child to a device in sysfs
(the connector) which doesn't even exist yet.

No one seems to have cared thus far. But with the above change I also
moved the setting of dev->registered after the ->load callback, in an
attempt to keep old drivers from hitting any WARN_ON backtraces. But
that moved radeon.ko from the "working, by accident" to "now also
broken" category.

Since this is a huge mess I figured a revert would be simplest. But
this check has already caught issues in i915:

commit 1b9bd09630d4db4827cc04d358a41a16a6bc2cb0
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Tue Aug 20 19:16:57 2019 +0300

    drm/i915: Do not create a new max_bpc prop for MST connectors

Hence I'd like to retain it. Fix the radeon regression by moving the
setting of dev->registered back to were it was, and stop the
backtraces with an explicit check for dev->driver->load.

Everyone else will stay as broken with CONFIG_DRM_DP_AUX_CHARDEV. The
next patch will improve the kerneldoc and add a todo entry for this.

Fixes: 4f5368b5541a ("drm/kms: Catch mode_object lifetime errors")
Cc: Sean Paul <sean@poorly.run>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reported-by: Michel Dänzer <michel@daenzer.net>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_drv.c         | 4 ++--
 drivers/gpu/drm/drm_mode_object.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index b634882056c8..0c9978af9f72 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -983,14 +983,14 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
 	if (ret)
 		goto err_minors;
 
+	dev->registered = true;
+
 	if (dev->driver->load) {
 		ret = dev->driver->load(dev, flags);
 		if (ret)
 			goto err_minors;
 	}
 
-	dev->registered = true;
-
 	if (drm_core_check_feature(dev, DRIVER_MODESET))
 		drm_modeset_register_all(dev);
 
diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
index c355ba8e6d5d..6a23e36ed4fe 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -42,7 +42,7 @@ int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
 {
 	int ret;
 
-	WARN_ON(dev->registered && !obj_free_cb);
+	WARN_ON(!dev->driver->load && dev->registered && !obj_free_cb);
 
 	mutex_lock(&dev->mode_config.idr_mutex);
 	ret = idr_alloc(&dev->mode_config.object_idr, register_obj ? obj : NULL,
@@ -104,7 +104,7 @@ void drm_mode_object_register(struct drm_device *dev,
 void drm_mode_object_unregister(struct drm_device *dev,
 				struct drm_mode_object *object)
 {
-	WARN_ON(dev->registered && !object->free_cb);
+	WARN_ON(!dev->driver->load && dev->registered && !object->free_cb);
 
 	mutex_lock(&dev->mode_config.idr_mutex);
 	if (object->id) {
-- 
2.23.0

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

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

* [PATCH 2/2] drm/doc: Improve docs around connector (un)registration
  2019-09-17 12:09 [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks Daniel Vetter
@ 2019-09-17 12:09 ` Daniel Vetter
  2019-09-17 19:40   ` Lyude Paul
  2019-09-17 13:06 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks Patchwork
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2019-09-17 12:09 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, Michel Dänzer,
	Daniel Vetter

Current code is quite a mess unfortunately, so also add a todo.rst
entry to maybe fix it up eventually.

Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 Documentation/gpu/todo.rst      | 12 ++++++++++++
 drivers/gpu/drm/drm_connector.c | 10 ++++++++--
 drivers/gpu/drm/drm_dp_helper.c |  8 ++++++++
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 32787acff0a8..8dc147c93c9c 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -284,6 +284,18 @@ drm_fb_helper tasks
   removed: drm_fb_helper_single_add_all_connectors(),
   drm_fb_helper_add_one_connector() and drm_fb_helper_remove_one_connector().
 
+connector register/unregister fixes
+-----------------------------------
+
+- For most connectors it's a no-op to call drm_connector_register/unregister
+  directly from driver code, drm_dev_register/unregister take care of this
+  already. We can remove all of them.
+
+- For dp drivers it's a bit more a mess, since we need the connector to be
+  registered when calling drm_dp_aux_register. Fix this by instead calling
+  drm_dp_aux_init, and moving the actual registering into a late_register
+  callback as recommended in the kerneldoc.
+
 Core refactorings
 =================
 
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 4c766624b20d..cd5048ceab1d 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -480,7 +480,10 @@ EXPORT_SYMBOL(drm_connector_cleanup);
  * drm_connector_register - register a connector
  * @connector: the connector to register
  *
- * Register userspace interfaces for a connector
+ * Register userspace interfaces for a connector. Only call this for connectors
+ * which can be hotplugged after drm_dev_register() has been called already,
+ * e.g. DP MST connectors. All other connectors will be registered automatically
+ * when calling drm_dev_register().
  *
  * Returns:
  * Zero on success, error code on failure.
@@ -526,7 +529,10 @@ EXPORT_SYMBOL(drm_connector_register);
  * drm_connector_unregister - unregister a connector
  * @connector: the connector to unregister
  *
- * Unregister userspace interfaces for a connector
+ * Unregister userspace interfaces for a connector. Only call this for
+ * connectors which have registered explicitly by calling drm_dev_register(),
+ * since connectors are unregistered automatically when drm_dev_unregister() is
+ * called.
  */
 void drm_connector_unregister(struct drm_connector *connector)
 {
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..f373798d82f6 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -1109,6 +1109,14 @@ EXPORT_SYMBOL(drm_dp_aux_init);
  * @aux: DisplayPort AUX channel
  *
  * Automatically calls drm_dp_aux_init() if this hasn't been done yet.
+ * This should only be called when the underlying &struct drm_connector is
+ * initialiazed already. Therefore the best place to call this is from
+ * &drm_connector_funcs.late_register. Not that drivers which don't follow this
+ * will Oops when CONFIG_DRM_DP_AUX_CHARDEV is enabled.
+ *
+ * Drivers which need to use the aux channel before that point (e.g. at driver
+ * load time, before drm_dev_register() has been called) need to call
+ * drm_dp_aux_init().
  *
  * Returns 0 on success or a negative error code on failure.
  */
-- 
2.23.0

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

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

* ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks
  2019-09-17 12:09 [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks Daniel Vetter
  2019-09-17 12:09 ` [PATCH 2/2] drm/doc: Improve docs around connector (un)registration Daniel Vetter
@ 2019-09-17 13:06 ` Patchwork
  2019-09-17 13:27 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-09-17 13:06 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks
URL   : https://patchwork.freedesktop.org/series/66812/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
ae5a3497bdd7 drm/kms: Duct-tape for mode object lifetime checks
-:9: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 4f5368b5541a ("drm/kms: Catch mode_object lifetime errors")'
#9: 
commit 4f5368b5541a902f6596558b05f5c21a9770dd32

-:30: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 1b9bd09630d4 ("drm/i915: Do not create a new max_bpc prop for MST connectors")'
#30: 
commit 1b9bd09630d4db4827cc04d358a41a16a6bc2cb0

-:92: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>'

total: 2 errors, 1 warnings, 0 checks, 32 lines checked
b54d85a3890c drm/doc: Improve docs around connector (un)registration
-:84: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>'

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

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

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

* ✓ Fi.CI.BAT: success for series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks
  2019-09-17 12:09 [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks Daniel Vetter
  2019-09-17 12:09 ` [PATCH 2/2] drm/doc: Improve docs around connector (un)registration Daniel Vetter
  2019-09-17 13:06 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks Patchwork
@ 2019-09-17 13:27 ` Patchwork
  2019-09-17 14:48 ` [PATCH 1/2] " Michel Dänzer
  2019-09-17 21:43 ` ✓ Fi.CI.IGT: success for series starting with [1/2] " Patchwork
  4 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-09-17 13:27 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks
URL   : https://patchwork.freedesktop.org/series/66812/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6908 -> Patchwork_14429
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_execlists:
    - fi-skl-gvtdvm:      [PASS][1] -> [DMESG-FAIL][2] ([fdo#111108])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html

  * igt@kms_chamelium@hdmi-edid-read:
    - fi-icl-u2:          [PASS][3] -> [FAIL][4] ([fdo#109483])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/fi-icl-u2/igt@kms_chamelium@hdmi-edid-read.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/fi-icl-u2/igt@kms_chamelium@hdmi-edid-read.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-icl-u2:          [PASS][5] -> [FAIL][6] ([fdo#103167])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/fi-icl-u2/igt@kms_frontbuffer_tracking@basic.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/fi-icl-u2/igt@kms_frontbuffer_tracking@basic.html

  * igt@prime_busy@basic-wait-after-default:
    - fi-icl-u3:          [PASS][7] -> [DMESG-WARN][8] ([fdo#107724]) +2 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/fi-icl-u3/igt@prime_busy@basic-wait-after-default.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/fi-icl-u3/igt@prime_busy@basic-wait-after-default.html

  
#### Possible fixes ####

  * igt@gem_exec_fence@nb-await-default:
    - {fi-tgl-u}:         [WARN][9] ([fdo#111597]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/fi-tgl-u/igt@gem_exec_fence@nb-await-default.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/fi-tgl-u/igt@gem_exec_fence@nb-await-default.html

  * igt@gem_flink_basic@double-flink:
    - fi-icl-u3:          [DMESG-WARN][11] ([fdo#107724]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/fi-icl-u3/igt@gem_flink_basic@double-flink.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/fi-icl-u3/igt@gem_flink_basic@double-flink.html

  
  {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#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#109483]: https://bugs.freedesktop.org/show_bug.cgi?id=109483
  [fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
  [fdo#111108]: https://bugs.freedesktop.org/show_bug.cgi?id=111108
  [fdo#111597]: https://bugs.freedesktop.org/show_bug.cgi?id=111597


Participating hosts (55 -> 47)
------------------------------

  Missing    (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-bdw-samus fi-byt-clapper fi-skl-6700k2 


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

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6908 -> Patchwork_14429

  CI-20190529: 20190529
  CI_DRM_6908: c09b47830224c06546b73417085f7c6880a3995a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5188: 933b84d5585698e15542ea1c5627d5d8d63ce230 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14429: b54d85a3890c61287745d72ef52f6ca4075564d5 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

b54d85a3890c drm/doc: Improve docs around connector (un)registration
ae5a3497bdd7 drm/kms: Duct-tape for mode object lifetime checks

== Logs ==

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

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

* Re: [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks
  2019-09-17 12:09 [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks Daniel Vetter
                   ` (2 preceding siblings ...)
  2019-09-17 13:27 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2019-09-17 14:48 ` Michel Dänzer
  2019-09-18  9:27   ` Daniel Vetter
  2019-09-17 21:43 ` ✓ Fi.CI.IGT: success for series starting with [1/2] " Patchwork
  4 siblings, 1 reply; 9+ messages in thread
From: Michel Dänzer @ 2019-09-17 14:48 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, Sean Paul

On 2019-09-17 2:09 p.m., Daniel Vetter wrote:
> commit 4f5368b5541a902f6596558b05f5c21a9770dd32
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Fri Jun 14 08:17:23 2019 +0200
> 
>     drm/kms: Catch mode_object lifetime errors
> 
> uncovered a bit a mess in dp drivers. Most drivers (from a quick look,
> all except i915) register all the dp stuff in their init code, which
> is too early. With CONFIG_DRM_DP_AUX_CHARDEV this will blow up,
> because drm_dp_aux_register tries to add a child to a device in sysfs
> (the connector) which doesn't even exist yet.
> 
> No one seems to have cared thus far. But with the above change I also
> moved the setting of dev->registered after the ->load callback, in an
> attempt to keep old drivers from hitting any WARN_ON backtraces. But
> that moved radeon.ko from the "working, by accident" to "now also
> broken" category.
> 
> Since this is a huge mess I figured a revert would be simplest. But
> this check has already caught issues in i915:
> 
> commit 1b9bd09630d4db4827cc04d358a41a16a6bc2cb0
> Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Date:   Tue Aug 20 19:16:57 2019 +0300
> 
>     drm/i915: Do not create a new max_bpc prop for MST connectors
> 
> Hence I'd like to retain it. Fix the radeon regression by moving the
> setting of dev->registered back to were it was, and stop the
> backtraces with an explicit check for dev->driver->load.
> 
> Everyone else will stay as broken with CONFIG_DRM_DP_AUX_CHARDEV. The
> next patch will improve the kerneldoc and add a todo entry for this.
> 
> Fixes: 4f5368b5541a ("drm/kms: Catch mode_object lifetime errors")
> Cc: Sean Paul <sean@poorly.run>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Reported-by: Michel Dänzer <michel@daenzer.net>
> Cc: Michel Dänzer <michel@daenzer.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>

Thanks!


-- 
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 2/2] drm/doc: Improve docs around connector (un)registration
  2019-09-17 12:09 ` [PATCH 2/2] drm/doc: Improve docs around connector (un)registration Daniel Vetter
@ 2019-09-17 19:40   ` Lyude Paul
  2019-09-18  9:28     ` Daniel Vetter
  0 siblings, 1 reply; 9+ messages in thread
From: Lyude Paul @ 2019-09-17 19:40 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, Michel Dänzer

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Tue, 2019-09-17 at 14:09 +0200, Daniel Vetter wrote:
> Current code is quite a mess unfortunately, so also add a todo.rst
> entry to maybe fix it up eventually.
> 
> Cc: Michel Dänzer <michel@daenzer.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  Documentation/gpu/todo.rst      | 12 ++++++++++++
>  drivers/gpu/drm/drm_connector.c | 10 ++++++++--
>  drivers/gpu/drm/drm_dp_helper.c |  8 ++++++++
>  3 files changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 32787acff0a8..8dc147c93c9c 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -284,6 +284,18 @@ drm_fb_helper tasks
>    removed: drm_fb_helper_single_add_all_connectors(),
>    drm_fb_helper_add_one_connector() and
> drm_fb_helper_remove_one_connector().
>  
> +connector register/unregister fixes
> +-----------------------------------
> +
> +- For most connectors it's a no-op to call
> drm_connector_register/unregister
> +  directly from driver code, drm_dev_register/unregister take care of this
> +  already. We can remove all of them.
> +
> +- For dp drivers it's a bit more a mess, since we need the connector to be
> +  registered when calling drm_dp_aux_register. Fix this by instead calling
> +  drm_dp_aux_init, and moving the actual registering into a late_register
> +  callback as recommended in the kerneldoc.
> +
>  Core refactorings
>  =================
>  
> diff --git a/drivers/gpu/drm/drm_connector.c
> b/drivers/gpu/drm/drm_connector.c
> index 4c766624b20d..cd5048ceab1d 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -480,7 +480,10 @@ EXPORT_SYMBOL(drm_connector_cleanup);
>   * drm_connector_register - register a connector
>   * @connector: the connector to register
>   *
> - * Register userspace interfaces for a connector
> + * Register userspace interfaces for a connector. Only call this for
> connectors
> + * which can be hotplugged after drm_dev_register() has been called
> already,
> + * e.g. DP MST connectors. All other connectors will be registered
> automatically
> + * when calling drm_dev_register().
>   *
>   * Returns:
>   * Zero on success, error code on failure.
> @@ -526,7 +529,10 @@ EXPORT_SYMBOL(drm_connector_register);
>   * drm_connector_unregister - unregister a connector
>   * @connector: the connector to unregister
>   *
> - * Unregister userspace interfaces for a connector
> + * Unregister userspace interfaces for a connector. Only call this for
> + * connectors which have registered explicitly by calling
> drm_dev_register(),
> + * since connectors are unregistered automatically when
> drm_dev_unregister() is
> + * called.
>   */
>  void drm_connector_unregister(struct drm_connector *connector)
>  {
> diff --git a/drivers/gpu/drm/drm_dp_helper.c
> b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..f373798d82f6 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -1109,6 +1109,14 @@ EXPORT_SYMBOL(drm_dp_aux_init);
>   * @aux: DisplayPort AUX channel
>   *
>   * Automatically calls drm_dp_aux_init() if this hasn't been done yet.
> + * This should only be called when the underlying &struct drm_connector is
> + * initialiazed already. Therefore the best place to call this is from
> + * &drm_connector_funcs.late_register. Not that drivers which don't follow
> this
> + * will Oops when CONFIG_DRM_DP_AUX_CHARDEV is enabled.
> + *
> + * Drivers which need to use the aux channel before that point (e.g. at
> driver
> + * load time, before drm_dev_register() has been called) need to call
> + * drm_dp_aux_init().
>   *
>   * Returns 0 on success or a negative error code on failure.
>   */
-- 
Cheers,
	Lyude Paul

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

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

* ✓ Fi.CI.IGT: success for series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks
  2019-09-17 12:09 [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks Daniel Vetter
                   ` (3 preceding siblings ...)
  2019-09-17 14:48 ` [PATCH 1/2] " Michel Dänzer
@ 2019-09-17 21:43 ` Patchwork
  4 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-09-17 21:43 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks
URL   : https://patchwork.freedesktop.org/series/66812/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6908_full -> Patchwork_14429_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_balancer@smoke:
    - shard-iclb:         [PASS][1] -> [SKIP][2] ([fdo#110854])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb2/igt@gem_exec_balancer@smoke.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb6/igt@gem_exec_balancer@smoke.html

  * igt@gem_exec_schedule@preempt-contexts-bsd2:
    - shard-iclb:         [PASS][3] -> [SKIP][4] ([fdo#109276]) +11 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb2/igt@gem_exec_schedule@preempt-contexts-bsd2.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb6/igt@gem_exec_schedule@preempt-contexts-bsd2.html

  * igt@gem_exec_schedule@wide-bsd:
    - shard-iclb:         [PASS][5] -> [SKIP][6] ([fdo#111325]) +4 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb8/igt@gem_exec_schedule@wide-bsd.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb2/igt@gem_exec_schedule@wide-bsd.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-skl:          [PASS][7] -> [INCOMPLETE][8] ([fdo#104108]) +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-skl6/igt@gem_workarounds@suspend-resume-context.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-skl8/igt@gem_workarounds@suspend-resume-context.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-apl:          [PASS][9] -> [DMESG-WARN][10] ([fdo#108566]) +4 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-apl7/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-apl6/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-shrfb-plflip-blt:
    - shard-iclb:         [PASS][11] -> [FAIL][12] ([fdo#103167]) +5 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-shrfb-plflip-blt.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-shrfb-plflip-blt.html

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-move:
    - shard-skl:          [PASS][13] -> [FAIL][14] ([fdo#103167])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-skl3/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-move.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-skl7/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-move.html

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
    - shard-skl:          [PASS][15] -> [FAIL][16] ([fdo#108145])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-skl2/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-skl4/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [PASS][17] -> [SKIP][18] ([fdo#109642] / [fdo#111068])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb2/igt@kms_psr2_su@frontbuffer.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb3/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [PASS][19] -> [SKIP][20] ([fdo#109441]) +4 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb7/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_setmode@basic:
    - shard-hsw:          [PASS][21] -> [FAIL][22] ([fdo#99912])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-hsw5/igt@kms_setmode@basic.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-hsw5/igt@kms_setmode@basic.html

  * igt@tools_test@tools_test:
    - shard-kbl:          [PASS][23] -> [SKIP][24] ([fdo#109271])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-kbl3/igt@tools_test@tools_test.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-kbl6/igt@tools_test@tools_test.html

  
#### Possible fixes ####

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [SKIP][25] ([fdo#110841]) -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb4/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb5/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_schedule@preempt-queue-chain-bsd:
    - shard-iclb:         [SKIP][27] ([fdo#111325]) -> [PASS][28] +1 similar issue
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb2/igt@gem_exec_schedule@preempt-queue-chain-bsd.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb7/igt@gem_exec_schedule@preempt-queue-chain-bsd.html

  * igt@i915_suspend@fence-restore-tiled2untiled:
    - shard-apl:          [DMESG-WARN][29] ([fdo#108566]) -> [PASS][30] +4 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-apl3/igt@i915_suspend@fence-restore-tiled2untiled.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-apl3/igt@i915_suspend@fence-restore-tiled2untiled.html

  * igt@kms_color@pipe-b-legacy-gamma:
    - shard-skl:          [FAIL][31] ([fdo#104782]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-skl7/igt@kms_color@pipe-b-legacy-gamma.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-skl4/igt@kms_color@pipe-b-legacy-gamma.html

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
    - shard-hsw:          [FAIL][33] ([fdo#105767]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-hsw1/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-hsw5/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt:
    - shard-iclb:         [FAIL][35] ([fdo#103167]) -> [PASS][36] +4 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb4/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt.html

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-mmap-gtt:
    - shard-skl:          [FAIL][37] ([fdo#103167]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-skl6/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-mmap-gtt.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-skl8/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-mmap-gtt.html

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
    - shard-skl:          [FAIL][39] ([fdo#108145]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-skl6/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-skl7/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html

  * igt@kms_psr@psr2_sprite_mmap_gtt:
    - shard-iclb:         [SKIP][41] ([fdo#109441]) -> [PASS][42] +1 similar issue
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb3/igt@kms_psr@psr2_sprite_mmap_gtt.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html

  * igt@kms_vblank@pipe-b-wait-busy:
    - shard-snb:          [SKIP][43] ([fdo#109271]) -> [PASS][44] +2 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-snb7/igt@kms_vblank@pipe-b-wait-busy.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-snb6/igt@kms_vblank@pipe-b-wait-busy.html

  * igt@perf@blocking:
    - shard-skl:          [FAIL][45] ([fdo#110728]) -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-skl5/igt@perf@blocking.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-skl7/igt@perf@blocking.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [SKIP][47] ([fdo#109276]) -> [PASS][48] +14 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb8/igt@prime_busy@hang-bsd2.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb2/igt@prime_busy@hang-bsd2.html

  
#### Warnings ####

  * igt@gem_ctx_isolation@vcs1-nonpriv:
    - shard-iclb:         [SKIP][49] ([fdo#109276]) -> [FAIL][50] ([fdo#111329])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb6/igt@gem_ctx_isolation@vcs1-nonpriv.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb1/igt@gem_ctx_isolation@vcs1-nonpriv.html

  * igt@gem_mocs_settings@mocs-reset-bsd2:
    - shard-iclb:         [FAIL][51] ([fdo#111330]) -> [SKIP][52] ([fdo#109276]) +2 similar issues
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-iclb2/igt@gem_mocs_settings@mocs-reset-bsd2.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-iclb3/igt@gem_mocs_settings@mocs-reset-bsd2.html

  * igt@gen3_render_linear_blits:
    - shard-apl:          [SKIP][53] ([fdo#109271]) -> [INCOMPLETE][54] ([fdo#103927])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-apl1/igt@gen3_render_linear_blits.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-apl2/igt@gen3_render_linear_blits.html

  * igt@kms_atomic_transition@4x-modeset-transitions-fencing:
    - shard-snb:          [SKIP][55] ([fdo#109271]) -> [SKIP][56] ([fdo#109271] / [fdo#109278])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6908/shard-snb7/igt@kms_atomic_transition@4x-modeset-transitions-fencing.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14429/shard-snb6/igt@kms_atomic_transition@4x-modeset-transitions-fencing.html

  
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
  [fdo#111329]: https://bugs.freedesktop.org/show_bug.cgi?id=111329
  [fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (10 -> 10)
------------------------------

  No changes in participating hosts


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

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6908 -> Patchwork_14429

  CI-20190529: 20190529
  CI_DRM_6908: c09b47830224c06546b73417085f7c6880a3995a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5188: 933b84d5585698e15542ea1c5627d5d8d63ce230 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14429: b54d85a3890c61287745d72ef52f6ca4075564d5 @ 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_14429/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks
  2019-09-17 14:48 ` [PATCH 1/2] " Michel Dänzer
@ 2019-09-18  9:27   ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2019-09-18  9:27 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Daniel Vetter, Intel Graphics Development, Sean Paul,
	DRI Development, Daniel Vetter

On Tue, Sep 17, 2019 at 04:48:51PM +0200, Michel Dänzer wrote:
> On 2019-09-17 2:09 p.m., Daniel Vetter wrote:
> > commit 4f5368b5541a902f6596558b05f5c21a9770dd32
> > Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Date:   Fri Jun 14 08:17:23 2019 +0200
> > 
> >     drm/kms: Catch mode_object lifetime errors
> > 
> > uncovered a bit a mess in dp drivers. Most drivers (from a quick look,
> > all except i915) register all the dp stuff in their init code, which
> > is too early. With CONFIG_DRM_DP_AUX_CHARDEV this will blow up,
> > because drm_dp_aux_register tries to add a child to a device in sysfs
> > (the connector) which doesn't even exist yet.
> > 
> > No one seems to have cared thus far. But with the above change I also
> > moved the setting of dev->registered after the ->load callback, in an
> > attempt to keep old drivers from hitting any WARN_ON backtraces. But
> > that moved radeon.ko from the "working, by accident" to "now also
> > broken" category.
> > 
> > Since this is a huge mess I figured a revert would be simplest. But
> > this check has already caught issues in i915:
> > 
> > commit 1b9bd09630d4db4827cc04d358a41a16a6bc2cb0
> > Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Date:   Tue Aug 20 19:16:57 2019 +0300
> > 
> >     drm/i915: Do not create a new max_bpc prop for MST connectors
> > 
> > Hence I'd like to retain it. Fix the radeon regression by moving the
> > setting of dev->registered back to were it was, and stop the
> > backtraces with an explicit check for dev->driver->load.
> > 
> > Everyone else will stay as broken with CONFIG_DRM_DP_AUX_CHARDEV. The
> > next patch will improve the kerneldoc and add a todo entry for this.
> > 
> > Fixes: 4f5368b5541a ("drm/kms: Catch mode_object lifetime errors")
> > Cc: Sean Paul <sean@poorly.run>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Reported-by: Michel Dänzer <michel@daenzer.net>
> > Cc: Michel Dänzer <michel@daenzer.net>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> 
> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
> Tested-by: Michel Dänzer <mdaenzer@redhat.com>

Thanks, merged into drm-misc-next-fixes.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 2/2] drm/doc: Improve docs around connector (un)registration
  2019-09-17 19:40   ` Lyude Paul
@ 2019-09-18  9:28     ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2019-09-18  9:28 UTC (permalink / raw)
  To: Lyude Paul
  Cc: Daniel Vetter, Intel Graphics Development, Michel Dänzer,
	DRI Development, Daniel Vetter

On Tue, Sep 17, 2019 at 03:40:29PM -0400, Lyude Paul wrote:
> Reviewed-by: Lyude Paul <lyude@redhat.com>

Thanks for taking a look, pushed to drm-misc-next.
-Daniel
> 
> On Tue, 2019-09-17 at 14:09 +0200, Daniel Vetter wrote:
> > Current code is quite a mess unfortunately, so also add a todo.rst
> > entry to maybe fix it up eventually.
> > 
> > Cc: Michel Dänzer <michel@daenzer.net>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  Documentation/gpu/todo.rst      | 12 ++++++++++++
> >  drivers/gpu/drm/drm_connector.c | 10 ++++++++--
> >  drivers/gpu/drm/drm_dp_helper.c |  8 ++++++++
> >  3 files changed, 28 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> > index 32787acff0a8..8dc147c93c9c 100644
> > --- a/Documentation/gpu/todo.rst
> > +++ b/Documentation/gpu/todo.rst
> > @@ -284,6 +284,18 @@ drm_fb_helper tasks
> >    removed: drm_fb_helper_single_add_all_connectors(),
> >    drm_fb_helper_add_one_connector() and
> > drm_fb_helper_remove_one_connector().
> >  
> > +connector register/unregister fixes
> > +-----------------------------------
> > +
> > +- For most connectors it's a no-op to call
> > drm_connector_register/unregister
> > +  directly from driver code, drm_dev_register/unregister take care of this
> > +  already. We can remove all of them.
> > +
> > +- For dp drivers it's a bit more a mess, since we need the connector to be
> > +  registered when calling drm_dp_aux_register. Fix this by instead calling
> > +  drm_dp_aux_init, and moving the actual registering into a late_register
> > +  callback as recommended in the kerneldoc.
> > +
> >  Core refactorings
> >  =================
> >  
> > diff --git a/drivers/gpu/drm/drm_connector.c
> > b/drivers/gpu/drm/drm_connector.c
> > index 4c766624b20d..cd5048ceab1d 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > @@ -480,7 +480,10 @@ EXPORT_SYMBOL(drm_connector_cleanup);
> >   * drm_connector_register - register a connector
> >   * @connector: the connector to register
> >   *
> > - * Register userspace interfaces for a connector
> > + * Register userspace interfaces for a connector. Only call this for
> > connectors
> > + * which can be hotplugged after drm_dev_register() has been called
> > already,
> > + * e.g. DP MST connectors. All other connectors will be registered
> > automatically
> > + * when calling drm_dev_register().
> >   *
> >   * Returns:
> >   * Zero on success, error code on failure.
> > @@ -526,7 +529,10 @@ EXPORT_SYMBOL(drm_connector_register);
> >   * drm_connector_unregister - unregister a connector
> >   * @connector: the connector to unregister
> >   *
> > - * Unregister userspace interfaces for a connector
> > + * Unregister userspace interfaces for a connector. Only call this for
> > + * connectors which have registered explicitly by calling
> > drm_dev_register(),
> > + * since connectors are unregistered automatically when
> > drm_dev_unregister() is
> > + * called.
> >   */
> >  void drm_connector_unregister(struct drm_connector *connector)
> >  {
> > diff --git a/drivers/gpu/drm/drm_dp_helper.c
> > b/drivers/gpu/drm/drm_dp_helper.c
> > index ffc68d305afe..f373798d82f6 100644
> > --- a/drivers/gpu/drm/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > @@ -1109,6 +1109,14 @@ EXPORT_SYMBOL(drm_dp_aux_init);
> >   * @aux: DisplayPort AUX channel
> >   *
> >   * Automatically calls drm_dp_aux_init() if this hasn't been done yet.
> > + * This should only be called when the underlying &struct drm_connector is
> > + * initialiazed already. Therefore the best place to call this is from
> > + * &drm_connector_funcs.late_register. Not that drivers which don't follow
> > this
> > + * will Oops when CONFIG_DRM_DP_AUX_CHARDEV is enabled.
> > + *
> > + * Drivers which need to use the aux channel before that point (e.g. at
> > driver
> > + * load time, before drm_dev_register() has been called) need to call
> > + * drm_dp_aux_init().
> >   *
> >   * Returns 0 on success or a negative error code on failure.
> >   */
> -- 
> Cheers,
> 	Lyude Paul
> 

-- 
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	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-09-18  9:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 12:09 [PATCH 1/2] drm/kms: Duct-tape for mode object lifetime checks Daniel Vetter
2019-09-17 12:09 ` [PATCH 2/2] drm/doc: Improve docs around connector (un)registration Daniel Vetter
2019-09-17 19:40   ` Lyude Paul
2019-09-18  9:28     ` Daniel Vetter
2019-09-17 13:06 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/kms: Duct-tape for mode object lifetime checks Patchwork
2019-09-17 13:27 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-17 14:48 ` [PATCH 1/2] " Michel Dänzer
2019-09-18  9:27   ` Daniel Vetter
2019-09-17 21:43 ` ✓ Fi.CI.IGT: success for series starting with [1/2] " 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.