@@ -621,7 +621,6 @@ int32_t PortManager::InitDrmObjects()
621621
622622 if (CONTENT_PROTECTION == prop_name ||
623623 CP_CONTENT_TYPE == prop_name ||
624- CP_SRM == prop_name ||
625624 CP_DOWNSTREAM_INFO == prop_name)
626625 {
627626 DrmObject *drmObject = GetDrmObjectByDrmId (res->connectors [i]);
@@ -807,7 +806,7 @@ int32_t PortManager::EnablePort(
807806 {
808807 drmObject->CpTypeAtomicEnd ();
809808 HDCP_ASSERTMESSAGE (
810- " Failed to enable port with id %d, check proerty failed" ,
809+ " Failed to enable port with id %d, check property failed" ,
811810 portId);
812811 return EBUSY;
813812 }
@@ -997,22 +996,44 @@ int32_t PortManager::SendSRMData(const uint8_t *data, const uint32_t size)
997996{
998997 HDCP_FUNCTION_ENTER;
999998
1000- for (auto drmObject : m_DrmObjects)
999+ CHECK_PARAM_NULL (data, EINVAL);
1000+
1001+ // Write srm data into fw file
1002+ int32_t ret = -1 ;
1003+ size_t total = 0 ;
1004+ int fd = open (DISPLAY_SRM_STORAGE_FILE, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);
1005+ if (0 > fd)
10011006 {
1002- int32_t ret = SetPortProperty (drmObject->GetDrmId (),
1003- drmObject->GetPropertyId (CP_SRM),
1004- size,
1005- data,
1006- 1 );
1007- if (SUCCESS != ret)
1007+ HDCP_ASSERTMESSAGE (" Could not open file Err: %s!" , strerror (errno));
1008+ return -errno;
1009+ }
1010+ do
1011+ {
1012+ ret = write (fd, data + total, size - total);
1013+ if (0 >= ret)
10081014 {
1009- HDCP_WARNMESSAGE (" Faild to send SRM Data" );
1010- return ret;
1015+ if (EINTR == errno || EAGAIN == errno)
1016+ continue ;
1017+ else
1018+ break ;
10111019 }
1020+ total += ret;
1021+ } while (total != size);
1022+
1023+ if (total != static_cast <size_t >(size))
1024+ {
1025+ HDCP_ASSERTMESSAGE (" Failed to write srm to file. Err: %s" , strerror (errno));
1026+ ret = -EIO;
1027+ }
1028+ else
1029+ {
1030+ ret = SUCCESS;
10121031 }
10131032
1014- HDCP_FUNCTION_EXIT (SUCCESS);
1015- return SUCCESS;
1033+ close (fd);
1034+
1035+ HDCP_FUNCTION_EXIT (ret);
1036+ return ret;
10161037}
10171038
10181039void PortManager::RemoveAppFromPorts (const uint32_t appId)
0 commit comments