[9/9] drm/amd/display: Implement MST Aux device registration
diff mbox series

Message ID 20190723232808.28128-10-sunpeng.li@amd.com
State New
Headers show
Series
  • MST AUX Devices (v3)
Related show

Commit Message

Leo 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: Jerry Zuo <Jerry.Zuo@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
---
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 24 ++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

Comments

Kazlauskas, Nicholas July 24, 2019, 8:05 p.m. UTC | #1
On 7/23/19 7:28 PM, 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: Jerry Zuo <Jerry.Zuo@amd.com>
> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Signed-off-by: Leo Li <sunpeng.li@amd.com>

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

BTW: I already reviewed patch 5, feel free to add my R-B.

Nicholas Kazlauskas

> ---
>   .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 24 ++++++++++++++++++-
>   1 file changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 53d2cfe62e13..16218a202b59 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -156,6 +156,26 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector)
>   	kfree(amdgpu_dm_connector);
>   }
>   
> +static int
> +amdgpu_dm_mst_connector_late_register(struct drm_connector *connector)
> +{
> +	struct amdgpu_dm_connector *amdgpu_dm_connector =
> +		to_amdgpu_dm_connector(connector);
> +	struct drm_dp_mst_port *port = amdgpu_dm_connector->port;
> +
> +	return drm_dp_mst_connector_late_register(connector, port);
> +}
> +
> +static void
> +amdgpu_dm_mst_connector_early_unregister(struct drm_connector *connector)
> +{
> +	struct amdgpu_dm_connector *amdgpu_dm_connector =
> +		to_amdgpu_dm_connector(connector);
> +	struct drm_dp_mst_port *port = amdgpu_dm_connector->port;
> +
> +	drm_dp_mst_connector_early_unregister(connector, port);
> +}
> +
>   static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {
>   	.detect = dm_dp_mst_detect,
>   	.fill_modes = drm_helper_probe_single_connector_modes,
> @@ -164,7 +184,9 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {
>   	.atomic_duplicate_state = amdgpu_dm_connector_atomic_duplicate_state,
>   	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
>   	.atomic_set_property = amdgpu_dm_connector_atomic_set_property,
> -	.atomic_get_property = amdgpu_dm_connector_atomic_get_property
> +	.atomic_get_property = amdgpu_dm_connector_atomic_get_property,
> +	.late_register = amdgpu_dm_mst_connector_late_register,
> +	.early_unregister = amdgpu_dm_mst_connector_early_unregister,
>   };
>   
>   static int dm_dp_mst_get_modes(struct drm_connector *connector)
>
Leo July 24, 2019, 8:06 p.m. UTC | #2
On 2019-07-24 4:05 p.m., Kazlauskas, Nicholas wrote:
> On 7/23/19 7:28 PM, 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: Jerry Zuo <Jerry.Zuo@amd.com>
>> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>> Cc: Harry Wentland <harry.wentland@amd.com>
>> Signed-off-by: Leo Li <sunpeng.li@amd.com>
> 
> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> 
> BTW: I already reviewed patch 5, feel free to add my R-B.
> 
> Nicholas Kazlauskas

Sorry, will do.

Thanks!
Leo

> 
>> ---
>>   .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 24 ++++++++++++++++++-
>>   1 file changed, 23 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> index 53d2cfe62e13..16218a202b59 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> @@ -156,6 +156,26 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector)
>>   	kfree(amdgpu_dm_connector);
>>   }
>>   
>> +static int
>> +amdgpu_dm_mst_connector_late_register(struct drm_connector *connector)
>> +{
>> +	struct amdgpu_dm_connector *amdgpu_dm_connector =
>> +		to_amdgpu_dm_connector(connector);
>> +	struct drm_dp_mst_port *port = amdgpu_dm_connector->port;
>> +
>> +	return drm_dp_mst_connector_late_register(connector, port);
>> +}
>> +
>> +static void
>> +amdgpu_dm_mst_connector_early_unregister(struct drm_connector *connector)
>> +{
>> +	struct amdgpu_dm_connector *amdgpu_dm_connector =
>> +		to_amdgpu_dm_connector(connector);
>> +	struct drm_dp_mst_port *port = amdgpu_dm_connector->port;
>> +
>> +	drm_dp_mst_connector_early_unregister(connector, port);
>> +}
>> +
>>   static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {
>>   	.detect = dm_dp_mst_detect,
>>   	.fill_modes = drm_helper_probe_single_connector_modes,
>> @@ -164,7 +184,9 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {
>>   	.atomic_duplicate_state = amdgpu_dm_connector_atomic_duplicate_state,
>>   	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
>>   	.atomic_set_property = amdgpu_dm_connector_atomic_set_property,
>> -	.atomic_get_property = amdgpu_dm_connector_atomic_get_property
>> +	.atomic_get_property = amdgpu_dm_connector_atomic_get_property,
>> +	.late_register = amdgpu_dm_mst_connector_late_register,
>> +	.early_unregister = amdgpu_dm_mst_connector_early_unregister,
>>   };
>>   
>>   static int dm_dp_mst_get_modes(struct drm_connector *connector)
>>
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 53d2cfe62e13..16218a202b59 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -156,6 +156,26 @@  dm_dp_mst_connector_destroy(struct drm_connector *connector)
 	kfree(amdgpu_dm_connector);
 }
 
+static int
+amdgpu_dm_mst_connector_late_register(struct drm_connector *connector)
+{
+	struct amdgpu_dm_connector *amdgpu_dm_connector =
+		to_amdgpu_dm_connector(connector);
+	struct drm_dp_mst_port *port = amdgpu_dm_connector->port;
+
+	return drm_dp_mst_connector_late_register(connector, port);
+}
+
+static void
+amdgpu_dm_mst_connector_early_unregister(struct drm_connector *connector)
+{
+	struct amdgpu_dm_connector *amdgpu_dm_connector =
+		to_amdgpu_dm_connector(connector);
+	struct drm_dp_mst_port *port = amdgpu_dm_connector->port;
+
+	drm_dp_mst_connector_early_unregister(connector, port);
+}
+
 static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {
 	.detect = dm_dp_mst_detect,
 	.fill_modes = drm_helper_probe_single_connector_modes,
@@ -164,7 +184,9 @@  static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {
 	.atomic_duplicate_state = amdgpu_dm_connector_atomic_duplicate_state,
 	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 	.atomic_set_property = amdgpu_dm_connector_atomic_set_property,
-	.atomic_get_property = amdgpu_dm_connector_atomic_get_property
+	.atomic_get_property = amdgpu_dm_connector_atomic_get_property,
+	.late_register = amdgpu_dm_mst_connector_late_register,
+	.early_unregister = amdgpu_dm_mst_connector_early_unregister,
 };
 
 static int dm_dp_mst_get_modes(struct drm_connector *connector)