diff mbox series

[7/9] drm/nouveau/kms/nv50: Implement MST Aux device registration

Message ID 20190723232808.28128-8-sunpeng.li@amd.com (mailing list archive)
State New, archived
Headers show
Series MST AUX Devices (v3) | expand

Commit Message

Leo Li July 23, 2019, 11:28 p.m. UTC
From: Leo Li <sunpeng.li@amd.com>

Implement late_register and early_unregister hooks for MST connectors.
Call drm helpers for MST connector registration, which registers the
AUX devices.

Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
---
 drivers/gpu/drm/nouveau/dispnv50/disp.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Lyude Paul July 25, 2019, 8:57 p.m. UTC | #1
Works perfectly here, and no warnings (at least not any that are relevant to
this patch series :) when reloading nouveau.

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

On Tue, 2019-07-23 at 19:28 -0400, sunpeng.li@amd.com wrote:
> From: Leo Li <sunpeng.li@amd.com>
> 
> Implement late_register and early_unregister hooks for MST connectors.
> Call drm helpers for MST connector registration, which registers the
> AUX devices.
> 
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Signed-off-by: Leo Li <sunpeng.li@amd.com>
> ---
>  drivers/gpu/drm/nouveau/dispnv50/disp.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 8497768f1b41..0d6e9350ba44 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -1024,6 +1024,24 @@ nv50_mstc_destroy(struct drm_connector *connector)
>  	kfree(mstc);
>  }
>  
> +static int
> +nv50_mstc_late_register(struct drm_connector *connector)
> +{
> +	struct nv50_mstc *mstc = nv50_mstc(connector);
> +	struct drm_dp_mst_port *port = mstc->port;
> +
> +	return drm_dp_mst_connector_late_register(connector, port);
> +}
> +
> +static void
> +nv50_mstc_early_unregister(struct drm_connector *connector)
> +{
> +	struct nv50_mstc *mstc = nv50_mstc(connector);
> +	struct drm_dp_mst_port *port = mstc->port;
> +
> +	drm_dp_mst_connector_early_unregister(connector, port);
> +}
> +
>  static const struct drm_connector_funcs
>  nv50_mstc = {
>  	.reset = nouveau_conn_reset,
> @@ -1034,6 +1052,8 @@ nv50_mstc = {
>  	.atomic_destroy_state = nouveau_conn_atomic_destroy_state,
>  	.atomic_set_property = nouveau_conn_atomic_set_property,
>  	.atomic_get_property = nouveau_conn_atomic_get_property,
> +	.late_register = nv50_mstc_late_register,
> +	.early_unregister = nv50_mstc_early_unregister,
>  };
>  
>  static int
diff mbox series

Patch

diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 8497768f1b41..0d6e9350ba44 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -1024,6 +1024,24 @@  nv50_mstc_destroy(struct drm_connector *connector)
 	kfree(mstc);
 }
 
+static int
+nv50_mstc_late_register(struct drm_connector *connector)
+{
+	struct nv50_mstc *mstc = nv50_mstc(connector);
+	struct drm_dp_mst_port *port = mstc->port;
+
+	return drm_dp_mst_connector_late_register(connector, port);
+}
+
+static void
+nv50_mstc_early_unregister(struct drm_connector *connector)
+{
+	struct nv50_mstc *mstc = nv50_mstc(connector);
+	struct drm_dp_mst_port *port = mstc->port;
+
+	drm_dp_mst_connector_early_unregister(connector, port);
+}
+
 static const struct drm_connector_funcs
 nv50_mstc = {
 	.reset = nouveau_conn_reset,
@@ -1034,6 +1052,8 @@  nv50_mstc = {
 	.atomic_destroy_state = nouveau_conn_atomic_destroy_state,
 	.atomic_set_property = nouveau_conn_atomic_set_property,
 	.atomic_get_property = nouveau_conn_atomic_get_property,
+	.late_register = nv50_mstc_late_register,
+	.early_unregister = nv50_mstc_early_unregister,
 };
 
 static int