From 07dcd4977f47e37d8dd24cf7abc32202fbe088df Mon Sep 17 00:00:00 2001 From: Brian Lindahl Date: Wed, 30 Oct 2024 11:43:23 -0600 Subject: Allow apps to apply picture profiles with priority to layers Bug: 337330263 Test: build Test: atest LayerSnapshotTest Flag: com.android.graphics.libgui.flags.apply_picture_profiles Change-Id: I1adb6069d0168084abf0a76d310abb4ffad5ce5f --- services/surfaceflinger/SurfaceFlinger.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index a7ab117679..0d03a6cef3 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3558,7 +3558,9 @@ std::optional SurfaceFlinger::processHotplugConnect(PhysicalDispl } state.isProtected = true; state.displayName = std::move(info.name); - + state.maxLayerPictureProfiles = getHwComposer().getMaxLayerPictureProfiles(displayId); + state.hasPictureProcessing = + getHwComposer().hasDisplayCapability(displayId, DisplayCapability::PICTURE_PROCESSING); mCurrentState.displays.add(token, state); ALOGI("Connecting %s", displayString); return activeModeId; @@ -3719,6 +3721,8 @@ void SurfaceFlinger::processDisplayAdded(const wp& displayToken, builder.setPixels(resolution); builder.setIsSecure(state.isSecure); builder.setIsProtected(state.isProtected); + builder.setHasPictureProcessing(state.hasPictureProcessing); + builder.setMaxLayerPictureProfiles(state.maxLayerPictureProfiles); builder.setPowerAdvisor(mPowerAdvisor.get()); builder.setName(state.displayName); auto compositionDisplay = getCompositionEngine().createDisplay(builder.build()); -- cgit v1.2.3-59-g8ed1b