intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 03/11] drm/connector: Add deprication notes for drm_connector_register/unregister
Date: Thu, 12 Dec 2024 12:10:58 +0200	[thread overview]
Message-ID: <87ed2dxlcd.fsf@intel.com> (raw)
In-Reply-To: <20241211230328.4012496-4-imre.deak@intel.com>

On Thu, 12 Dec 2024, Imre Deak <imre.deak@intel.com> wrote:
> Drivers should register/unregister only dynamic (MST) connectors
> manually using drm_connector_dynamic_register()/unregister().
> Static connectors are registered/unregistered by the DRM core
> automatically. Some drivers still call drm_connector_register()/
> unregister() for static connectors, both of which should be a nop
> for them and hence are scheduled to be removed. Update the function
> documentation for these functions accordingly.

Typo *deprecation in subject, nitpick inline,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/drm_connector.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index a53e5629ba6c1..c322dbf6e3161 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -767,14 +767,17 @@ EXPORT_SYMBOL(drm_connector_cleanup);
>   * drm_connector_register - register a connector
>   * @connector: the connector to register
>   *
> - * 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().
> + * Register userspace interfaces for a connector. Drivers shouldn't call this
> + * function. Static connectors will be registered automatically by DRM core
> + * from drm_dev_register(), dynamic connectors (MST) should be registered by
> + * drivers calling drm_connector_dynamic_register().
>   *
>   * When the connector is no longer available, callers must call
>   * drm_connector_unregister().
>   *
> + * Note: Existing uses of this function in drivers should be a nop already and
> + * are scheduled to be removed.
> + *
>   * Returns:
>   * Zero on success, error code on failure.
>   */
> @@ -863,9 +866,14 @@ EXPORT_SYMBOL(drm_connector_dynamic_register);
>   * drm_connector_unregister - unregister a connector
>   * @connector: the connector to unregister
>   *
> - * Unregister userspace interfaces for a connector. Only call this for
> - * connectors which have been registered explicitly by calling
> - * drm_connector_register().
> + * Unregister userspace interfaces for a connector. Drivers should call this
> + * for dynamic connectors (MST) only, which were registered explicitly by
> + * calling drm_connector_dynamic_register(). All other - static - connectors
> + * will be unregistered automatically by DRM core and drivers shouldn't call
> + * this function for those.

This kind of supports my point about a single
drm_connector_register(). There's no
drm_connector_dynamic_unregister(). After all the
drm_connector_register() calls have been removed, we're left with the
asymmetric pair:

- drm_connector_dynamic_register()
- drm_connector_unregister()

Then again, all of these should become internal and not for drivers?

> + *
> + * Note: Existing uses of this function in drivers for static connectors
> + * should be a nop already and are scheduled to be removed.
>   */
>  void drm_connector_unregister(struct drm_connector *connector)
>  {

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-12-12 10:11 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 23:03 [PATCH v3 0/7] drm/connector: Expose only a properly inited connector Imre Deak
2024-12-11 23:03 ` [PATCH v3 01/11] drm/connector: Add a way to init/add a connector in separate steps Imre Deak
2024-12-12  0:33   ` Lyude Paul
2024-12-12 10:16     ` Simona Vetter
2024-12-12 10:04   ` Jani Nikula
2024-12-12 11:45     ` Imre Deak
2024-12-16 12:22   ` Maxime Ripard
2024-12-11 23:03 ` [PATCH v3 02/11] drm/connector: Add FIXME for GETRESOURCES ioctl wrt. uninited connectors Imre Deak
2024-12-12 10:06   ` Jani Nikula
2024-12-13 12:02     ` Imre Deak
2024-12-11 23:03 ` [PATCH v3 03/11] drm/connector: Add deprication notes for drm_connector_register/unregister Imre Deak
2024-12-12 10:10   ` Jani Nikula [this message]
2024-12-12 12:02     ` Imre Deak
2024-12-16 14:37       ` Simona Vetter
2024-12-11 23:03 ` [PATCH v3 04/11] drm/dp_mst: Register connectors via drm_connector_dynamic_register() Imre Deak
2024-12-12 10:12   ` Jani Nikula
2024-12-13 12:06     ` Imre Deak
2024-12-16 11:03       ` Jani Nikula
2024-12-16 12:14         ` Imre Deak
2024-12-16 12:23   ` Imre Deak
2024-12-17  8:02     ` Lin, Wayne
2024-12-11 23:03 ` [PATCH v3 05/11] drm/i915/dp_mst: Expose a connector to kernel users after it's properly initialized Imre Deak
2024-12-12 10:13   ` Jani Nikula
2024-12-11 23:03 ` [PATCH v3 06/11] drm/amd/dp_mst: " Imre Deak
2024-12-12 10:14   ` Jani Nikula
2024-12-16 12:45   ` Imre Deak
2024-12-16 18:26     ` Alex Deucher
2024-12-11 23:03 ` [PATCH v3 07/11] drm/nouveau/dp_mst: " Imre Deak
2024-12-12 10:14   ` Jani Nikula
2024-12-11 23:03 ` [PATCH v3 08/11] drm/connector: Warn if a connector is registered/added incorrectly Imre Deak
2024-12-12 10:15   ` Jani Nikula
2024-12-11 23:03 ` [PATCH v3 09/11] drm/tests: Add tests for drm_connector_dynamic_init()/register() Imre Deak
2024-12-16 12:22   ` Maxime Ripard
2024-12-11 23:03 ` [PATCH v3 10/11] drm/i915/dp_mst: Fix error handling while adding a connector Imre Deak
2024-12-12 10:16   ` Jani Nikula
2024-12-11 23:03 ` [PATCH v3 11/11] drm/i915/dp_mst: Use intel_connector vs. drm_connector pointer in intel_dp_mst.c Imre Deak
2024-12-12 10:25   ` Jani Nikula
2024-12-12 12:23     ` Imre Deak
2024-12-11 23:33 ` ✗ Fi.CI.CHECKPATCH: warning for drm/connector: Expose only a properly inited connector Patchwork
2024-12-11 23:33 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-12-11 23:57 ` ✓ i915.CI.BAT: success " Patchwork
2024-12-12  7:33 ` ✗ i915.CI.Full: failure " Patchwork
2024-12-13 15:41   ` Imre Deak
2024-12-16 12:22 ` [PATCH v3 0/7] " Imre Deak
2024-12-16 12:39   ` Maxime Ripard
2024-12-17 14:47 ` Imre Deak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ed2dxlcd.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).