[PATCH 27/29] drm/amd/display: Explicitly call ->reset for each object

Andrey Grodzovsky andrey.grodzovsky at amd.com
Fri Oct 27 02:51:29 UTC 2017



On 2017-10-26 02:35 PM, Harry Wentland wrote:
> We need to avoid calling reset after detection.

Could you explain why please ?

> This is much simpler
> if we call ->reset on the connector right after creation but before
> detection. To stay consistent call ->reset on every other object
> as well after creation.
>
> Signed-off-by: Harry Wentland <harry.wentland at amd.com>
> Reviewed-by: Roman Li <Roman.Li at amd.com>
> Acked-by: Harry Wentland <harry.wentland at amd.com>
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 6fc043957bbf..62e8db1f113c 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1436,8 +1436,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
>   		goto fail;
>   	}
>   
> -	drm_mode_config_reset(dm->ddev);

This is a standard helper called by many drivers on driver init , it's 
also called in drm_atomic_helper_resume
which we use on resume from suspend so now it's kind of asymmetrical 
behavior.

Thanks,
Andrey

> -
>   	return 0;
>   fail:
>   	kfree(aencoder);
> @@ -3105,6 +3103,11 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
>   
>   	drm_plane_helper_add(&aplane->base, &dm_plane_helper_funcs);
>   
> +	/* Create (reset) the plane state */
> +	if (aplane->base.funcs->reset)
> +		aplane->base.funcs->reset(&aplane->base);
> +
> +
>   	return res;
>   }
>   
> @@ -3140,6 +3143,10 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
>   
>   	drm_crtc_helper_add(&acrtc->base, &amdgpu_dm_crtc_helper_funcs);
>   
> +	/* Create (reset) the plane state */
> +	if (acrtc->base.funcs->reset)
> +		acrtc->base.funcs->reset(&acrtc->base);
> +
>   	acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size;
>   	acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size;
>   
> @@ -3500,6 +3507,9 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
>   			&aconnector->base,
>   			&amdgpu_dm_connector_helper_funcs);
>   
> +	if (aconnector->base.funcs->reset)
> +		aconnector->base.funcs->reset(&aconnector->base);
> +
>   	amdgpu_dm_connector_init_helper(
>   		dm,
>   		aconnector,



More information about the amd-gfx mailing list