From c2060cb4af1956c4051946591a8e8218e3b82814 Mon Sep 17 00:00:00 2001 From: Marin Shalamanov Date: Tue, 12 Jan 2021 12:56:02 +0100 Subject: [PATCH] Always send Game Content Type down to the HAL Even if Game Content Type is not supported on the connected display we need to propagate the requested state down to the HAL. This is because some devices with external displays, such as Android TV set-top boxes, use this signal to disable/enable on-device processing. Fixes: 202007307 Test: on a device where both ALLM and GAME content type are not supported, request minimal post processing from an app and using logs verify that setContentType(GAME) is called in the HAL Change-Id: I8bc0d8de0ee54d4ff47d9979b75740aa12121190 --- .../server/display/DisplayManagerService.java | 12 ++++++------ .../android/server/display/LocalDisplayAdapter.java | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java index 045ee8a415634..5178f356b60d8 100644 --- a/services/core/java/com/android/server/display/DisplayManagerService.java +++ b/services/core/java/com/android/server/display/DisplayManagerService.java @@ -1632,13 +1632,13 @@ public final class DisplayManagerService extends SystemService { mDisplayModeDirector.getAppRequestObserver().setAppRequest( displayId, requestedModeId, requestedMinRefreshRate, requestedMaxRefreshRate); - if (display.getDisplayInfoLocked().minimalPostProcessingSupported) { - boolean mppRequest = mMinimalPostProcessingAllowed && preferMinimalPostProcessing; + // TODO(b/202378408) set minimal post-processing only if it's supported once we have a + // separate API for disabling on-device processing. + boolean mppRequest = mMinimalPostProcessingAllowed && preferMinimalPostProcessing; - if (display.getRequestedMinimalPostProcessingLocked() != mppRequest) { - display.setRequestedMinimalPostProcessingLocked(mppRequest); - shouldScheduleTraversal = true; - } + if (display.getRequestedMinimalPostProcessingLocked() != mppRequest) { + display.setRequestedMinimalPostProcessingLocked(mppRequest); + shouldScheduleTraversal = true; } if (shouldScheduleTraversal) { diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java index dbe17b71789ab..b6d13e0c5bbf1 100644 --- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java +++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java @@ -993,12 +993,12 @@ final class LocalDisplayAdapter extends DisplayAdapter { mGameContentTypeRequested = on; - if (!mGameContentTypeSupported) { - Slog.d(TAG, "Unable to set game content type because the connected " - + "display does not support game content type."); - return; - } - + // Even if game content type is not supported on the connected display we + // propagate the requested state down to the HAL. This is because some devices + // with external displays, such as Android TV set-top boxes, use this signal + // to disable/enable on-device processing. + // TODO(b/202378408) set game content type only if it's supported once we have a + // separate API for disabling on-device processing. mSurfaceControlProxy.setGameContentType(getDisplayTokenLocked(), on); }