drm/amd/display: Load srm before enabling HDCP
authorBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Wed, 4 Dec 2019 16:54:24 +0000 (11:54 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Feb 2020 20:04:36 +0000 (15:04 -0500)
[Why]
we need to load SRM before we start HDCP. Because for S3 case the sysfs call will be
after we have already enabled HDCP, so we might not be using the latest SRM

[How]
Set srm before starting HDCP.

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c

index 221abee517ee212a43693338673d3efbd9cca273..fe043b18bb21cca532dd01a9de6fb2fcd9ba4e7d 100644 (file)
@@ -136,6 +136,13 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
                hdcp_w->link.adjust.hdcp2.force_type = MOD_HDCP_FORCE_TYPE_0;
 
                if (enable_encryption) {
+                       /* Explicitly set the saved SRM as sysfs call will be after we already enabled hdcp
+                        * (s3 resume case)
+                        */
+                       if (hdcp_work->srm_size > 0)
+                               psp_set_srm(hdcp_work->hdcp.config.psp.handle, hdcp_work->srm, hdcp_work->srm_size,
+                                           &hdcp_work->srm_version);
+
                        display->adjust.disable = 0;
                        if (content_type == DRM_MODE_HDCP_CONTENT_TYPE0)
                                hdcp_w->link.adjust.hdcp2.force_type = MOD_HDCP_FORCE_TYPE_0;