summaryrefslogtreecommitdiff
path: root/libs/gui/ISurfaceComposer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/ISurfaceComposer.cpp')
-rw-r--r--libs/gui/ISurfaceComposer.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index 580579759f..da7369db1b 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -878,6 +878,45 @@ public:
return reply.readInt32();
}
+ virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken,
+ int32_t defaultModeId, float minRefreshRate,
+ float maxRefreshRate) {
+ Parcel data, reply;
+ status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs: failed to writeInterfaceToken: %d", result);
+ return result;
+ }
+ result = data.writeStrongBinder(displayToken);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs: failed to write display token: %d", result);
+ return result;
+ }
+ result = data.writeInt32(defaultModeId);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs failed to write defaultModeId: %d", result);
+ return result;
+ }
+ result = data.writeFloat(minRefreshRate);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs failed to write minRefreshRate: %d", result);
+ return result;
+ }
+ result = data.writeFloat(maxRefreshRate);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs failed to write maxRefreshRate: %d", result);
+ return result;
+ }
+
+ result = remote()->transact(BnSurfaceComposer::SET_DESIRED_DISPLAY_CONFIG_SPECS, data,
+ &reply);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs failed to transact: %d", result);
+ return result;
+ }
+ return reply.readInt32();
+ }
+
virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken,
std::vector<int32_t>* outAllowedConfigs) {
if (!outAllowedConfigs) return BAD_VALUE;
@@ -1554,6 +1593,38 @@ status_t BnSurfaceComposer::onTransact(
reply->writeInt32(result);
return result;
}
+ case SET_DESIRED_DISPLAY_CONFIG_SPECS: {
+ CHECK_INTERFACE(ISurfaceComposer, data, reply);
+ sp<IBinder> displayToken = data.readStrongBinder();
+ int32_t defaultModeId;
+ status_t result = data.readInt32(&defaultModeId);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs: failed to read defaultModeId: %d", result);
+ return result;
+ }
+ float minRefreshRate;
+ result = data.readFloat(&minRefreshRate);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs: failed to read minRefreshRate: %d", result);
+ return result;
+ }
+ float maxRefreshRate;
+ result = data.readFloat(&maxRefreshRate);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs: failed to read maxRefreshRate: %d", result);
+ return result;
+ }
+ result = setDesiredDisplayConfigSpecs(displayToken, defaultModeId, minRefreshRate,
+ maxRefreshRate);
+ if (result != NO_ERROR) {
+ ALOGE("setDesiredDisplayConfigSpecs: failed to call setDesiredDisplayConfigSpecs: "
+ "%d",
+ result);
+ return result;
+ }
+ reply->writeInt32(result);
+ return result;
+ }
case GET_DISPLAY_BRIGHTNESS_SUPPORT: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> displayToken;