summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2023-09-07 18:45:58 -0700
committer Ady Abraham <adyabr@google.com> 2023-09-14 15:54:13 -0700
commit6cdd3fd7dab0149041ee8dd7273fe83888d2b1e3 (patch)
treed16cd080fb54219293612a4e97496e02460f6392 /libs/gui/LayerState.cpp
parent3821b0df36c612755b711d8d5a7b63377d7cf5d9 (diff)
libgui: plumb setFrameRate thru BufferQueue
The current implementation just assumes that the Surface and BLASTBufferQueue lives in the same process and rely on inheritance to handle setFrameRate. This doesn't work for any usecase that the Surface is Parceled to a diffrent process. Bug: 281695725 Test: atest CtsGraphicsTestCases --test-filter SetFrameRateTest* Change-Id: I4e08b92b618fa7b863ca3ef4f7b46d9f1c30c775
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp29
1 files changed, 1 insertions, 28 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index e1afb524e7..9847c056b8 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -22,6 +22,7 @@
#include <android/gui/ISurfaceComposerClient.h>
#include <android/native_window.h>
#include <binder/Parcel.h>
+#include <gui/FrameRateUtils.h>
#include <gui/IGraphicBufferProducer.h>
#include <gui/LayerState.h>
#include <gui/SurfaceControl.h>
@@ -863,34 +864,6 @@ status_t InputWindowCommands::read(const Parcel& input) {
return NO_ERROR;
}
-bool ValidateFrameRate(float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy,
- const char* inFunctionName, bool privileged) {
- const char* functionName = inFunctionName != nullptr ? inFunctionName : "call";
- int floatClassification = std::fpclassify(frameRate);
- if (frameRate < 0 || floatClassification == FP_INFINITE || floatClassification == FP_NAN) {
- ALOGE("%s failed - invalid frame rate %f", functionName, frameRate);
- return false;
- }
-
- if (compatibility != ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT &&
- compatibility != ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE &&
- (!privileged ||
- (compatibility != ANATIVEWINDOW_FRAME_RATE_EXACT &&
- compatibility != ANATIVEWINDOW_FRAME_RATE_NO_VOTE))) {
- ALOGE("%s failed - invalid compatibility value %d privileged: %s", functionName,
- compatibility, privileged ? "yes" : "no");
- return false;
- }
-
- if (changeFrameRateStrategy != ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS &&
- changeFrameRateStrategy != ANATIVEWINDOW_CHANGE_FRAME_RATE_ALWAYS) {
- ALOGE("%s failed - invalid change frame rate strategy value %d", functionName,
- changeFrameRateStrategy);
- }
-
- return true;
-}
-
// ----------------------------------------------------------------------------
namespace gui {