Skip to content

Commit 73416e1

Browse files
author
Huihong Luo
committed
Remove HDCP vsync hack
New HDCP hal api will be used. Bug: 402406598 Flag: EXEMPT bugfix Test: manual Change-Id: I361c032d2b373a122e24194883c9fee9c6a262b2
1 parent 9473d9d commit 73416e1

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,6 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
538538
}
539539

540540
mIgnoreHdrCameraLayers = ignore_hdr_camera_layers(false);
541-
542-
// These are set by the HWC implementation to indicate that they will use the workarounds.
543-
mIsHdcpViaNegVsync = base::GetBoolProperty("debug.sf.hwc_hdcp_via_neg_vsync"s, false);
544541
}
545542

546543
LatchUnsignaledConfig SurfaceFlinger::getLatchUnsignaledConfig() {
@@ -2301,19 +2298,6 @@ void SurfaceFlinger::scheduleSample() {
23012298

23022299
void SurfaceFlinger::onComposerHalVsync(hal::HWDisplayId hwcDisplayId, int64_t timestamp,
23032300
std::optional<hal::VsyncPeriodNanos> vsyncPeriod) {
2304-
if (timestamp < 0 && vsyncPeriod.has_value()) {
2305-
if (mIsHdcpViaNegVsync && vsyncPeriod.value() == ~1) {
2306-
const int32_t value = static_cast<int32_t>(-timestamp);
2307-
// one byte is good enough to encode android.hardware.drm.HdcpLevel
2308-
const int32_t maxLevel = (value >> 8) & 0xFF;
2309-
const int32_t connectedLevel = value & 0xFF;
2310-
ALOGD("%s: HDCP levels changed (connected=%d, max=%d) for hwcDisplayId %" PRIu64,
2311-
__func__, connectedLevel, maxLevel, hwcDisplayId);
2312-
updateHdcpLevels(hwcDisplayId, connectedLevel, maxLevel);
2313-
return;
2314-
}
2315-
}
2316-
23172301
SFTRACE_NAME(vsyncPeriod
23182302
? ftl::Concat(__func__, ' ', hwcDisplayId, ' ', *vsyncPeriod, "ns").c_str()
23192303
: ftl::Concat(__func__, ' ', hwcDisplayId).c_str());
@@ -3809,12 +3793,9 @@ std::optional<DisplayModeId> SurfaceFlinger::processHotplugConnect(PhysicalDispl
38093793
.hwcDisplayId = hwcDisplayId,
38103794
.port = info.port,
38113795
.activeMode = std::move(activeMode)};
3812-
if (mIsHdcpViaNegVsync) {
3813-
state.isSecure = connectionType == ui::DisplayConnectionType::Internal;
3814-
} else {
3815-
// TODO(b/349703362): Remove this when HDCP aidl API becomes ready
3816-
state.isSecure = true; // All physical displays are currently considered secure.
3817-
}
3796+
3797+
// TODO: b/349703362 - Remove this when HDCP aidl APIs are enforced
3798+
state.isSecure = true; // All physical displays are currently considered secure.
38183799
state.isProtected = true;
38193800
state.displayName = std::move(info.name);
38203801
state.maxLayerPictureProfiles = getHwComposer().getMaxLayerPictureProfiles(displayId);

services/surfaceflinger/SurfaceFlinger.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,8 +1345,6 @@ class SurfaceFlinger : public BnSurfaceComposer,
13451345
HWComposer::HotplugEvent event;
13461346
};
13471347

1348-
bool mIsHdcpViaNegVsync = false;
1349-
13501348
std::mutex mHotplugMutex;
13511349
std::vector<HotplugEvent> mPendingHotplugEvents GUARDED_BY(mHotplugMutex);
13521350

0 commit comments

Comments
 (0)