Commit cbd8f20b authored by Alan Liu's avatar Alan Liu Committed by Alex Deucher
Browse files

drm/amd/display: Improvements in secure display



[Why]
- Need error message when failing to allocating secure_display_ctx.
- Need to check if secure display context in psp is initialized or not
before using it.

[How]
- Add error message when memory allocation fail.
- Add check before accessing psp secure display context.

Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlan Liu <HaoPing.Liu@amd.com>
Reviewed-by: default avatarWayne Lin <Wayne.Lin@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 878a3c00
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1643,6 +1643,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
#endif
#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)) {
		init_completion(&adev->dm.dmub_aux_transfer_done);
+6 −0
Original line number Diff line number Diff line
@@ -117,6 +117,12 @@ static void amdgpu_dm_crtc_notify_ta_to_read(struct work_struct *work)
	}

	psp = &drm_to_adev(crtc->dev)->psp;

	if (!psp->securedisplay_context.context.initialized) {
		DRM_DEBUG_DRIVER("Secure Display fails to notify PSP TA\n");
		return;
	}

	stream = to_amdgpu_crtc(crtc)->dm_irq_params.stream;
	phy_inst = stream->link->link_enc_hw_inst;