Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: remove unused functions

[why]
It has been decided that opm state query support will be dropped.
Therefore link encryption enabled and save current encryption states
won't be used anymore and there are no foreseeable usages in the future.
We will remove these two interfaces for clean up.

Acked-by: Solomon Chiu <solomon.chiu@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Wenjing Liu and committed by
Alex Deucher
7ac851bc 40ef288f

+22 -53
+1 -3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
··· 655 655 INIT_DELAYED_WORK(&hdcp_work[i].property_validate_dwork, event_property_validate); 656 656 657 657 hdcp_work[i].hdcp.config.psp.handle = &adev->psp; 658 - if (dc->ctx->dce_version == DCN_VERSION_3_1) { 658 + if (dc->ctx->dce_version == DCN_VERSION_3_1) 659 659 hdcp_work[i].hdcp.config.psp.caps.dtm_v3_supported = 1; 660 - hdcp_work[i].hdcp.config.psp.caps.opm_state_query_supported = false; 661 - } 662 660 hdcp_work[i].hdcp.config.ddc.handle = dc_get_link_at_index(dc, i); 663 661 hdcp_work[i].hdcp.config.ddc.funcs.write_i2c = lp_write_i2c; 664 662 hdcp_work[i].hdcp.config.ddc.funcs.read_i2c = lp_read_i2c;
-6
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c
··· 315 315 goto out; 316 316 } 317 317 318 - /* save current encryption states to restore after next authentication */ 319 - mod_hdcp_save_current_encryption_states(hdcp); 320 - 321 318 /* reset existing authentication status */ 322 319 status = reset_authentication(hdcp, output); 323 320 if (status != MOD_HDCP_STATUS_SUCCESS) ··· 360 363 status = MOD_HDCP_STATUS_SUCCESS; 361 364 goto out; 362 365 } 363 - 364 - /* save current encryption states to restore after next authentication */ 365 - mod_hdcp_save_current_encryption_states(hdcp); 366 366 367 367 /* stop current authentication */ 368 368 status = reset_authentication(hdcp, output);
-2
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h
··· 331 331 struct mod_hdcp *hdcp, struct mod_hdcp_display *display); 332 332 enum mod_hdcp_status mod_hdcp_remove_display_from_topology( 333 333 struct mod_hdcp *hdcp, uint8_t index); 334 - bool mod_hdcp_is_link_encryption_enabled(struct mod_hdcp *hdcp); 335 - void mod_hdcp_save_current_encryption_states(struct mod_hdcp *hdcp); 336 334 enum mod_hdcp_status mod_hdcp_hdcp1_create_session(struct mod_hdcp *hdcp); 337 335 enum mod_hdcp_status mod_hdcp_hdcp1_destroy_session(struct mod_hdcp *hdcp); 338 336 enum mod_hdcp_status mod_hdcp_hdcp1_validate_rx(struct mod_hdcp *hdcp);
-6
drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c
··· 266 266 mod_hdcp_execute_and_set(mod_hdcp_hdcp1_link_maintenance, 267 267 &input->link_maintenance, &status, 268 268 hdcp, "link_maintenance"); 269 - 270 - if (status != MOD_HDCP_STATUS_SUCCESS) 271 - mod_hdcp_save_current_encryption_states(hdcp); 272 269 out: 273 270 return status; 274 271 } ··· 444 447 mod_hdcp_execute_and_set(check_no_reauthentication_request_dp, 445 448 &input->reauth_request_check, &status, 446 449 hdcp, "reauth_request_check"); 447 - 448 - if (status != MOD_HDCP_STATUS_SUCCESS) 449 - mod_hdcp_save_current_encryption_states(hdcp); 450 450 out: 451 451 return status; 452 452 }
-3
drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c
··· 571 571 } 572 572 573 573 process_rxstatus(hdcp, event_ctx, input, &status); 574 - 575 - if (status != MOD_HDCP_STATUS_SUCCESS) 576 - mod_hdcp_save_current_encryption_states(hdcp); 577 574 out: 578 575 return status; 579 576 }
+21 -32
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c
··· 45 45 in->process.msg3_desc.msg_size = 0; 46 46 } 47 47 48 - static enum mod_hdcp_status mod_hdcp_remove_display_from_topology_v2( 48 + static enum mod_hdcp_status remove_display_from_topology_v2( 49 49 struct mod_hdcp *hdcp, uint8_t index) 50 50 { 51 51 struct psp_context *psp = hdcp->config.psp.handle; ··· 81 81 return status; 82 82 } 83 83 84 - static enum mod_hdcp_status mod_hdcp_remove_display_from_topology_v3( 84 + static enum mod_hdcp_status remove_display_from_topology_v3( 85 85 struct mod_hdcp *hdcp, uint8_t index) 86 86 { 87 87 struct psp_context *psp = hdcp->config.psp.handle; ··· 107 107 psp_dtm_invoke(psp, dtm_cmd->cmd_id); 108 108 109 109 if (dtm_cmd->dtm_status != TA_DTM_STATUS__SUCCESS) { 110 - status = mod_hdcp_remove_display_from_topology_v2(hdcp, index); 110 + status = remove_display_from_topology_v2(hdcp, index); 111 111 if (status != MOD_HDCP_STATUS_SUCCESS) 112 112 display->state = MOD_HDCP_DISPLAY_INACTIVE; 113 113 } else { ··· 120 120 return status; 121 121 } 122 122 123 - enum mod_hdcp_status mod_hdcp_remove_display_from_topology( 124 - struct mod_hdcp *hdcp, uint8_t index) 125 - { 126 - enum mod_hdcp_status status = MOD_HDCP_STATUS_UPDATE_TOPOLOGY_FAILURE; 127 - 128 - if (hdcp->config.psp.caps.dtm_v3_supported) 129 - status = mod_hdcp_remove_display_from_topology_v3(hdcp, index); 130 - else 131 - status = mod_hdcp_remove_display_from_topology_v2(hdcp, index); 132 - 133 - return status; 134 - } 135 - 136 - static enum mod_hdcp_status mod_hdcp_add_display_to_topology_v2( 123 + static enum mod_hdcp_status add_display_to_topology_v2( 137 124 struct mod_hdcp *hdcp, struct mod_hdcp_display *display) 138 125 { 139 126 struct psp_context *psp = hdcp->config.psp.handle; ··· 167 180 return status; 168 181 } 169 182 170 - static enum mod_hdcp_status mod_hdcp_add_display_to_topology_v3( 183 + static enum mod_hdcp_status add_display_to_topology_v3( 171 184 struct mod_hdcp *hdcp, struct mod_hdcp_display *display) 172 185 { 173 186 struct psp_context *psp = hdcp->config.psp.handle; ··· 207 220 psp_dtm_invoke(psp, dtm_cmd->cmd_id); 208 221 209 222 if (dtm_cmd->dtm_status != TA_DTM_STATUS__SUCCESS) { 210 - status = mod_hdcp_add_display_to_topology_v2(hdcp, display); 223 + status = add_display_to_topology_v2(hdcp, display); 211 224 if (status != MOD_HDCP_STATUS_SUCCESS) 212 225 display->state = MOD_HDCP_DISPLAY_INACTIVE; 213 226 } else { ··· 219 232 return status; 220 233 } 221 234 235 + enum mod_hdcp_status mod_hdcp_remove_display_from_topology( 236 + struct mod_hdcp *hdcp, uint8_t index) 237 + { 238 + enum mod_hdcp_status status = MOD_HDCP_STATUS_UPDATE_TOPOLOGY_FAILURE; 239 + 240 + if (hdcp->config.psp.caps.dtm_v3_supported) 241 + status = remove_display_from_topology_v3(hdcp, index); 242 + else 243 + status = remove_display_from_topology_v2(hdcp, index); 244 + 245 + return status; 246 + } 247 + 222 248 enum mod_hdcp_status mod_hdcp_add_display_to_topology(struct mod_hdcp *hdcp, 223 249 struct mod_hdcp_display *display) 224 250 { 225 251 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 226 252 227 253 if (hdcp->config.psp.caps.dtm_v3_supported) 228 - status = mod_hdcp_add_display_to_topology_v3(hdcp, display); 254 + status = add_display_to_topology_v3(hdcp, display); 229 255 else 230 - status = mod_hdcp_add_display_to_topology_v2(hdcp, display); 256 + status = add_display_to_topology_v2(hdcp, display); 231 257 232 258 return status; 233 259 } ··· 1020 1020 1021 1021 mutex_unlock(&psp->hdcp_context.mutex); 1022 1022 return status; 1023 - } 1024 - 1025 - bool mod_hdcp_is_link_encryption_enabled(struct mod_hdcp *hdcp) 1026 - { 1027 - /* unsupported */ 1028 - return true; 1029 - } 1030 - 1031 - void mod_hdcp_save_current_encryption_states(struct mod_hdcp *hdcp) 1032 - { 1033 - /* unsupported */ 1034 1023 }
-1
drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h
··· 123 123 124 124 struct mod_hdcp_psp_caps { 125 125 uint8_t dtm_v3_supported; 126 - uint8_t opm_state_query_supported; 127 126 }; 128 127 129 128 enum mod_hdcp_display_disable_option {