Skip to content

Commit 1eb810d

Browse files
Huihong LuoAndroid (Google) Code Review
authored andcommitted
Merge "Remove HDCP vsync hack" into main
2 parents 520d8fc + 73416e1 commit 1eb810d

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
@@ -1339,8 +1339,6 @@ class SurfaceFlinger : public BnSurfaceComposer,
13391339
HWComposer::HotplugEvent event;
13401340
};
13411341

1342-
bool mIsHdcpViaNegVsync = false;
1343-
13441342
std::mutex mHotplugMutex;
13451343
std::vector<HotplugEvent> mPendingHotplugEvents GUARDED_BY(mHotplugMutex);
13461344

0 commit comments

Comments
 (0)