sdm: Add support for minimum encryption level settings for HDCP.
- Add min_enc_level parameter in minHdcpEncryptionLevelChanged API. Change-Id: I4c6ddfb7c0178ce547ce7aa357f86f0320d35208
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
3976dafca7
commit
a5b764fa44
@@ -320,11 +320,12 @@ int getPanelBrightness() {
|
||||
// ----------------------------------------------------------------------------
|
||||
// Functions for linking dynamically to libqdutils
|
||||
// ----------------------------------------------------------------------------
|
||||
extern "C" int minHdcpEncryptionLevelChanged(int dpy) {
|
||||
extern "C" int minHdcpEncryptionLevelChanged(int dpy, int min_enc_level) {
|
||||
status_t err = (status_t) FAILED_TRANSACTION;
|
||||
sp<IQService> binder = getBinder();
|
||||
Parcel inParcel, outParcel;
|
||||
inParcel.writeInt32(dpy);
|
||||
inParcel.writeInt32(min_enc_level);
|
||||
|
||||
if(binder != NULL) {
|
||||
err = binder->dispatch(IQService::MIN_HDCP_ENCRYPTION_LEVEL_CHANGED,
|
||||
|
||||
@@ -377,9 +377,11 @@ class DisplayInterface {
|
||||
|
||||
/*! @brief Method to notify display about change in min HDCP encryption level.
|
||||
|
||||
@param[in] min_enc_level minimum encryption level value.
|
||||
|
||||
@return \link DisplayError \endlink
|
||||
*/
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange() = 0;
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level) = 0;
|
||||
|
||||
/*! @brief Method to route display API requests to color service.
|
||||
|
||||
|
||||
@@ -454,7 +454,7 @@ DisplayError DisplayBase::SetPanelBrightness(int level) {
|
||||
return kErrorNotSupported;
|
||||
}
|
||||
|
||||
DisplayError DisplayBase::OnMinHdcpEncryptionLevelChange() {
|
||||
DisplayError DisplayBase::OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level) {
|
||||
return kErrorNotSupported;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class DisplayBase : public DisplayInterface {
|
||||
virtual DisplayError IsScalingValid(const LayerRect &crop, const LayerRect &dst, bool rotate90);
|
||||
virtual bool IsUnderscanSupported();
|
||||
virtual DisplayError SetPanelBrightness(int level);
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange();
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level);
|
||||
virtual DisplayError ColorSVCRequestRoute(const PPDisplayAPIPayload &in_payload,
|
||||
PPDisplayAPIPayload *out_payload,
|
||||
PPPendingParams *pending_action);
|
||||
|
||||
@@ -176,9 +176,9 @@ DisplayError DisplayHDMI::SetPanelBrightness(int level) {
|
||||
return DisplayBase::SetPanelBrightness(level);
|
||||
}
|
||||
|
||||
DisplayError DisplayHDMI::OnMinHdcpEncryptionLevelChange() {
|
||||
DisplayError DisplayHDMI::OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level) {
|
||||
SCOPE_LOCK(locker_);
|
||||
return hw_intf_->OnMinHdcpEncryptionLevelChange();
|
||||
return hw_intf_->OnMinHdcpEncryptionLevelChange(min_enc_level);
|
||||
}
|
||||
|
||||
int DisplayHDMI::GetBestConfig() {
|
||||
|
||||
@@ -59,7 +59,7 @@ class DisplayHDMI : public DisplayBase, DumpImpl {
|
||||
virtual DisplayError SetRefreshRate(uint32_t refresh_rate);
|
||||
virtual bool IsUnderscanSupported();
|
||||
virtual DisplayError SetPanelBrightness(int level);
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange();
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level);
|
||||
virtual void AppendDump(char *buffer, uint32_t length);
|
||||
virtual DisplayError SetCursorPosition(int x, int y);
|
||||
|
||||
|
||||
@@ -995,7 +995,7 @@ DisplayError HWDevice::GetMaxCEAFormat(uint32_t *max_cea_format) {
|
||||
return kErrorNotSupported;
|
||||
}
|
||||
|
||||
DisplayError HWDevice::OnMinHdcpEncryptionLevelChange() {
|
||||
DisplayError HWDevice::OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level) {
|
||||
return kErrorNotSupported;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class HWDevice : public HWInterface {
|
||||
virtual DisplayError GetVideoFormat(uint32_t config_index, uint32_t *video_format);
|
||||
virtual DisplayError GetMaxCEAFormat(uint32_t *max_cea_format);
|
||||
virtual DisplayError SetCursorPosition(HWLayers *hw_layers, int x, int y);
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange();
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level);
|
||||
virtual DisplayError GetPanelBrightness(int *level);
|
||||
|
||||
// For HWDevice derivatives
|
||||
|
||||
@@ -346,7 +346,7 @@ DisplayError HWHDMI::GetMaxCEAFormat(uint32_t *max_cea_format) {
|
||||
return kErrorNone;
|
||||
}
|
||||
|
||||
DisplayError HWHDMI::OnMinHdcpEncryptionLevelChange() {
|
||||
DisplayError HWHDMI::OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level) {
|
||||
DisplayError error = kErrorNone;
|
||||
int fd = -1;
|
||||
char data[kMaxStringLength] = {'\0'};
|
||||
@@ -359,8 +359,7 @@ DisplayError HWHDMI::OnMinHdcpEncryptionLevelChange() {
|
||||
return kErrorHardware;
|
||||
}
|
||||
|
||||
// write any value (1 here) on this fd to trigger level change.
|
||||
snprintf(data, sizeof(data), "%d", 1);
|
||||
snprintf(data, sizeof(data), "%d", min_enc_level);
|
||||
|
||||
ssize_t err = Sys::pwrite_(fd, data, strlen(data), 0);
|
||||
if (err <= 0) {
|
||||
|
||||
@@ -48,7 +48,7 @@ class HWHDMI : public HWDevice {
|
||||
virtual DisplayError GetHWScanInfo(HWScanInfo *scan_info);
|
||||
virtual DisplayError GetVideoFormat(uint32_t config_index, uint32_t *video_format);
|
||||
virtual DisplayError GetMaxCEAFormat(uint32_t *max_cea_format);
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange();
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level);
|
||||
virtual DisplayError SetDisplayAttributes(uint32_t index);
|
||||
virtual DisplayError GetConfigIndex(uint32_t mode, uint32_t *index);
|
||||
virtual DisplayError Validate(HWLayers *hw_layers);
|
||||
|
||||
@@ -88,7 +88,7 @@ class HWInterface {
|
||||
virtual DisplayError GetVideoFormat(uint32_t config_index, uint32_t *video_format) = 0;
|
||||
virtual DisplayError GetMaxCEAFormat(uint32_t *max_cea_format) = 0;
|
||||
virtual DisplayError SetCursorPosition(HWLayers *hw_layers, int x, int y) = 0;
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange() = 0;
|
||||
virtual DisplayError OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level) = 0;
|
||||
virtual DisplayError GetPanelBrightness(int *level) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -1209,8 +1209,8 @@ int HWCDisplay::SetCursorPosition(int x, int y) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int HWCDisplay::OnMinHdcpEncryptionLevelChange() {
|
||||
DisplayError error = display_intf_->OnMinHdcpEncryptionLevelChange();
|
||||
int HWCDisplay::OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level) {
|
||||
DisplayError error = display_intf_->OnMinHdcpEncryptionLevelChange(min_enc_level);
|
||||
if (error != kErrorNone) {
|
||||
DLOGE("Failed. Error = %d", error);
|
||||
return -1;
|
||||
|
||||
@@ -59,7 +59,7 @@ class HWCDisplay : public DisplayEventHandler {
|
||||
virtual void GetFrameBufferResolution(uint32_t *x_pixels, uint32_t *y_pixels);
|
||||
virtual void GetPanelResolution(uint32_t *x_pixels, uint32_t *y_pixels);
|
||||
virtual int SetDisplayStatus(uint32_t display_status);
|
||||
virtual int OnMinHdcpEncryptionLevelChange();
|
||||
virtual int OnMinHdcpEncryptionLevelChange(uint32_t min_enc_level);
|
||||
virtual int Perform(uint32_t operation, ...);
|
||||
virtual int SetCursorPosition(int x, int y);
|
||||
virtual void SetSecureDisplay(bool secure_display_active);
|
||||
|
||||
@@ -1058,6 +1058,7 @@ android::status_t HWCSession::OnMinHdcpEncryptionLevelChange(const android::Parc
|
||||
android::Parcel *output_parcel) {
|
||||
int ret = -EINVAL;
|
||||
uint32_t display_id = UINT32(input_parcel->readInt32());
|
||||
uint32_t min_enc_level = UINT32(input_parcel->readInt32());
|
||||
|
||||
DLOGI("Display %d", display_id);
|
||||
|
||||
@@ -1068,7 +1069,7 @@ android::status_t HWCSession::OnMinHdcpEncryptionLevelChange(const android::Parc
|
||||
} else if (!hwc_display_[display_id]) {
|
||||
DLOGW("Display is not connected");
|
||||
} else {
|
||||
ret = hwc_display_[display_id]->OnMinHdcpEncryptionLevelChange();
|
||||
ret = hwc_display_[display_id]->OnMinHdcpEncryptionLevelChange(min_enc_level);
|
||||
}
|
||||
|
||||
output_parcel->writeInt32(ret);
|
||||
|
||||
Reference in New Issue
Block a user