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

drm/amd: consolidate TA shared memory structures

Signed-off-by: Candice Li <candice.li@amd.com>
Reviewed-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Candice Li and committed by
Alex Deucher
ce97f37b f2bd514d

+171 -199
+109 -109
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
··· 909 909 */ 910 910 ret = amdgpu_bo_create_kernel(psp->adev, PSP_XGMI_SHARED_MEM_SIZE, 911 911 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM, 912 - &psp->xgmi_context.xgmi_shared_bo, 913 - &psp->xgmi_context.xgmi_shared_mc_addr, 914 - &psp->xgmi_context.xgmi_shared_buf); 912 + &psp->xgmi_context.context.mem_context.shared_bo, 913 + &psp->xgmi_context.context.mem_context.shared_mc_addr, 914 + &psp->xgmi_context.context.mem_context.shared_buf); 915 915 916 916 return ret; 917 917 } ··· 958 958 psp_prep_ta_load_cmd_buf(cmd, 959 959 psp->fw_pri_mc_addr, 960 960 psp->xgmi.size_bytes, 961 - psp->xgmi_context.xgmi_shared_mc_addr, 961 + psp->xgmi_context.context.mem_context.shared_mc_addr, 962 962 PSP_XGMI_SHARED_MEM_SIZE); 963 963 964 964 ret = psp_cmd_submit_buf(psp, NULL, cmd, 965 965 psp->fence_buf_mc_addr); 966 966 967 967 if (!ret) { 968 - psp->xgmi_context.initialized = 1; 969 - psp->xgmi_context.session_id = cmd->resp.session_id; 968 + psp->xgmi_context.context.initialized = true; 969 + psp->xgmi_context.context.session_id = cmd->resp.session_id; 970 970 } 971 971 972 972 release_psp_cmd_buf(psp); ··· 991 991 992 992 cmd = acquire_psp_cmd_buf(psp); 993 993 994 - psp_prep_ta_unload_cmd_buf(cmd, psp->xgmi_context.session_id); 994 + psp_prep_ta_unload_cmd_buf(cmd, psp->xgmi_context.context.session_id); 995 995 996 996 ret = psp_cmd_submit_buf(psp, NULL, cmd, 997 997 psp->fence_buf_mc_addr); ··· 1003 1003 1004 1004 int psp_xgmi_invoke(struct psp_context *psp, uint32_t ta_cmd_id) 1005 1005 { 1006 - return psp_ta_invoke(psp, ta_cmd_id, psp->xgmi_context.session_id); 1006 + return psp_ta_invoke(psp, ta_cmd_id, psp->xgmi_context.context.session_id); 1007 1007 } 1008 1008 1009 1009 int psp_xgmi_terminate(struct psp_context *psp) 1010 1010 { 1011 1011 int ret; 1012 1012 1013 - if (!psp->xgmi_context.initialized) 1013 + if (!psp->xgmi_context.context.initialized) 1014 1014 return 0; 1015 1015 1016 1016 ret = psp_xgmi_unload(psp); 1017 1017 if (ret) 1018 1018 return ret; 1019 1019 1020 - psp->xgmi_context.initialized = 0; 1020 + psp->xgmi_context.context.initialized = false; 1021 1021 1022 1022 /* free xgmi shared memory */ 1023 - amdgpu_bo_free_kernel(&psp->xgmi_context.xgmi_shared_bo, 1024 - &psp->xgmi_context.xgmi_shared_mc_addr, 1025 - &psp->xgmi_context.xgmi_shared_buf); 1023 + amdgpu_bo_free_kernel(&psp->xgmi_context.context.mem_context.shared_bo, 1024 + &psp->xgmi_context.context.mem_context.shared_mc_addr, 1025 + &psp->xgmi_context.context.mem_context.shared_buf); 1026 1026 1027 1027 return 0; 1028 1028 } ··· 1040 1040 if (!load_ta) 1041 1041 goto invoke; 1042 1042 1043 - if (!psp->xgmi_context.initialized) { 1043 + if (!psp->xgmi_context.context.initialized) { 1044 1044 ret = psp_xgmi_init_shared_buf(psp); 1045 1045 if (ret) 1046 1046 return ret; ··· 1053 1053 1054 1054 invoke: 1055 1055 /* Initialize XGMI session */ 1056 - xgmi_cmd = (struct ta_xgmi_shared_memory *)(psp->xgmi_context.xgmi_shared_buf); 1056 + xgmi_cmd = (struct ta_xgmi_shared_memory *)(psp->xgmi_context.context.mem_context.shared_buf); 1057 1057 memset(xgmi_cmd, 0, sizeof(struct ta_xgmi_shared_memory)); 1058 1058 xgmi_cmd->flag_extend_link_record = set_extended_data; 1059 1059 xgmi_cmd->cmd_id = TA_COMMAND_XGMI__INITIALIZE; ··· 1068 1068 struct ta_xgmi_shared_memory *xgmi_cmd; 1069 1069 int ret; 1070 1070 1071 - xgmi_cmd = (struct ta_xgmi_shared_memory *)psp->xgmi_context.xgmi_shared_buf; 1071 + xgmi_cmd = (struct ta_xgmi_shared_memory *)psp->xgmi_context.context.mem_context.shared_buf; 1072 1072 memset(xgmi_cmd, 0, sizeof(struct ta_xgmi_shared_memory)); 1073 1073 1074 1074 xgmi_cmd->cmd_id = TA_COMMAND_XGMI__GET_HIVE_ID; ··· 1088 1088 struct ta_xgmi_shared_memory *xgmi_cmd; 1089 1089 int ret; 1090 1090 1091 - xgmi_cmd = (struct ta_xgmi_shared_memory *)psp->xgmi_context.xgmi_shared_buf; 1091 + xgmi_cmd = (struct ta_xgmi_shared_memory *)psp->xgmi_context.context.mem_context.shared_buf; 1092 1092 memset(xgmi_cmd, 0, sizeof(struct ta_xgmi_shared_memory)); 1093 1093 1094 1094 xgmi_cmd->cmd_id = TA_COMMAND_XGMI__GET_NODE_ID; ··· 1169 1169 if (!topology || topology->num_nodes > TA_XGMI__MAX_CONNECTED_NODES) 1170 1170 return -EINVAL; 1171 1171 1172 - xgmi_cmd = (struct ta_xgmi_shared_memory *)psp->xgmi_context.xgmi_shared_buf; 1172 + xgmi_cmd = (struct ta_xgmi_shared_memory *)psp->xgmi_context.context.mem_context.shared_buf; 1173 1173 memset(xgmi_cmd, 0, sizeof(struct ta_xgmi_shared_memory)); 1174 1174 xgmi_cmd->flag_extend_link_record = get_extended_data; 1175 1175 ··· 1249 1249 if (!topology || topology->num_nodes > TA_XGMI__MAX_CONNECTED_NODES) 1250 1250 return -EINVAL; 1251 1251 1252 - xgmi_cmd = (struct ta_xgmi_shared_memory *)psp->xgmi_context.xgmi_shared_buf; 1252 + xgmi_cmd = (struct ta_xgmi_shared_memory *)psp->xgmi_context.context.mem_context.shared_buf; 1253 1253 memset(xgmi_cmd, 0, sizeof(struct ta_xgmi_shared_memory)); 1254 1254 1255 1255 topology_info_input = &xgmi_cmd->xgmi_in_message.get_topology_info; ··· 1278 1278 */ 1279 1279 ret = amdgpu_bo_create_kernel(psp->adev, PSP_RAS_SHARED_MEM_SIZE, 1280 1280 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM, 1281 - &psp->ras_context.ras_shared_bo, 1282 - &psp->ras_context.ras_shared_mc_addr, 1283 - &psp->ras_context.ras_shared_buf); 1281 + &psp->ras_context.context.mem_context.shared_bo, 1282 + &psp->ras_context.context.mem_context.shared_mc_addr, 1283 + &psp->ras_context.context.mem_context.shared_buf); 1284 1284 1285 1285 return ret; 1286 1286 } ··· 1299 1299 1300 1300 psp_copy_fw(psp, psp->ras.start_addr, psp->ras.size_bytes); 1301 1301 1302 - ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.ras_shared_buf; 1302 + ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.context.mem_context.shared_buf; 1303 1303 1304 1304 if (psp->adev->gmc.xgmi.connected_to_cpu) 1305 1305 ras_cmd->ras_in_message.init_flags.poison_mode_en = 1; ··· 1311 1311 psp_prep_ta_load_cmd_buf(cmd, 1312 1312 psp->fw_pri_mc_addr, 1313 1313 psp->ras.size_bytes, 1314 - psp->ras_context.ras_shared_mc_addr, 1314 + psp->ras_context.context.mem_context.shared_mc_addr, 1315 1315 PSP_RAS_SHARED_MEM_SIZE); 1316 1316 1317 1317 ret = psp_cmd_submit_buf(psp, NULL, cmd, 1318 1318 psp->fence_buf_mc_addr); 1319 1319 1320 1320 if (!ret) { 1321 - psp->ras_context.session_id = cmd->resp.session_id; 1321 + psp->ras_context.context.session_id = cmd->resp.session_id; 1322 1322 1323 1323 if (!ras_cmd->ras_status) 1324 - psp->ras_context.ras_initialized = true; 1324 + psp->ras_context.context.initialized = true; 1325 1325 else 1326 1326 dev_warn(psp->adev->dev, "RAS Init Status: 0x%X\n", ras_cmd->ras_status); 1327 1327 } ··· 1347 1347 1348 1348 cmd = acquire_psp_cmd_buf(psp); 1349 1349 1350 - psp_prep_ta_unload_cmd_buf(cmd, psp->ras_context.session_id); 1350 + psp_prep_ta_unload_cmd_buf(cmd, psp->ras_context.context.session_id); 1351 1351 1352 1352 ret = psp_cmd_submit_buf(psp, NULL, cmd, 1353 1353 psp->fence_buf_mc_addr); ··· 1362 1362 struct ta_ras_shared_memory *ras_cmd; 1363 1363 int ret; 1364 1364 1365 - ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.ras_shared_buf; 1365 + ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.context.mem_context.shared_buf; 1366 1366 1367 1367 /* 1368 1368 * TODO: bypass the loading in sriov for now ··· 1370 1370 if (amdgpu_sriov_vf(psp->adev)) 1371 1371 return 0; 1372 1372 1373 - ret = psp_ta_invoke(psp, ta_cmd_id, psp->ras_context.session_id); 1373 + ret = psp_ta_invoke(psp, ta_cmd_id, psp->ras_context.context.session_id); 1374 1374 1375 1375 if (amdgpu_ras_intr_triggered()) 1376 1376 return ret; ··· 1426 1426 struct ta_ras_shared_memory *ras_cmd; 1427 1427 int ret; 1428 1428 1429 - if (!psp->ras_context.ras_initialized) 1429 + if (!psp->ras_context.context.initialized) 1430 1430 return -EINVAL; 1431 1431 1432 - ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.ras_shared_buf; 1432 + ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.context.mem_context.shared_buf; 1433 1433 memset(ras_cmd, 0, sizeof(struct ta_ras_shared_memory)); 1434 1434 1435 1435 if (enable) ··· 1456 1456 if (amdgpu_sriov_vf(psp->adev)) 1457 1457 return 0; 1458 1458 1459 - if (!psp->ras_context.ras_initialized) 1459 + if (!psp->ras_context.context.initialized) 1460 1460 return 0; 1461 1461 1462 1462 ret = psp_ras_unload(psp); 1463 1463 if (ret) 1464 1464 return ret; 1465 1465 1466 - psp->ras_context.ras_initialized = false; 1466 + psp->ras_context.context.initialized = false; 1467 1467 1468 1468 /* free ras shared memory */ 1469 - amdgpu_bo_free_kernel(&psp->ras_context.ras_shared_bo, 1470 - &psp->ras_context.ras_shared_mc_addr, 1471 - &psp->ras_context.ras_shared_buf); 1469 + amdgpu_bo_free_kernel(&psp->ras_context.context.mem_context.shared_bo, 1470 + &psp->ras_context.context.mem_context.shared_mc_addr, 1471 + &psp->ras_context.context.mem_context.shared_buf); 1472 1472 1473 1473 return 0; 1474 1474 } ··· 1532 1532 } 1533 1533 } 1534 1534 1535 - if (!psp->ras_context.ras_initialized) { 1535 + if (!psp->ras_context.context.initialized) { 1536 1536 ret = psp_ras_init_shared_buf(psp); 1537 1537 if (ret) 1538 1538 return ret; ··· 1551 1551 struct ta_ras_shared_memory *ras_cmd; 1552 1552 int ret; 1553 1553 1554 - if (!psp->ras_context.ras_initialized) 1554 + if (!psp->ras_context.context.initialized) 1555 1555 return -EINVAL; 1556 1556 1557 - ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.ras_shared_buf; 1557 + ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.context.mem_context.shared_buf; 1558 1558 memset(ras_cmd, 0, sizeof(struct ta_ras_shared_memory)); 1559 1559 1560 1560 ras_cmd->cmd_id = TA_RAS_COMMAND__TRIGGER_ERROR; ··· 1584 1584 */ 1585 1585 ret = amdgpu_bo_create_kernel(psp->adev, PSP_HDCP_SHARED_MEM_SIZE, 1586 1586 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM, 1587 - &psp->hdcp_context.hdcp_shared_bo, 1588 - &psp->hdcp_context.hdcp_shared_mc_addr, 1589 - &psp->hdcp_context.hdcp_shared_buf); 1587 + &psp->hdcp_context.context.mem_context.shared_bo, 1588 + &psp->hdcp_context.context.mem_context.shared_mc_addr, 1589 + &psp->hdcp_context.context.mem_context.shared_buf); 1590 1590 1591 1591 return ret; 1592 1592 } ··· 1610 1610 psp_prep_ta_load_cmd_buf(cmd, 1611 1611 psp->fw_pri_mc_addr, 1612 1612 psp->hdcp.size_bytes, 1613 - psp->hdcp_context.hdcp_shared_mc_addr, 1613 + psp->hdcp_context.context.mem_context.shared_mc_addr, 1614 1614 PSP_HDCP_SHARED_MEM_SIZE); 1615 1615 1616 1616 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 1617 1617 1618 1618 if (!ret) { 1619 - psp->hdcp_context.hdcp_initialized = true; 1620 - psp->hdcp_context.session_id = cmd->resp.session_id; 1619 + psp->hdcp_context.context.initialized = true; 1620 + psp->hdcp_context.context.session_id = cmd->resp.session_id; 1621 1621 mutex_init(&psp->hdcp_context.mutex); 1622 1622 } 1623 1623 ··· 1641 1641 return 0; 1642 1642 } 1643 1643 1644 - if (!psp->hdcp_context.hdcp_initialized) { 1644 + if (!psp->hdcp_context.context.initialized) { 1645 1645 ret = psp_hdcp_init_shared_buf(psp); 1646 1646 if (ret) 1647 1647 return ret; ··· 1667 1667 1668 1668 cmd = acquire_psp_cmd_buf(psp); 1669 1669 1670 - psp_prep_ta_unload_cmd_buf(cmd, psp->hdcp_context.session_id); 1670 + psp_prep_ta_unload_cmd_buf(cmd, psp->hdcp_context.context.session_id); 1671 1671 1672 1672 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 1673 1673 ··· 1684 1684 if (amdgpu_sriov_vf(psp->adev)) 1685 1685 return 0; 1686 1686 1687 - return psp_ta_invoke(psp, ta_cmd_id, psp->hdcp_context.session_id); 1687 + return psp_ta_invoke(psp, ta_cmd_id, psp->hdcp_context.context.session_id); 1688 1688 } 1689 1689 1690 1690 static int psp_hdcp_terminate(struct psp_context *psp) ··· 1697 1697 if (amdgpu_sriov_vf(psp->adev)) 1698 1698 return 0; 1699 1699 1700 - if (!psp->hdcp_context.hdcp_initialized) { 1701 - if (psp->hdcp_context.hdcp_shared_buf) 1700 + if (!psp->hdcp_context.context.initialized) { 1701 + if (psp->hdcp_context.context.mem_context.shared_buf) 1702 1702 goto out; 1703 1703 else 1704 1704 return 0; ··· 1708 1708 if (ret) 1709 1709 return ret; 1710 1710 1711 - psp->hdcp_context.hdcp_initialized = false; 1711 + psp->hdcp_context.context.initialized = false; 1712 1712 1713 1713 out: 1714 1714 /* free hdcp shared memory */ 1715 - amdgpu_bo_free_kernel(&psp->hdcp_context.hdcp_shared_bo, 1716 - &psp->hdcp_context.hdcp_shared_mc_addr, 1717 - &psp->hdcp_context.hdcp_shared_buf); 1715 + amdgpu_bo_free_kernel(&psp->hdcp_context.context.mem_context.shared_bo, 1716 + &psp->hdcp_context.context.mem_context.shared_mc_addr, 1717 + &psp->hdcp_context.context.mem_context.shared_buf); 1718 1718 1719 1719 return 0; 1720 1720 } ··· 1731 1731 */ 1732 1732 ret = amdgpu_bo_create_kernel(psp->adev, PSP_DTM_SHARED_MEM_SIZE, 1733 1733 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM, 1734 - &psp->dtm_context.dtm_shared_bo, 1735 - &psp->dtm_context.dtm_shared_mc_addr, 1736 - &psp->dtm_context.dtm_shared_buf); 1734 + &psp->dtm_context.context.mem_context.shared_bo, 1735 + &psp->dtm_context.context.mem_context.shared_mc_addr, 1736 + &psp->dtm_context.context.mem_context.shared_buf); 1737 1737 1738 1738 return ret; 1739 1739 } ··· 1756 1756 psp_prep_ta_load_cmd_buf(cmd, 1757 1757 psp->fw_pri_mc_addr, 1758 1758 psp->dtm.size_bytes, 1759 - psp->dtm_context.dtm_shared_mc_addr, 1759 + psp->dtm_context.context.mem_context.shared_mc_addr, 1760 1760 PSP_DTM_SHARED_MEM_SIZE); 1761 1761 1762 1762 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 1763 1763 1764 1764 if (!ret) { 1765 - psp->dtm_context.dtm_initialized = true; 1766 - psp->dtm_context.session_id = cmd->resp.session_id; 1765 + psp->dtm_context.context.initialized = true; 1766 + psp->dtm_context.context.session_id = cmd->resp.session_id; 1767 1767 mutex_init(&psp->dtm_context.mutex); 1768 1768 } 1769 1769 ··· 1788 1788 return 0; 1789 1789 } 1790 1790 1791 - if (!psp->dtm_context.dtm_initialized) { 1791 + if (!psp->dtm_context.context.initialized) { 1792 1792 ret = psp_dtm_init_shared_buf(psp); 1793 1793 if (ret) 1794 1794 return ret; ··· 1814 1814 1815 1815 cmd = acquire_psp_cmd_buf(psp); 1816 1816 1817 - psp_prep_ta_unload_cmd_buf(cmd, psp->dtm_context.session_id); 1817 + psp_prep_ta_unload_cmd_buf(cmd, psp->dtm_context.context.session_id); 1818 1818 1819 1819 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 1820 1820 ··· 1831 1831 if (amdgpu_sriov_vf(psp->adev)) 1832 1832 return 0; 1833 1833 1834 - return psp_ta_invoke(psp, ta_cmd_id, psp->dtm_context.session_id); 1834 + return psp_ta_invoke(psp, ta_cmd_id, psp->dtm_context.context.session_id); 1835 1835 } 1836 1836 1837 1837 static int psp_dtm_terminate(struct psp_context *psp) ··· 1844 1844 if (amdgpu_sriov_vf(psp->adev)) 1845 1845 return 0; 1846 1846 1847 - if (!psp->dtm_context.dtm_initialized) { 1848 - if (psp->dtm_context.dtm_shared_buf) 1847 + if (!psp->dtm_context.context.initialized) { 1848 + if (psp->dtm_context.context.mem_context.shared_buf) 1849 1849 goto out; 1850 1850 else 1851 1851 return 0; ··· 1855 1855 if (ret) 1856 1856 return ret; 1857 1857 1858 - psp->dtm_context.dtm_initialized = false; 1858 + psp->dtm_context.context.initialized = false; 1859 1859 1860 1860 out: 1861 1861 /* free hdcp shared memory */ 1862 - amdgpu_bo_free_kernel(&psp->dtm_context.dtm_shared_bo, 1863 - &psp->dtm_context.dtm_shared_mc_addr, 1864 - &psp->dtm_context.dtm_shared_buf); 1862 + amdgpu_bo_free_kernel(&psp->dtm_context.context.mem_context.shared_bo, 1863 + &psp->dtm_context.context.mem_context.shared_mc_addr, 1864 + &psp->dtm_context.context.mem_context.shared_buf); 1865 1865 1866 1866 return 0; 1867 1867 } ··· 1878 1878 */ 1879 1879 ret = amdgpu_bo_create_kernel(psp->adev, PSP_RAP_SHARED_MEM_SIZE, 1880 1880 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM, 1881 - &psp->rap_context.rap_shared_bo, 1882 - &psp->rap_context.rap_shared_mc_addr, 1883 - &psp->rap_context.rap_shared_buf); 1881 + &psp->rap_context.context.mem_context.shared_bo, 1882 + &psp->rap_context.context.mem_context.shared_mc_addr, 1883 + &psp->rap_context.context.mem_context.shared_buf); 1884 1884 1885 1885 return ret; 1886 1886 } ··· 1897 1897 psp_prep_ta_load_cmd_buf(cmd, 1898 1898 psp->fw_pri_mc_addr, 1899 1899 psp->rap.size_bytes, 1900 - psp->rap_context.rap_shared_mc_addr, 1900 + psp->rap_context.context.mem_context.shared_mc_addr, 1901 1901 PSP_RAP_SHARED_MEM_SIZE); 1902 1902 1903 1903 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 1904 1904 1905 1905 if (!ret) { 1906 - psp->rap_context.rap_initialized = true; 1907 - psp->rap_context.session_id = cmd->resp.session_id; 1906 + psp->rap_context.context.initialized = true; 1907 + psp->rap_context.context.session_id = cmd->resp.session_id; 1908 1908 mutex_init(&psp->rap_context.mutex); 1909 1909 } 1910 1910 ··· 1918 1918 int ret; 1919 1919 struct psp_gfx_cmd_resp *cmd = acquire_psp_cmd_buf(psp); 1920 1920 1921 - psp_prep_ta_unload_cmd_buf(cmd, psp->rap_context.session_id); 1921 + psp_prep_ta_unload_cmd_buf(cmd, psp->rap_context.context.session_id); 1922 1922 1923 1923 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 1924 1924 ··· 1944 1944 return 0; 1945 1945 } 1946 1946 1947 - if (!psp->rap_context.rap_initialized) { 1947 + if (!psp->rap_context.context.initialized) { 1948 1948 ret = psp_rap_init_shared_buf(psp); 1949 1949 if (ret) 1950 1950 return ret; ··· 1958 1958 if (ret || status != TA_RAP_STATUS__SUCCESS) { 1959 1959 psp_rap_unload(psp); 1960 1960 1961 - amdgpu_bo_free_kernel(&psp->rap_context.rap_shared_bo, 1962 - &psp->rap_context.rap_shared_mc_addr, 1963 - &psp->rap_context.rap_shared_buf); 1961 + amdgpu_bo_free_kernel(&psp->rap_context.context.mem_context.shared_bo, 1962 + &psp->rap_context.context.mem_context.shared_mc_addr, 1963 + &psp->rap_context.context.mem_context.shared_buf); 1964 1964 1965 - psp->rap_context.rap_initialized = false; 1965 + psp->rap_context.context.initialized = false; 1966 1966 1967 1967 dev_warn(psp->adev->dev, "RAP TA initialize fail (%d) status %d.\n", 1968 1968 ret, status); ··· 1977 1977 { 1978 1978 int ret; 1979 1979 1980 - if (!psp->rap_context.rap_initialized) 1980 + if (!psp->rap_context.context.initialized) 1981 1981 return 0; 1982 1982 1983 1983 ret = psp_rap_unload(psp); 1984 1984 1985 - psp->rap_context.rap_initialized = false; 1985 + psp->rap_context.context.initialized = false; 1986 1986 1987 1987 /* free rap shared memory */ 1988 - amdgpu_bo_free_kernel(&psp->rap_context.rap_shared_bo, 1989 - &psp->rap_context.rap_shared_mc_addr, 1990 - &psp->rap_context.rap_shared_buf); 1988 + amdgpu_bo_free_kernel(&psp->rap_context.context.mem_context.shared_bo, 1989 + &psp->rap_context.context.mem_context.shared_mc_addr, 1990 + &psp->rap_context.context.mem_context.shared_buf); 1991 1991 1992 1992 return ret; 1993 1993 } ··· 1997 1997 struct ta_rap_shared_memory *rap_cmd; 1998 1998 int ret = 0; 1999 1999 2000 - if (!psp->rap_context.rap_initialized) 2000 + if (!psp->rap_context.context.initialized) 2001 2001 return 0; 2002 2002 2003 2003 if (ta_cmd_id != TA_CMD_RAP__INITIALIZE && ··· 2007 2007 mutex_lock(&psp->rap_context.mutex); 2008 2008 2009 2009 rap_cmd = (struct ta_rap_shared_memory *) 2010 - psp->rap_context.rap_shared_buf; 2010 + psp->rap_context.context.mem_context.shared_buf; 2011 2011 memset(rap_cmd, 0, sizeof(struct ta_rap_shared_memory)); 2012 2012 2013 2013 rap_cmd->cmd_id = ta_cmd_id; 2014 2014 rap_cmd->validation_method_id = METHOD_A; 2015 2015 2016 - ret = psp_ta_invoke(psp, rap_cmd->cmd_id, psp->rap_context.session_id); 2016 + ret = psp_ta_invoke(psp, rap_cmd->cmd_id, psp->rap_context.context.session_id); 2017 2017 if (ret) 2018 2018 goto out_unlock; 2019 2019 ··· 2038 2038 */ 2039 2039 ret = amdgpu_bo_create_kernel(psp->adev, PSP_SECUREDISPLAY_SHARED_MEM_SIZE, 2040 2040 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM, 2041 - &psp->securedisplay_context.securedisplay_shared_bo, 2042 - &psp->securedisplay_context.securedisplay_shared_mc_addr, 2043 - &psp->securedisplay_context.securedisplay_shared_buf); 2041 + &psp->securedisplay_context.context.mem_context.shared_bo, 2042 + &psp->securedisplay_context.context.mem_context.shared_mc_addr, 2043 + &psp->securedisplay_context.context.mem_context.shared_buf); 2044 2044 2045 2045 return ret; 2046 2046 } ··· 2056 2056 psp_prep_ta_load_cmd_buf(cmd, 2057 2057 psp->fw_pri_mc_addr, 2058 2058 psp->securedisplay.size_bytes, 2059 - psp->securedisplay_context.securedisplay_shared_mc_addr, 2059 + psp->securedisplay_context.context.mem_context.shared_mc_addr, 2060 2060 PSP_SECUREDISPLAY_SHARED_MEM_SIZE); 2061 2061 2062 2062 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 2063 2063 2064 2064 if (!ret) { 2065 - psp->securedisplay_context.securedisplay_initialized = true; 2066 - psp->securedisplay_context.session_id = cmd->resp.session_id; 2065 + psp->securedisplay_context.context.initialized = true; 2066 + psp->securedisplay_context.context.session_id = cmd->resp.session_id; 2067 2067 mutex_init(&psp->securedisplay_context.mutex); 2068 2068 } 2069 2069 ··· 2077 2077 int ret; 2078 2078 struct psp_gfx_cmd_resp *cmd = acquire_psp_cmd_buf(psp); 2079 2079 2080 - psp_prep_ta_unload_cmd_buf(cmd, psp->securedisplay_context.session_id); 2080 + psp_prep_ta_unload_cmd_buf(cmd, psp->securedisplay_context.context.session_id); 2081 2081 2082 2082 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 2083 2083 ··· 2103 2103 return 0; 2104 2104 } 2105 2105 2106 - if (!psp->securedisplay_context.securedisplay_initialized) { 2106 + if (!psp->securedisplay_context.context.initialized) { 2107 2107 ret = psp_securedisplay_init_shared_buf(psp); 2108 2108 if (ret) 2109 2109 return ret; ··· 2120 2120 if (ret) { 2121 2121 psp_securedisplay_unload(psp); 2122 2122 2123 - amdgpu_bo_free_kernel(&psp->securedisplay_context.securedisplay_shared_bo, 2124 - &psp->securedisplay_context.securedisplay_shared_mc_addr, 2125 - &psp->securedisplay_context.securedisplay_shared_buf); 2123 + amdgpu_bo_free_kernel(&psp->securedisplay_context.context.mem_context.shared_bo, 2124 + &psp->securedisplay_context.context.mem_context.shared_mc_addr, 2125 + &psp->securedisplay_context.context.mem_context.shared_buf); 2126 2126 2127 - psp->securedisplay_context.securedisplay_initialized = false; 2127 + psp->securedisplay_context.context.initialized = false; 2128 2128 2129 2129 dev_err(psp->adev->dev, "SECUREDISPLAY TA initialize fail.\n"); 2130 2130 return -EINVAL; ··· 2149 2149 if (amdgpu_sriov_vf(psp->adev)) 2150 2150 return 0; 2151 2151 2152 - if (!psp->securedisplay_context.securedisplay_initialized) 2152 + if (!psp->securedisplay_context.context.initialized) 2153 2153 return 0; 2154 2154 2155 2155 ret = psp_securedisplay_unload(psp); 2156 2156 if (ret) 2157 2157 return ret; 2158 2158 2159 - psp->securedisplay_context.securedisplay_initialized = false; 2159 + psp->securedisplay_context.context.initialized = false; 2160 2160 2161 2161 /* free securedisplay shared memory */ 2162 - amdgpu_bo_free_kernel(&psp->securedisplay_context.securedisplay_shared_bo, 2163 - &psp->securedisplay_context.securedisplay_shared_mc_addr, 2164 - &psp->securedisplay_context.securedisplay_shared_buf); 2162 + amdgpu_bo_free_kernel(&psp->securedisplay_context.context.mem_context.shared_bo, 2163 + &psp->securedisplay_context.context.mem_context.shared_mc_addr, 2164 + &psp->securedisplay_context.context.mem_context.shared_buf); 2165 2165 2166 2166 return ret; 2167 2167 } ··· 2170 2170 { 2171 2171 int ret; 2172 2172 2173 - if (!psp->securedisplay_context.securedisplay_initialized) 2173 + if (!psp->securedisplay_context.context.initialized) 2174 2174 return -EINVAL; 2175 2175 2176 2176 if (ta_cmd_id != TA_SECUREDISPLAY_COMMAND__QUERY_TA && ··· 2179 2179 2180 2180 mutex_lock(&psp->securedisplay_context.mutex); 2181 2181 2182 - ret = psp_ta_invoke(psp, ta_cmd_id, psp->securedisplay_context.session_id); 2182 + ret = psp_ta_invoke(psp, ta_cmd_id, psp->securedisplay_context.context.session_id); 2183 2183 2184 2184 mutex_unlock(&psp->securedisplay_context.mutex); 2185 2185 ··· 2799 2799 struct psp_context *psp = &adev->psp; 2800 2800 2801 2801 if (adev->gmc.xgmi.num_physical_nodes > 1 && 2802 - psp->xgmi_context.initialized == 1) { 2802 + psp->xgmi_context.context.initialized) { 2803 2803 ret = psp_xgmi_terminate(psp); 2804 2804 if (ret) { 2805 2805 DRM_ERROR("Failed to terminate xgmi ta\n");
+24 -52
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
··· 136 136 uint32_t session_id; 137 137 }; 138 138 139 + struct ta_mem_context { 140 + struct amdgpu_bo *shared_bo; 141 + uint64_t shared_mc_addr; 142 + void *shared_buf; 143 + }; 144 + 145 + struct ta_context { 146 + bool initialized; 147 + uint32_t session_id; 148 + struct ta_mem_context mem_context; 149 + }; 150 + 151 + struct ta_cp_context { 152 + struct ta_context context; 153 + struct mutex mutex; 154 + }; 155 + 139 156 struct psp_xgmi_context { 140 - uint8_t initialized; 141 - uint32_t session_id; 142 - struct amdgpu_bo *xgmi_shared_bo; 143 - uint64_t xgmi_shared_mc_addr; 144 - void *xgmi_shared_buf; 157 + struct ta_context context; 145 158 struct psp_xgmi_topology_info top_info; 146 159 bool supports_extended_data; 147 160 }; 148 161 149 162 struct psp_ras_context { 150 - /*ras fw*/ 151 - bool ras_initialized; 152 - uint32_t session_id; 153 - struct amdgpu_bo *ras_shared_bo; 154 - uint64_t ras_shared_mc_addr; 155 - void *ras_shared_buf; 156 - struct amdgpu_ras *ras; 157 - }; 158 - 159 - struct psp_hdcp_context { 160 - bool hdcp_initialized; 161 - uint32_t session_id; 162 - struct amdgpu_bo *hdcp_shared_bo; 163 - uint64_t hdcp_shared_mc_addr; 164 - void *hdcp_shared_buf; 165 - struct mutex mutex; 166 - }; 167 - 168 - struct psp_dtm_context { 169 - bool dtm_initialized; 170 - uint32_t session_id; 171 - struct amdgpu_bo *dtm_shared_bo; 172 - uint64_t dtm_shared_mc_addr; 173 - void *dtm_shared_buf; 174 - struct mutex mutex; 175 - }; 176 - 177 - struct psp_rap_context { 178 - bool rap_initialized; 179 - uint32_t session_id; 180 - struct amdgpu_bo *rap_shared_bo; 181 - uint64_t rap_shared_mc_addr; 182 - void *rap_shared_buf; 183 - struct mutex mutex; 184 - }; 185 - 186 - struct psp_securedisplay_context { 187 - bool securedisplay_initialized; 188 - uint32_t session_id; 189 - struct amdgpu_bo *securedisplay_shared_bo; 190 - uint64_t securedisplay_shared_mc_addr; 191 - void *securedisplay_shared_buf; 192 - struct mutex mutex; 163 + struct ta_context context; 164 + struct amdgpu_ras *ras; 193 165 }; 194 166 195 167 #define MEM_TRAIN_SYSTEM_SIGNATURE 0x54534942 ··· 336 364 struct psp_asd_context asd_context; 337 365 struct psp_xgmi_context xgmi_context; 338 366 struct psp_ras_context ras_context; 339 - struct psp_hdcp_context hdcp_context; 340 - struct psp_dtm_context dtm_context; 341 - struct psp_rap_context rap_context; 342 - struct psp_securedisplay_context securedisplay_context; 367 + struct ta_cp_context hdcp_context; 368 + struct ta_cp_context dtm_context; 369 + struct ta_cp_context rap_context; 370 + struct ta_cp_context securedisplay_context; 343 371 struct mutex mutex; 344 372 struct psp_memory_training_context mem_train_ctx; 345 373
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c
··· 76 76 dev_info(adev->dev, "RAP L0 validate test success.\n"); 77 77 } else { 78 78 rap_shared_mem = (struct ta_rap_shared_memory *) 79 - adev->psp.rap_context.rap_shared_buf; 79 + adev->psp.rap_context.context.mem_context.shared_buf; 80 80 rap_cmd_output = &(rap_shared_mem->rap_out_message.output); 81 81 82 82 dev_info(adev->dev, "RAP test failed, the output is:\n"); ··· 119 119 #if defined(CONFIG_DEBUG_FS) 120 120 struct drm_minor *minor = adev_to_drm(adev)->primary; 121 121 122 - if (!adev->psp.rap_context.rap_initialized) 122 + if (!adev->psp.rap_context.context.initialized) 123 123 return; 124 124 125 125 debugfs_create_file("rap_test", S_IWUSR, minor->debugfs_root,
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c
··· 80 80 void psp_prep_securedisplay_cmd_buf(struct psp_context *psp, struct securedisplay_cmd **cmd, 81 81 enum ta_securedisplay_command command_id) 82 82 { 83 - *cmd = (struct securedisplay_cmd *)psp->securedisplay_context.securedisplay_shared_buf; 83 + *cmd = (struct securedisplay_cmd *)psp->securedisplay_context.context.mem_context.shared_buf; 84 84 memset(*cmd, 0, sizeof(struct securedisplay_cmd)); 85 85 (*cmd)->status = TA_SECUREDISPLAY_STATUS__GENERIC_FAILURE; 86 86 (*cmd)->cmd_id = command_id; ··· 170 170 { 171 171 #if defined(CONFIG_DEBUG_FS) 172 172 173 - if (!adev->psp.securedisplay_context.securedisplay_initialized) 173 + if (!adev->psp.securedisplay_context.context.initialized) 174 174 return; 175 175 176 176 debugfs_create_file("securedisplay_test", S_IWUSR, adev_to_drm(adev)->primary->debugfs_root,
+6 -6
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
··· 79 79 80 80 struct ta_hdcp_shared_memory *hdcp_cmd; 81 81 82 - if (!psp->hdcp_context.hdcp_initialized) { 82 + if (!psp->hdcp_context.context.initialized) { 83 83 DRM_WARN("Failed to get hdcp srm. HDCP TA is not initialized."); 84 84 return NULL; 85 85 } 86 86 87 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 87 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 88 88 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 89 89 90 90 hdcp_cmd->cmd_id = TA_HDCP_COMMAND__HDCP_GET_SRM; ··· 105 105 106 106 struct ta_hdcp_shared_memory *hdcp_cmd; 107 107 108 - if (!psp->hdcp_context.hdcp_initialized) { 108 + if (!psp->hdcp_context.context.initialized) { 109 109 DRM_WARN("Failed to get hdcp srm. HDCP TA is not initialized."); 110 110 return -EINVAL; 111 111 } 112 112 113 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 113 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 114 114 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 115 115 116 116 memcpy(hdcp_cmd->in_msg.hdcp_set_srm.srm_buf, srm, srm_size); ··· 414 414 struct ta_dtm_shared_memory *dtm_cmd; 415 415 bool res = true; 416 416 417 - if (!psp->dtm_context.dtm_initialized) { 417 + if (!psp->dtm_context.context.initialized) { 418 418 DRM_INFO("Failed to enable ASSR, DTM TA is not initialized."); 419 419 return false; 420 420 } 421 421 422 - dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.dtm_shared_buf; 422 + dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.context.mem_context.shared_buf; 423 423 424 424 mutex_lock(&psp->dtm_context.mutex); 425 425 memset(dtm_cmd, 0, sizeof(struct ta_dtm_shared_memory));
+28 -28
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c
··· 54 54 get_active_display_at_index(hdcp, index); 55 55 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 56 56 57 - dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.dtm_shared_buf; 57 + dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.context.mem_context.shared_buf; 58 58 59 59 if (!display || !is_display_active(display)) 60 60 return MOD_HDCP_STATUS_DISPLAY_NOT_FOUND; ··· 90 90 get_active_display_at_index(hdcp, index); 91 91 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 92 92 93 - dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.dtm_shared_buf; 93 + dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.context.mem_context.shared_buf; 94 94 95 95 if (!display || !is_display_active(display)) 96 96 return MOD_HDCP_STATUS_DISPLAY_NOT_FOUND; ··· 128 128 struct mod_hdcp_link *link = &hdcp->connection.link; 129 129 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 130 130 131 - if (!psp->dtm_context.dtm_initialized) { 131 + if (!psp->dtm_context.context.initialized) { 132 132 DRM_INFO("Failed to add display topology, DTM TA is not initialized."); 133 133 display->state = MOD_HDCP_DISPLAY_INACTIVE; 134 134 return MOD_HDCP_STATUS_FAILURE; 135 135 } 136 136 137 - dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.dtm_shared_buf; 137 + dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.context.mem_context.shared_buf; 138 138 139 139 mutex_lock(&psp->dtm_context.mutex); 140 140 memset(dtm_cmd, 0, sizeof(struct ta_dtm_shared_memory)); ··· 175 175 struct mod_hdcp_link *link = &hdcp->connection.link; 176 176 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 177 177 178 - if (!psp->dtm_context.dtm_initialized) { 178 + if (!psp->dtm_context.context.initialized) { 179 179 DRM_INFO("Failed to add display topology, DTM TA is not initialized."); 180 180 display->state = MOD_HDCP_DISPLAY_INACTIVE; 181 181 return MOD_HDCP_STATUS_FAILURE; 182 182 } 183 183 184 - dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.dtm_shared_buf; 184 + dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.context.mem_context.shared_buf; 185 185 186 186 mutex_lock(&psp->dtm_context.mutex); 187 187 memset(dtm_cmd, 0, sizeof(struct ta_dtm_shared_memory)); ··· 253 253 struct ta_hdcp_shared_memory *hdcp_cmd; 254 254 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 255 255 256 - if (!psp->hdcp_context.hdcp_initialized) { 256 + if (!psp->hdcp_context.context.initialized) { 257 257 DRM_ERROR("Failed to create hdcp session. HDCP TA is not initialized."); 258 258 return MOD_HDCP_STATUS_FAILURE; 259 259 } 260 260 261 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 261 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 262 262 263 263 mutex_lock(&psp->hdcp_context.mutex); 264 264 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); ··· 293 293 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 294 294 295 295 mutex_lock(&psp->hdcp_context.mutex); 296 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 296 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 297 297 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 298 298 299 299 hdcp_cmd->in_msg.hdcp1_destroy_session.session_handle = hdcp->auth.id; ··· 325 325 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 326 326 327 327 mutex_lock(&psp->hdcp_context.mutex); 328 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 328 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 329 329 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 330 330 331 331 hdcp_cmd->in_msg.hdcp1_first_part_authentication.session_handle = hdcp->auth.id; ··· 367 367 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 368 368 369 369 mutex_lock(&psp->hdcp_context.mutex); 370 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 370 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 371 371 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 372 372 373 373 hdcp_cmd->in_msg.hdcp1_enable_encryption.session_handle = hdcp->auth.id; ··· 393 393 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 394 394 395 395 mutex_lock(&psp->hdcp_context.mutex); 396 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 396 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 397 397 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 398 398 399 399 hdcp_cmd->in_msg.hdcp1_second_part_authentication.session_handle = hdcp->auth.id; ··· 436 436 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 437 437 438 438 mutex_lock(&psp->hdcp_context.mutex); 439 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 439 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 440 440 441 441 for (i = 0; i < MAX_NUM_OF_DISPLAYS; i++) { 442 442 ··· 471 471 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 472 472 473 473 mutex_lock(&psp->hdcp_context.mutex); 474 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 474 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 475 475 476 476 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 477 477 ··· 498 498 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 499 499 500 500 501 - if (!psp->hdcp_context.hdcp_initialized) { 501 + if (!psp->hdcp_context.context.initialized) { 502 502 DRM_ERROR("Failed to create hdcp session, HDCP TA is not initialized"); 503 503 return MOD_HDCP_STATUS_FAILURE; 504 504 } ··· 508 508 509 509 mutex_lock(&psp->hdcp_context.mutex); 510 510 511 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 511 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 512 512 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 513 513 514 514 hdcp_cmd->in_msg.hdcp2_create_session_v2.display_handle = display->index; ··· 545 545 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 546 546 547 547 mutex_lock(&psp->hdcp_context.mutex); 548 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 548 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 549 549 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 550 550 551 551 hdcp_cmd->in_msg.hdcp2_destroy_session.session_handle = hdcp->auth.id; ··· 579 579 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 580 580 581 581 mutex_lock(&psp->hdcp_context.mutex); 582 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 582 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 583 583 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 584 584 585 585 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 611 611 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 612 612 613 613 mutex_lock(&psp->hdcp_context.mutex); 614 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 614 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 615 615 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 616 616 617 617 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 671 671 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 672 672 673 673 mutex_lock(&psp->hdcp_context.mutex); 674 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 674 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 675 675 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 676 676 677 677 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 717 717 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 718 718 719 719 mutex_lock(&psp->hdcp_context.mutex); 720 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 720 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 721 721 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 722 722 723 723 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 750 750 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 751 751 752 752 mutex_lock(&psp->hdcp_context.mutex); 753 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 753 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 754 754 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 755 755 756 756 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 785 785 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 786 786 787 787 mutex_lock(&psp->hdcp_context.mutex); 788 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 788 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 789 789 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 790 790 791 791 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 833 833 834 834 mutex_lock(&psp->hdcp_context.mutex); 835 835 836 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 836 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 837 837 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 838 838 839 839 hdcp_cmd->in_msg.hdcp2_set_encryption.session_handle = hdcp->auth.id; ··· 862 862 863 863 mutex_lock(&psp->hdcp_context.mutex); 864 864 865 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 865 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 866 866 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 867 867 868 868 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 914 914 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 915 915 916 916 mutex_lock(&psp->hdcp_context.mutex); 917 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 917 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 918 918 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 919 919 920 920 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 958 958 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 959 959 960 960 mutex_lock(&psp->hdcp_context.mutex); 961 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 961 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 962 962 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 963 963 964 964 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2; ··· 994 994 enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS; 995 995 996 996 mutex_lock(&psp->hdcp_context.mutex); 997 - hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf; 997 + hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf; 998 998 memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory)); 999 999 1000 1000 msg_in = &hdcp_cmd->in_msg.hdcp2_prepare_process_authentication_message_v2;