native_display->SetHDCPSRM(SRM, SRMLength);
}
+uint32_t GpuDevice::GetDisplayIDFromConnectorID(const uint32_t connector_id) {
+ size_t size = total_displays_.size();
+ for (size_t i = 0; i < size; i++) {
+ if (total_displays_.at(i)->ContainConnector(connector_id))
+ return i;
+ }
+ return -1;
+}
+
void GpuDevice::HandleRoutine() {
bool update_ignored = false;
logical_display_manager_->SetHDCPSRM(SRM, SRMLength);
}
+bool LogicalDisplay::ContainConnector(const uint32_t connector_id) {
+ return logical_display_manager_->ContainConnector(connector_id);
+}
+
bool LogicalDisplay::Present(std::vector<HwcLayer *> &source_layers,
int32_t *retire_fence,
PixelUploaderCallback *call_back,
HWCContentType content_type) override;
void SetHDCPSRM(const int8_t *SRM, uint32_t SRMLength) override;
+ bool ContainConnector(const uint32_t connector_id) override;
+
private:
LogicalDisplayManager *logical_display_manager_;
NativeDisplay *physical_display_;
}
void LogicalDisplayManager::SetHDCPSRM(const int8_t* SRM, uint32_t SRMLength) {
- uint32_t size = displays_.size();
- for (uint32_t i = 0; i < size; i++) {
- displays_.at(i)->SetHDCPSRM(SRM, SRMLength);
- }
+ physical_display_->SetHDCPSRM(SRM, SRMLength);
+}
+
+bool LogicalDisplayManager::ContainConnector(const uint32_t connector_id) {
+ return physical_display_->ContainConnector(connector_id);
}
} // namespace hwcomposer
void SetHDCPSRM(const int8_t* SRM, uint32_t SRMLength);
+ bool ContainConnector(const uint32_t connector_id);
+
private:
NativeDisplay* physical_display_;
std::vector<std::unique_ptr<LogicalDisplay>> displays_;
}
}
+bool MosaicDisplay::ContainConnector(const uint32_t connector_id) {
+ uint32_t size = physical_displays_.size();
+ for (uint32_t i = 0; i < size; i++) {
+ if (physical_displays_.at(i)->ContainConnector(connector_id))
+ return true;
+ }
+ return false;
+}
+
} // namespace hwcomposer
HWCContentType content_type) override;
void SetHDCPSRM(const int8_t *SRM, uint32_t SRMLength) override;
+ bool ContainConnector(const uint32_t connector_id) override;
+
private:
std::vector<NativeDisplay *> physical_displays_;
std::vector<NativeDisplay *> connected_displays_;
return OK;
}
+uint32_t HwcService::Controls::GetDisplayIDFromConnectorID(
+ uint32_t connector_id) {
+ return mHwc.GetDisplayIDFromConnectorID(connector_id);
+}
+
status_t HwcService::Controls::VideoEnableEncryptedSession(
uint32_t sessionID, uint32_t instanceID) {
mHwc.SetPAVPSessionStatus(true, sessionID, instanceID);
status_t SetHDCPSRMForDisplay(uint32_t display, const int8_t* SRM,
uint32_t SRMLength);
-
+ uint32_t GetDisplayIDFromConnectorID(uint32_t connector_id);
status_t VideoEnableEncryptedSession(uint32_t sessionID,
uint32_t instanceID);
status_t VideoDisableAllEncryptedSessions(uint32_t sessionID);
device_.SetHDCPSRMForAllDisplays(SRM, SRMLength);
}
+uint32_t IAHWC2::GetDisplayIDFromConnectorID(const uint32_t connector_id) {
+ return device_.GetDisplayIDFromConnectorID(connector_id);
+}
+
void IAHWC2::SetHDCPSRMForDisplay(uint32_t display, const int8_t *SRM,
uint32_t SRMLength) {
if (SRM == NULL) {
void SetHDCPSRMForDisplay(uint32_t display, const int8_t *SRM,
uint32_t SRMLength);
+ uint32_t GetDisplayIDFromConnectorID(const uint32_t connector_id);
public:
class Hwc2Layer {
return pContext->mControls->DisableHDCPSessionForDisplay(display);
}
+uint32_t HwcService_GetDisplayIDFromConnectorID(HWCSHANDLE hwcs,
+ uint32_t connector_id) {
+ HwcsContext* pContext = static_cast<HwcsContext*>(hwcs);
+ if (!pContext) {
+ return android::BAD_VALUE;
+ }
+
+ return pContext->mControls->GetDisplayIDFromConnectorID(connector_id);
+}
+
status_t HwcService_Video_DisableHDCPSession_AllDisplays(HWCSHANDLE hwcs) {
HwcsContext* pContext = static_cast<HwcsContext*>(hwcs);
if (!pContext) {
const int8_t *SRM,
uint32_t SRMLengh);
+uint32_t HwcService_GetDisplayIDFromConnectorID(HWCSHANDLE hwcs,
+ uint32_t connector_id);
+
// The control enables a the protected video subsystem to control when to
// replace any
// encrypted content with a default bitmap (usually black).
TRANSACT_VIDEO_DISABLE_HDCP_SESSION_FOR_ALL_DISPLAYS,
TRANSACT_VIDEO_SET_HDCP_SRM_FOR_ALL_DISPLAYS,
TRANSACT_VIDEO_SET_HDCP_SRM_FOR_DISPLAY,
+ TRANSACT_GET_DISPLAYID_FROM_CONNECTORID,
TRANSACT_VIDEO_ENABLE_ENCRYPTED_SESSION,
TRANSACT_VIDEO_DISABLE_ENCRYPTED_SESSION,
TRANSACT_VIDEO_DISABLE_ALL_ENCRYPTED_SESSIONS,
}
status_t EnableHDCPSessionForDisplay(uint32_t display,
- EHwcsContentType content_type) {
+ EHwcsContentType content_type) override {
Parcel data;
Parcel reply;
data.writeInterfaceToken(IControls::getInterfaceDescriptor());
return reply.readInt32();
}
- status_t EnableHDCPSessionForAllDisplays(EHwcsContentType content_type) {
+ status_t EnableHDCPSessionForAllDisplays(
+ EHwcsContentType content_type) override {
Parcel data;
Parcel reply;
data.writeInterfaceToken(IControls::getInterfaceDescriptor());
return reply.readInt32();
}
- status_t DisableHDCPSessionForDisplay(uint32_t display) {
+ status_t DisableHDCPSessionForDisplay(uint32_t display) override {
Parcel data;
Parcel reply;
data.writeInterfaceToken(IControls::getInterfaceDescriptor());
return reply.readInt32();
}
- status_t DisableHDCPSessionForAllDisplays() {
+ status_t DisableHDCPSessionForAllDisplays() override {
Parcel data;
Parcel reply;
data.writeInterfaceToken(IControls::getInterfaceDescriptor());
return reply.readInt32();
}
- status_t SetHDCPSRMForAllDisplays(const int8_t *SRM, uint32_t SRMLength) {
+ status_t SetHDCPSRMForAllDisplays(const int8_t *SRM,
+ uint32_t SRMLength) override {
Parcel data;
Parcel reply;
data.writeInterfaceToken(IControls::getInterfaceDescriptor());
}
status_t SetHDCPSRMForDisplay(uint32_t display, const int8_t *SRM,
- uint32_t SRMLength) {
+ uint32_t SRMLength) override {
Parcel data;
Parcel reply;
data.writeInterfaceToken(IControls::getInterfaceDescriptor());
return reply.readInt32();
}
+ uint32_t GetDisplayIDFromConnectorID(uint32_t connector_id) override {
+ Parcel data;
+ Parcel reply;
+ data.writeInterfaceToken(IControls::getInterfaceDescriptor());
+ data.writeInt32(connector_id);
+
+ status_t ret = remote()->transact(TRANSACT_GET_DISPLAYID_FROM_CONNECTORID,
+ data, &reply);
+ if (ret != NO_ERROR) {
+ ALOGW("%s() transact failed: %d", __FUNCTION__, ret);
+ }
+ return (uint32_t)(reply.readInt32());
+ }
+
status_t VideoEnableEncryptedSession(uint32_t sessionID,
uint32_t instanceID) override {
Parcel data;
reply->writeInt32(ret);
return NO_ERROR;
}
-
+ case BpControls::TRANSACT_GET_DISPLAYID_FROM_CONNECTORID: {
+ CHECK_INTERFACE(IControls, data, reply);
+ uint32_t connector_id = data.readInt32();
+ uint32_t display_id = this->GetDisplayIDFromConnectorID(connector_id);
+ reply->writeInt32(display_id);
+ return NO_ERROR;
+ }
case BpControls::TRANSACT_VIDEO_ENABLE_ENCRYPTED_SESSION: {
CHECK_INTERFACE(IControls, data, reply);
uint32_t sessionID = data.readInt32();
virtual status_t SetHDCPSRMForDisplay(uint32_t display, const int8_t *SRM,
uint32_t SRMLength) = 0;
+ virtual uint32_t GetDisplayIDFromConnectorID(uint32_t connector_id) = 0;
virtual status_t VideoEnableEncryptedSession(uint32_t sessionID,
uint32_t instanceID) = 0;
virtual status_t VideoDisableAllEncryptedSessions(uint32_t sessionID) = 0;
void SetHDCPSRMForAllDisplays(const int8_t* SRM, uint32_t SRMLength);
void SetHDCPSRMForDisplay(uint32_t display, const int8_t* SRM,
uint32_t SRMLength);
+ uint32_t GetDisplayIDFromConnectorID(const uint32_t connector_id);
private:
enum InitializationType {
return NULL;
}
+ // return true if connector_id is one of the connector_ids of the physical
+ // connections
+ virtual bool ContainConnector(const uint32_t connector_id) {
+ return false;
+ }
+
protected:
friend class PhysicalDisplay;
friend class GpuDevice;
drmModeDestroyPropertyBlob(gpu_fd_, srm_id);
}
+bool DrmDisplay::ContainConnector(const uint32_t connector_id) {
+ return (connector_ == connector_id);
+}
+
bool DrmDisplay::Commit(
const DisplayPlaneStateList &composition_planes,
const DisplayPlaneStateList &previous_composition_planes,
HWCContentType content_type) override;
void SetHDCPSRM(const int8_t *SRM, uint32_t SRMLength) override;
+ bool ContainConnector(const uint32_t connector_id) override;
+
bool InitializeDisplay() override;
void PowerOn() override;
void UpdateDisplayConfig() override;