diff mbox series

[3/7] drm/dp-mst: Use connector kdev as aux device parent

Message ID 1558019883-12397-4-git-send-email-sunpeng.li@amd.com (mailing list archive)
State New, archived
Headers show
Series Add DP MST AUX devices | expand

Commit Message

Leo Li May 16, 2019, 3:17 p.m. UTC
From: Leo Li <sunpeng.li@amd.com>

Placing the MST aux device as a child of the connector gives udev the
ability to access the connector device's attributes. This will come in
handy when writing udev rules to create more descriptive symlinks to the
MST aux devices.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Lyude Paul <lyude@redhat.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Lyude Paul May 16, 2019, 8:23 p.m. UTC | #1
On Thu, 2019-05-16 at 11:17 -0400, sunpeng.li@amd.com wrote:
> From: Leo Li <sunpeng.li@amd.com>
> 
> Placing the MST aux device as a child of the connector gives udev the
> ability to access the connector device's attributes. This will come in
> handy when writing udev rules to create more descriptive symlinks to the
> MST aux devices.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Lyude Paul <lyude@redhat.com>
> Signed-off-by: Leo Li <sunpeng.li@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 54da68e..cd2f3c4 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -1269,6 +1269,9 @@ static void drm_dp_add_port(struct drm_dp_mst_branch
> *mstb,
>  		}
>  		(*mstb->mgr->cbs->register_connector)(port->connector);
>  
> +		if (port->connector->registration_state ==
> DRM_CONNECTOR_REGISTERED)
> +			port->aux.dev = port->connector->kdev;
> +

Line wrapping please! Probably worth running checkpatch on all of these
patches as well.

With that nitpick addressed:

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

>  		drm_dp_aux_register_devnode(&port->aux);
>  	}
>
Lyude Paul May 16, 2019, 9:30 p.m. UTC | #2
agh----sorry, but I need to take back my Reviewed-by. Noticed an issue when 
reloading drm and i915. I'll explain it when I respond to patch 2/7 in a
moment

On Thu, 2019-05-16 at 11:17 -0400, sunpeng.li@amd.com wrote:
> From: Leo Li <sunpeng.li@amd.com>
> 
> Placing the MST aux device as a child of the connector gives udev the
> ability to access the connector device's attributes. This will come in
> handy when writing udev rules to create more descriptive symlinks to the
> MST aux devices.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Lyude Paul <lyude@redhat.com>
> Signed-off-by: Leo Li <sunpeng.li@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 54da68e..cd2f3c4 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -1269,6 +1269,9 @@ static void drm_dp_add_port(struct drm_dp_mst_branch
> *mstb,
>  		}
>  		(*mstb->mgr->cbs->register_connector)(port->connector);
>  
> +		if (port->connector->registration_state ==
> DRM_CONNECTOR_REGISTERED)
> +			port->aux.dev = port->connector->kdev;
> +
>  		drm_dp_aux_register_devnode(&port->aux);
>  	}
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 54da68e..cd2f3c4 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1269,6 +1269,9 @@  static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
 		}
 		(*mstb->mgr->cbs->register_connector)(port->connector);
 
+		if (port->connector->registration_state == DRM_CONNECTOR_REGISTERED)
+			port->aux.dev = port->connector->kdev;
+
 		drm_dp_aux_register_devnode(&port->aux);
 	}