Commit f477c7b5 authored by Alan Liu's avatar Alan Liu Committed by Alex Deucher

drm/amd/display: Fix in secure display context creation

[Why & How]
We need to store CRTC information in secure_display_ctx, so postpone
the call to amdgpu_dm_crtc_secure_display_create_contexts() until we
initialize all CRTCs.

Cc: stable@vger.kernel.org
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: default avatarWayne Lin <Wayne.Lin@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlan Liu <HaoPing.Liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1068e987
...@@ -1776,12 +1776,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) ...@@ -1776,12 +1776,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
dc_init_callbacks(adev->dm.dc, &init_params); dc_init_callbacks(adev->dm.dc, &init_params);
} }
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
adev->dm.secure_display_ctxs = amdgpu_dm_crtc_secure_display_create_contexts(adev);
if (!adev->dm.secure_display_ctxs) {
DRM_ERROR("amdgpu: failed to initialize secure_display_ctxs.\n");
}
#endif
if (dc_is_dmub_outbox_supported(adev->dm.dc)) { if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
init_completion(&adev->dm.dmub_aux_transfer_done); init_completion(&adev->dm.dmub_aux_transfer_done);
adev->dm.dmub_notify = kzalloc(sizeof(struct dmub_notification), GFP_KERNEL); adev->dm.dmub_notify = kzalloc(sizeof(struct dmub_notification), GFP_KERNEL);
...@@ -1840,6 +1834,11 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) ...@@ -1840,6 +1834,11 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
goto error; goto error;
} }
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
adev->dm.secure_display_ctxs = amdgpu_dm_crtc_secure_display_create_contexts(adev);
if (!adev->dm.secure_display_ctxs)
DRM_ERROR("amdgpu: failed to initialize secure display contexts.\n");
#endif
DRM_DEBUG_DRIVER("KMS initialized.\n"); DRM_DEBUG_DRIVER("KMS initialized.\n");
......
...@@ -100,7 +100,7 @@ struct secure_display_context *amdgpu_dm_crtc_secure_display_create_contexts( ...@@ -100,7 +100,7 @@ struct secure_display_context *amdgpu_dm_crtc_secure_display_create_contexts(
#else #else
#define amdgpu_dm_crc_window_is_activated(x) #define amdgpu_dm_crc_window_is_activated(x)
#define amdgpu_dm_crtc_handle_crc_window_irq(x) #define amdgpu_dm_crtc_handle_crc_window_irq(x)
#define amdgpu_dm_crtc_secure_display_create_contexts() #define amdgpu_dm_crtc_secure_display_create_contexts(x)
#endif #endif
#endif /* AMD_DAL_DEV_AMDGPU_DM_AMDGPU_DM_CRC_H_ */ #endif /* AMD_DAL_DEV_AMDGPU_DM_AMDGPU_DM_CRC_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment