summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
diff options
context:
space:
mode:
authorBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>2019-08-28 15:10:03 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-11-19 10:12:53 -0500
commitb1abe5586ffcb15cc51668bd1a0f97adfbfb0acd (patch)
treeb791db4ca7602fb166f11e9d0f3a5ebc7bddea9f /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
parent53e108aa9916dbbdebd3d94ce63a6928fda09899 (diff)
downloadlwn-b1abe5586ffcb15cc51668bd1a0f97adfbfb0acd.tar.gz
lwn-b1abe5586ffcb15cc51668bd1a0f97adfbfb0acd.zip
drm/amd/display: Refactor HDCP to handle multiple displays per link
[Why] We need to do this to support HDCP over MST Currently we save a display per link, in a MST case we need to save multiple displays per link. [How] We can create an array per link to cache the displays, but it complicates the design. Instead we can use the module to cache the displays. Now we will always add all the displays to the module, but we use the adjustment flag to disable hdcp on all of them before they are added. When we want to enable hdcp we just query the display(cache), remove it then add it back with different adjustments. Its the similar for disable. Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c20
1 files changed, 5 insertions, 15 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 d368bb8d712b..eb7eb128744c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5867,20 +5867,6 @@ static bool is_content_protection_different(struct drm_connector_state *state,
return false;
}
-static void update_content_protection(struct drm_connector_state *state, const struct drm_connector *connector,
- struct hdcp_workqueue *hdcp_w)
-{
- struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
- bool disable_type1 = state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE0 ? true : false;
-
- if (state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED) {
- hdcp_reset_display(hdcp_w, aconnector->dc_link->link_index);
- hdcp_add_display(hdcp_w, aconnector->dc_link->link_index, aconnector, disable_type1);
- } else if (state->content_protection == DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
- hdcp_remove_display(hdcp_w, aconnector->dc_link->link_index, aconnector->base.index);
- }
-
-}
#endif
static void remove_stream(struct amdgpu_device *adev,
struct amdgpu_crtc *acrtc,
@@ -6850,7 +6836,11 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
}
if (is_content_protection_different(new_con_state, old_con_state, connector, adev->dm.hdcp_workqueue))
- update_content_protection(new_con_state, connector, adev->dm.hdcp_workqueue);
+ hdcp_update_display(
+ adev->dm.hdcp_workqueue, aconnector->dc_link->link_index, aconnector,
+ new_con_state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE0 ? true : false,
+ new_con_state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED ? true
+ : false);
}
#endif