Skip to content

Commit

Permalink
Sync graphics mixin update
Browse files Browse the repository at this point in the history
The code of IA hwcservice will be used for annotation, which is a work
around, because HDCP is not put into use now.
If HDCP needs to be used later, it can be modified.

Tracked-On: OAM-100951
Signed-off-by: wei, wushuangx <[email protected]>
  • Loading branch information
weiwushx authored and sysopenci committed Feb 18, 2022
1 parent 59faeeb commit 61fdc4e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
3 changes: 1 addition & 2 deletions daemon/Android.mk
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ LOCAL_SHARED_LIBRARIES := \
liblog \
libcrypto \
libdrm \
libssl \
libhwcservice
libssl

LOCAL_STATIC_LIBRARIES := \
libhdcpcommon \
Expand Down
2 changes: 2 additions & 0 deletions daemon/portmanager.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,7 @@ int32_t PortManagerHWComposer::SetPortProperty(

android::ProcessState::initWithDriver(BINDER_IPC);

#ifdef USES_IA_HWCOMPOSER
// Connect to HWC service
HWCSHANDLE hwcs = HwcService_Connect();
if (nullptr == hwcs)
Expand Down Expand Up @@ -1482,6 +1483,7 @@ int32_t PortManagerHWComposer::SetPortProperty(
}

HwcService_Disconnect(hwcs);
#endif

if (SUCCESS != ret)
{
Expand Down
7 changes: 7 additions & 0 deletions daemon/portmanager.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@
#include "port.h"

#ifdef ANDROID

#ifdef USES_IA_HWCOMPOSER
#include <hwcserviceapi.h>
#endif

#include <log/log.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>

#ifdef USES_IA_HWCOMPOSER
#include <iservice.h>
#endif

#define BINDER_IPC "/dev/vndbinder"
#endif
Expand Down
17 changes: 16 additions & 1 deletion daemon/portmanager_android.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@
#include "portmanager.h"
#include "portmanager_android.h"

#ifdef USES_IA_HWCOMPOSER
#include <hwcserviceapi.h>
#endif

#include <log/log.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>

#ifdef USES_IA_HWCOMPOSER
#include <iservice.h>
#endif

#include "xf86drm.h"
#include "xf86drmMode.h"
Expand Down Expand Up @@ -122,6 +128,7 @@ int32_t setPortProperty_hwcservice(int32_t m_DrmFd,

android::ProcessState::initWithDriver("/dev/vndbinder");

#ifdef USES_IA_HWCOMPOSER
// Connect to HWC service
HWCSHANDLE hwcs = HwcService_Connect();
if (hwcs == NULL) {
Expand All @@ -138,12 +145,15 @@ int32_t setPortProperty_hwcservice(int32_t m_DrmFd,
hwcs,
drmId);
}
#endif

//Enable CP and SendSRM
if (numRetry > 1)
{
for (uint32_t i = 0; i < numRetry; ++i)
{

#ifdef USES_IA_HWCOMPOSER
if(propId == drmObject->GetPropertyId(CONTENT_PROTECTION))
{
HDCP_ASSERTMESSAGE("Attempting HDCP Enable");
Expand All @@ -166,6 +176,7 @@ int32_t setPortProperty_hwcservice(int32_t m_DrmFd,
hwcs = NULL;
ret = EINVAL;
}
#endif
if(SUCCESS == ret)
{
// Invalid the cpValue/cpType
Expand Down Expand Up @@ -195,13 +206,17 @@ int32_t setPortProperty_hwcservice(int32_t m_DrmFd,

if (SUCCESS != ret)
{
#ifdef USES_IA_HWCOMPOSER
HwcService_Disconnect(hwcs);
HDCP_ASSERTMESSAGE("Failed to Enable HDCP");
#endif
HDCP_ASSERTMESSAGE("Failed to Enable HDCP");
HDCP_FUNCTION_EXIT(EBUSY);
return EBUSY;
}

#ifdef USES_IA_HWCOMPOSER
HwcService_Disconnect(hwcs);
#endif
HDCP_FUNCTION_EXIT(SUCCESS);
return SUCCESS;
} //setPortProperty_hwcservice

0 comments on commit 61fdc4e

Please sign in to comment.