mirror of
https://github.com/torvalds/linux.git
synced 2026-05-02 05:22:49 -04:00
drm/amd/display: Adjust secure_display_context data structure
[Why] Variables relates to secure display are spreading out within struct amdgpu_display_manager. [How] Encapsulate relevant variables into struct secure_display_context and adjust relevant affected codes. Reviewed-by: HaoPing Liu <haoping.liu@amd.com> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -2152,8 +2152,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
|
||||
}
|
||||
|
||||
#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)
|
||||
amdgpu_dm_crtc_secure_display_create_contexts(adev);
|
||||
if (!adev->dm.secure_display_ctx.crtc_ctx)
|
||||
DRM_ERROR("amdgpu: failed to initialize secure display contexts.\n");
|
||||
#endif
|
||||
|
||||
@@ -2197,15 +2197,15 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
|
||||
amdgpu_dm_destroy_drm_device(&adev->dm);
|
||||
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
if (adev->dm.secure_display_ctxs) {
|
||||
if (adev->dm.secure_display_ctx.crtc_ctx) {
|
||||
for (i = 0; i < adev->mode_info.num_crtc; i++) {
|
||||
if (adev->dm.secure_display_ctxs[i].crtc) {
|
||||
flush_work(&adev->dm.secure_display_ctxs[i].notify_ta_work);
|
||||
flush_work(&adev->dm.secure_display_ctxs[i].forward_roi_work);
|
||||
if (adev->dm.secure_display_ctx.crtc_ctx[i].crtc) {
|
||||
flush_work(&adev->dm.secure_display_ctx.crtc_ctx[i].notify_ta_work);
|
||||
flush_work(&adev->dm.secure_display_ctx.crtc_ctx[i].forward_roi_work);
|
||||
}
|
||||
}
|
||||
kfree(adev->dm.secure_display_ctxs);
|
||||
adev->dm.secure_display_ctxs = NULL;
|
||||
kfree(adev->dm.secure_display_ctx.crtc_ctx);
|
||||
adev->dm.secure_display_ctx.crtc_ctx = NULL;
|
||||
}
|
||||
#endif
|
||||
if (adev->dm.hdcp_workqueue) {
|
||||
|
||||
Reference in New Issue
Block a user