Loading libs/gui/ISurfaceComposer.cpp +99 −30 Original line number Original line Diff line number Diff line Loading @@ -931,8 +931,11 @@ public: } } virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t defaultConfig, float minRefreshRate, int32_t defaultConfig, float maxRefreshRate) { float primaryRefreshRateMin, float primaryRefreshRateMax, float appRequestRefreshRateMin, float appRequestRefreshRateMax) { Parcel data, reply; Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { if (result != NO_ERROR) { Loading @@ -949,14 +952,26 @@ public: ALOGE("setDesiredDisplayConfigSpecs failed to write defaultConfig: %d", result); ALOGE("setDesiredDisplayConfigSpecs failed to write defaultConfig: %d", result); return result; return result; } } result = data.writeFloat(minRefreshRate); result = data.writeFloat(primaryRefreshRateMin); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs failed to write minRefreshRate: %d", result); ALOGE("setDesiredDisplayConfigSpecs failed to write primaryRefreshRateMin: %d", result); return result; return result; } } result = data.writeFloat(maxRefreshRate); result = data.writeFloat(primaryRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs failed to write maxRefreshRate: %d", result); ALOGE("setDesiredDisplayConfigSpecs failed to write primaryRefreshRateMax: %d", result); return result; } result = data.writeFloat(appRequestRefreshRateMin); if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs failed to write appRequestRefreshRateMin: %d", result); return result; } result = data.writeFloat(appRequestRefreshRateMax); if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs failed to write appRequestRefreshRateMax: %d", result); return result; return result; } } Loading @@ -971,9 +986,14 @@ public: virtual status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, virtual status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t* outDefaultConfig, int32_t* outDefaultConfig, float* outMinRefreshRate, float* outPrimaryRefreshRateMin, float* outMaxRefreshRate) { float* outPrimaryRefreshRateMax, if (!outDefaultConfig || !outMinRefreshRate || !outMaxRefreshRate) return BAD_VALUE; float* outAppRequestRefreshRateMin, float* outAppRequestRefreshRateMax) { if (!outDefaultConfig || !outPrimaryRefreshRateMin || !outPrimaryRefreshRateMax || !outAppRequestRefreshRateMin || !outAppRequestRefreshRateMax) { return BAD_VALUE; } Parcel data, reply; Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { if (result != NO_ERROR) { Loading @@ -996,14 +1016,26 @@ public: ALOGE("getDesiredDisplayConfigSpecs failed to read defaultConfig: %d", result); ALOGE("getDesiredDisplayConfigSpecs failed to read defaultConfig: %d", result); return result; return result; } } result = reply.readFloat(outMinRefreshRate); result = reply.readFloat(outPrimaryRefreshRateMin); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs failed to read minRefreshRate: %d", result); ALOGE("getDesiredDisplayConfigSpecs failed to read primaryRefreshRateMin: %d", result); return result; return result; } } result = reply.readFloat(outMaxRefreshRate); result = reply.readFloat(outPrimaryRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs failed to read maxRefreshRate: %d", result); ALOGE("getDesiredDisplayConfigSpecs failed to read primaryRefreshRateMax: %d", result); return result; } result = reply.readFloat(outAppRequestRefreshRateMin); if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs failed to read appRequestRefreshRateMin: %d", result); return result; } result = reply.readFloat(outAppRequestRefreshRateMax); if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs failed to read appRequestRefreshRateMax: %d", result); return result; return result; } } return reply.readInt32(); return reply.readInt32(); Loading Loading @@ -1835,20 +1867,38 @@ status_t BnSurfaceComposer::onTransact( ALOGE("setDesiredDisplayConfigSpecs: failed to read defaultConfig: %d", result); ALOGE("setDesiredDisplayConfigSpecs: failed to read defaultConfig: %d", result); return result; return result; } } float minRefreshRate; float primaryRefreshRateMin; result = data.readFloat(&minRefreshRate); result = data.readFloat(&primaryRefreshRateMin); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to read minRefreshRate: %d", result); ALOGE("setDesiredDisplayConfigSpecs: failed to read primaryRefreshRateMin: %d", result); return result; return result; } } float maxRefreshRate; float primaryRefreshRateMax; result = data.readFloat(&maxRefreshRate); result = data.readFloat(&primaryRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to read maxRefreshRate: %d", result); ALOGE("setDesiredDisplayConfigSpecs: failed to read primaryRefreshRateMax: %d", result); return result; return result; } } result = setDesiredDisplayConfigSpecs(displayToken, defaultConfig, minRefreshRate, float appRequestRefreshRateMin; maxRefreshRate); result = data.readFloat(&appRequestRefreshRateMin); if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to read appRequestRefreshRateMin: %d", result); return result; } float appRequestRefreshRateMax; result = data.readFloat(&appRequestRefreshRateMax); if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to read appRequestRefreshRateMax: %d", result); return result; } result = setDesiredDisplayConfigSpecs(displayToken, defaultConfig, primaryRefreshRateMin, primaryRefreshRateMax, appRequestRefreshRateMin, appRequestRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to call setDesiredDisplayConfigSpecs: " ALOGE("setDesiredDisplayConfigSpecs: failed to call setDesiredDisplayConfigSpecs: " "%d", "%d", Loading @@ -1862,11 +1912,16 @@ status_t BnSurfaceComposer::onTransact( CHECK_INTERFACE(ISurfaceComposer, data, reply); CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken = data.readStrongBinder(); sp<IBinder> displayToken = data.readStrongBinder(); int32_t defaultConfig; int32_t defaultConfig; float minRefreshRate; float primaryRefreshRateMin; float maxRefreshRate; float primaryRefreshRateMax; float appRequestRefreshRateMin; float appRequestRefreshRateMax; status_t result = getDesiredDisplayConfigSpecs(displayToken, &defaultConfig, status_t result = &minRefreshRate, &maxRefreshRate); getDesiredDisplayConfigSpecs(displayToken, &defaultConfig, &primaryRefreshRateMin, &primaryRefreshRateMax, &appRequestRefreshRateMin, &appRequestRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to get getDesiredDisplayConfigSpecs: " ALOGE("getDesiredDisplayConfigSpecs: failed to get getDesiredDisplayConfigSpecs: " "%d", "%d", Loading @@ -1879,14 +1934,28 @@ status_t BnSurfaceComposer::onTransact( ALOGE("getDesiredDisplayConfigSpecs: failed to write defaultConfig: %d", result); ALOGE("getDesiredDisplayConfigSpecs: failed to write defaultConfig: %d", result); return result; return result; } } result = reply->writeFloat(minRefreshRate); result = reply->writeFloat(primaryRefreshRateMin); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to write minRefreshRate: %d", result); ALOGE("getDesiredDisplayConfigSpecs: failed to write primaryRefreshRateMin: %d", result); return result; return result; } } result = reply->writeFloat(maxRefreshRate); result = reply->writeFloat(primaryRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to write maxRefreshRate: %d", result); ALOGE("getDesiredDisplayConfigSpecs: failed to write primaryRefreshRateMax: %d", result); return result; } result = reply->writeFloat(appRequestRefreshRateMin); if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to write appRequestRefreshRateMin: %d", result); return result; } result = reply->writeFloat(appRequestRefreshRateMax); if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to write appRequestRefreshRateMax: %d", result); return result; return result; } } reply->writeInt32(result); reply->writeInt32(result); Loading libs/gui/SurfaceComposerClient.cpp +16 −12 Original line number Original line Diff line number Diff line Loading @@ -1698,22 +1698,26 @@ int SurfaceComposerClient::getActiveConfig(const sp<IBinder>& display) { status_t SurfaceComposerClient::setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, status_t SurfaceComposerClient::setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t defaultConfig, int32_t defaultConfig, float minRefreshRate, float primaryRefreshRateMin, float maxRefreshRate) { float primaryRefreshRateMax, return ComposerService::getComposerService()->setDesiredDisplayConfigSpecs(displayToken, float appRequestRefreshRateMin, defaultConfig, float appRequestRefreshRateMax) { minRefreshRate, return ComposerService::getComposerService() maxRefreshRate); ->setDesiredDisplayConfigSpecs(displayToken, defaultConfig, primaryRefreshRateMin, primaryRefreshRateMax, appRequestRefreshRateMin, appRequestRefreshRateMax); } } status_t SurfaceComposerClient::getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, status_t SurfaceComposerClient::getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t* outDefaultConfig, int32_t* outDefaultConfig, float* outMinRefreshRate, float* outPrimaryRefreshRateMin, float* outMaxRefreshRate) { float* outPrimaryRefreshRateMax, return ComposerService::getComposerService()->getDesiredDisplayConfigSpecs(displayToken, float* outAppRequestRefreshRateMin, outDefaultConfig, float* outAppRequestRefreshRateMax) { outMinRefreshRate, return ComposerService::getComposerService() outMaxRefreshRate); ->getDesiredDisplayConfigSpecs(displayToken, outDefaultConfig, outPrimaryRefreshRateMin, outPrimaryRefreshRateMax, outAppRequestRefreshRateMin, outAppRequestRefreshRateMax); } } status_t SurfaceComposerClient::getDisplayColorModes(const sp<IBinder>& display, status_t SurfaceComposerClient::getDisplayColorModes(const sp<IBinder>& display, Loading libs/gui/include/gui/ISurfaceComposer.h +25 −8 Original line number Original line Diff line number Diff line Loading @@ -426,19 +426,36 @@ public: */ */ virtual status_t removeRegionSamplingListener(const sp<IRegionSamplingListener>& listener) = 0; virtual status_t removeRegionSamplingListener(const sp<IRegionSamplingListener>& listener) = 0; /* /* Sets the refresh rate boundaries for the display. * Sets the refresh rate boundaries for display configuration. * * For all other parameters, default configuration is used. The index for the default is * The primary refresh rate range represents display manager's general guidance on the display * corresponding to the configs returned from getDisplayConfigs(). * configs we'll consider when switching refresh rates. Unless we get an explicit signal from an * app, we should stay within this range. * * The app request refresh rate range allows us to consider more display configs when switching * refresh rates. Although we should generally stay within the primary range, specific * considerations, such as layer frame rate settings specified via the setFrameRate() api, may * cause us to go outside the primary range. We never go outside the app request range. The app * request range will be greater than or equal to the primary refresh rate range, never smaller. * * defaultConfig is used to narrow the list of display configs SurfaceFlinger will consider * switching between. Only configs with a config group and resolution matching defaultConfig * will be considered for switching. The defaultConfig index corresponds to the list of configs * returned from getDisplayConfigs(). */ */ virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t defaultConfig, float minRefreshRate, int32_t defaultConfig, float maxRefreshRate) = 0; float primaryRefreshRateMin, float primaryRefreshRateMax, float appRequestRefreshRateMin, float appRequestRefreshRateMax) = 0; virtual status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, virtual status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t* outDefaultConfig, int32_t* outDefaultConfig, float* outMinRefreshRate, float* outPrimaryRefreshRateMin, float* outMaxRefreshRate) = 0; float* outPrimaryRefreshRateMax, float* outAppRequestRefreshRateMin, float* outAppRequestRefreshRateMax) = 0; /* /* * Gets whether brightness operations are supported on a display. * Gets whether brightness operations are supported on a display. * * Loading libs/gui/include/gui/SurfaceComposerClient.h +10 −12 Original line number Original line Diff line number Diff line Loading @@ -118,21 +118,19 @@ public: // Shorthand for getDisplayConfigs element at getActiveConfig index. // Shorthand for getDisplayConfigs element at getActiveConfig index. static status_t getActiveDisplayConfig(const sp<IBinder>& display, DisplayConfig*); static status_t getActiveDisplayConfig(const sp<IBinder>& display, DisplayConfig*); // Sets the refresh rate boundaries for display configuration. // Sets the refresh rate boundaries for the display. // For all other parameters, default configuration is used. The index for the default is // corresponting to the configs returned from getDisplayConfigs(). static status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, static status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t defaultConfig, float minRefreshRate, int32_t defaultConfig, float primaryRefreshRateMin, float maxRefreshRate); float primaryRefreshRateMax, // Gets the refresh rate boundaries for display configuration. float appRequestRefreshRateMin, // For all other parameters, default configuration is used. The index for the default is float appRequestRefreshRateMax); // corresponting to the configs returned from getDisplayConfigs(). // Gets the refresh rate boundaries for the display. // The reason is passed in for telemetry tracking, and it corresponds to the list of all // the policy rules that were used. static status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, static status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t* outDefaultConfig, int32_t* outDefaultConfig, float* outMinRefreshRate, float* outPrimaryRefreshRateMin, float* outMaxRefreshRate); float* outPrimaryRefreshRateMax, float* outAppRequestRefreshRateMin, float* outAppRequestRefreshRateMax); // Gets the list of supported color modes for the given display // Gets the list of supported color modes for the given display static status_t getDisplayColorModes(const sp<IBinder>& display, static status_t getDisplayColorModes(const sp<IBinder>& display, Loading libs/gui/tests/Surface_test.cpp +9 −4 Original line number Original line Diff line number Diff line Loading @@ -835,14 +835,19 @@ public: return NO_ERROR; return NO_ERROR; } } status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& /*displayToken*/, status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& /*displayToken*/, int32_t /*defaultConfig*/, float /*minRefreshRate*/, int32_t /*defaultConfig*/, float /*maxRefreshRate*/) { float /*primaryRefreshRateMin*/, float /*primaryRefreshRateMax*/, float /*appRequestRefreshRateMin*/, float /*appRequestRefreshRateMax*/) { return NO_ERROR; return NO_ERROR; } } status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& /*displayToken*/, status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& /*displayToken*/, int32_t* /*outDefaultConfig*/, int32_t* /*outDefaultConfig*/, float* /*outMinRefreshRate*/, float* /*outPrimaryRefreshRateMin*/, float* /*outMaxRefreshRate*/) override { float* /*outPrimaryRefreshRateMax*/, float* /*outAppRequestRefreshRateMin*/, float* /*outAppRequestRefreshRateMax*/) override { return NO_ERROR; return NO_ERROR; }; }; status_t notifyPowerHint(int32_t /*hintId*/) override { return NO_ERROR; } status_t notifyPowerHint(int32_t /*hintId*/) override { return NO_ERROR; } Loading Loading
libs/gui/ISurfaceComposer.cpp +99 −30 Original line number Original line Diff line number Diff line Loading @@ -931,8 +931,11 @@ public: } } virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t defaultConfig, float minRefreshRate, int32_t defaultConfig, float maxRefreshRate) { float primaryRefreshRateMin, float primaryRefreshRateMax, float appRequestRefreshRateMin, float appRequestRefreshRateMax) { Parcel data, reply; Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { if (result != NO_ERROR) { Loading @@ -949,14 +952,26 @@ public: ALOGE("setDesiredDisplayConfigSpecs failed to write defaultConfig: %d", result); ALOGE("setDesiredDisplayConfigSpecs failed to write defaultConfig: %d", result); return result; return result; } } result = data.writeFloat(minRefreshRate); result = data.writeFloat(primaryRefreshRateMin); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs failed to write minRefreshRate: %d", result); ALOGE("setDesiredDisplayConfigSpecs failed to write primaryRefreshRateMin: %d", result); return result; return result; } } result = data.writeFloat(maxRefreshRate); result = data.writeFloat(primaryRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs failed to write maxRefreshRate: %d", result); ALOGE("setDesiredDisplayConfigSpecs failed to write primaryRefreshRateMax: %d", result); return result; } result = data.writeFloat(appRequestRefreshRateMin); if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs failed to write appRequestRefreshRateMin: %d", result); return result; } result = data.writeFloat(appRequestRefreshRateMax); if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs failed to write appRequestRefreshRateMax: %d", result); return result; return result; } } Loading @@ -971,9 +986,14 @@ public: virtual status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, virtual status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t* outDefaultConfig, int32_t* outDefaultConfig, float* outMinRefreshRate, float* outPrimaryRefreshRateMin, float* outMaxRefreshRate) { float* outPrimaryRefreshRateMax, if (!outDefaultConfig || !outMinRefreshRate || !outMaxRefreshRate) return BAD_VALUE; float* outAppRequestRefreshRateMin, float* outAppRequestRefreshRateMax) { if (!outDefaultConfig || !outPrimaryRefreshRateMin || !outPrimaryRefreshRateMax || !outAppRequestRefreshRateMin || !outAppRequestRefreshRateMax) { return BAD_VALUE; } Parcel data, reply; Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { if (result != NO_ERROR) { Loading @@ -996,14 +1016,26 @@ public: ALOGE("getDesiredDisplayConfigSpecs failed to read defaultConfig: %d", result); ALOGE("getDesiredDisplayConfigSpecs failed to read defaultConfig: %d", result); return result; return result; } } result = reply.readFloat(outMinRefreshRate); result = reply.readFloat(outPrimaryRefreshRateMin); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs failed to read minRefreshRate: %d", result); ALOGE("getDesiredDisplayConfigSpecs failed to read primaryRefreshRateMin: %d", result); return result; return result; } } result = reply.readFloat(outMaxRefreshRate); result = reply.readFloat(outPrimaryRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs failed to read maxRefreshRate: %d", result); ALOGE("getDesiredDisplayConfigSpecs failed to read primaryRefreshRateMax: %d", result); return result; } result = reply.readFloat(outAppRequestRefreshRateMin); if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs failed to read appRequestRefreshRateMin: %d", result); return result; } result = reply.readFloat(outAppRequestRefreshRateMax); if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs failed to read appRequestRefreshRateMax: %d", result); return result; return result; } } return reply.readInt32(); return reply.readInt32(); Loading Loading @@ -1835,20 +1867,38 @@ status_t BnSurfaceComposer::onTransact( ALOGE("setDesiredDisplayConfigSpecs: failed to read defaultConfig: %d", result); ALOGE("setDesiredDisplayConfigSpecs: failed to read defaultConfig: %d", result); return result; return result; } } float minRefreshRate; float primaryRefreshRateMin; result = data.readFloat(&minRefreshRate); result = data.readFloat(&primaryRefreshRateMin); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to read minRefreshRate: %d", result); ALOGE("setDesiredDisplayConfigSpecs: failed to read primaryRefreshRateMin: %d", result); return result; return result; } } float maxRefreshRate; float primaryRefreshRateMax; result = data.readFloat(&maxRefreshRate); result = data.readFloat(&primaryRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to read maxRefreshRate: %d", result); ALOGE("setDesiredDisplayConfigSpecs: failed to read primaryRefreshRateMax: %d", result); return result; return result; } } result = setDesiredDisplayConfigSpecs(displayToken, defaultConfig, minRefreshRate, float appRequestRefreshRateMin; maxRefreshRate); result = data.readFloat(&appRequestRefreshRateMin); if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to read appRequestRefreshRateMin: %d", result); return result; } float appRequestRefreshRateMax; result = data.readFloat(&appRequestRefreshRateMax); if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to read appRequestRefreshRateMax: %d", result); return result; } result = setDesiredDisplayConfigSpecs(displayToken, defaultConfig, primaryRefreshRateMin, primaryRefreshRateMax, appRequestRefreshRateMin, appRequestRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("setDesiredDisplayConfigSpecs: failed to call setDesiredDisplayConfigSpecs: " ALOGE("setDesiredDisplayConfigSpecs: failed to call setDesiredDisplayConfigSpecs: " "%d", "%d", Loading @@ -1862,11 +1912,16 @@ status_t BnSurfaceComposer::onTransact( CHECK_INTERFACE(ISurfaceComposer, data, reply); CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken = data.readStrongBinder(); sp<IBinder> displayToken = data.readStrongBinder(); int32_t defaultConfig; int32_t defaultConfig; float minRefreshRate; float primaryRefreshRateMin; float maxRefreshRate; float primaryRefreshRateMax; float appRequestRefreshRateMin; float appRequestRefreshRateMax; status_t result = getDesiredDisplayConfigSpecs(displayToken, &defaultConfig, status_t result = &minRefreshRate, &maxRefreshRate); getDesiredDisplayConfigSpecs(displayToken, &defaultConfig, &primaryRefreshRateMin, &primaryRefreshRateMax, &appRequestRefreshRateMin, &appRequestRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to get getDesiredDisplayConfigSpecs: " ALOGE("getDesiredDisplayConfigSpecs: failed to get getDesiredDisplayConfigSpecs: " "%d", "%d", Loading @@ -1879,14 +1934,28 @@ status_t BnSurfaceComposer::onTransact( ALOGE("getDesiredDisplayConfigSpecs: failed to write defaultConfig: %d", result); ALOGE("getDesiredDisplayConfigSpecs: failed to write defaultConfig: %d", result); return result; return result; } } result = reply->writeFloat(minRefreshRate); result = reply->writeFloat(primaryRefreshRateMin); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to write minRefreshRate: %d", result); ALOGE("getDesiredDisplayConfigSpecs: failed to write primaryRefreshRateMin: %d", result); return result; return result; } } result = reply->writeFloat(maxRefreshRate); result = reply->writeFloat(primaryRefreshRateMax); if (result != NO_ERROR) { if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to write maxRefreshRate: %d", result); ALOGE("getDesiredDisplayConfigSpecs: failed to write primaryRefreshRateMax: %d", result); return result; } result = reply->writeFloat(appRequestRefreshRateMin); if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to write appRequestRefreshRateMin: %d", result); return result; } result = reply->writeFloat(appRequestRefreshRateMax); if (result != NO_ERROR) { ALOGE("getDesiredDisplayConfigSpecs: failed to write appRequestRefreshRateMax: %d", result); return result; return result; } } reply->writeInt32(result); reply->writeInt32(result); Loading
libs/gui/SurfaceComposerClient.cpp +16 −12 Original line number Original line Diff line number Diff line Loading @@ -1698,22 +1698,26 @@ int SurfaceComposerClient::getActiveConfig(const sp<IBinder>& display) { status_t SurfaceComposerClient::setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, status_t SurfaceComposerClient::setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t defaultConfig, int32_t defaultConfig, float minRefreshRate, float primaryRefreshRateMin, float maxRefreshRate) { float primaryRefreshRateMax, return ComposerService::getComposerService()->setDesiredDisplayConfigSpecs(displayToken, float appRequestRefreshRateMin, defaultConfig, float appRequestRefreshRateMax) { minRefreshRate, return ComposerService::getComposerService() maxRefreshRate); ->setDesiredDisplayConfigSpecs(displayToken, defaultConfig, primaryRefreshRateMin, primaryRefreshRateMax, appRequestRefreshRateMin, appRequestRefreshRateMax); } } status_t SurfaceComposerClient::getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, status_t SurfaceComposerClient::getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t* outDefaultConfig, int32_t* outDefaultConfig, float* outMinRefreshRate, float* outPrimaryRefreshRateMin, float* outMaxRefreshRate) { float* outPrimaryRefreshRateMax, return ComposerService::getComposerService()->getDesiredDisplayConfigSpecs(displayToken, float* outAppRequestRefreshRateMin, outDefaultConfig, float* outAppRequestRefreshRateMax) { outMinRefreshRate, return ComposerService::getComposerService() outMaxRefreshRate); ->getDesiredDisplayConfigSpecs(displayToken, outDefaultConfig, outPrimaryRefreshRateMin, outPrimaryRefreshRateMax, outAppRequestRefreshRateMin, outAppRequestRefreshRateMax); } } status_t SurfaceComposerClient::getDisplayColorModes(const sp<IBinder>& display, status_t SurfaceComposerClient::getDisplayColorModes(const sp<IBinder>& display, Loading
libs/gui/include/gui/ISurfaceComposer.h +25 −8 Original line number Original line Diff line number Diff line Loading @@ -426,19 +426,36 @@ public: */ */ virtual status_t removeRegionSamplingListener(const sp<IRegionSamplingListener>& listener) = 0; virtual status_t removeRegionSamplingListener(const sp<IRegionSamplingListener>& listener) = 0; /* /* Sets the refresh rate boundaries for the display. * Sets the refresh rate boundaries for display configuration. * * For all other parameters, default configuration is used. The index for the default is * The primary refresh rate range represents display manager's general guidance on the display * corresponding to the configs returned from getDisplayConfigs(). * configs we'll consider when switching refresh rates. Unless we get an explicit signal from an * app, we should stay within this range. * * The app request refresh rate range allows us to consider more display configs when switching * refresh rates. Although we should generally stay within the primary range, specific * considerations, such as layer frame rate settings specified via the setFrameRate() api, may * cause us to go outside the primary range. We never go outside the app request range. The app * request range will be greater than or equal to the primary refresh rate range, never smaller. * * defaultConfig is used to narrow the list of display configs SurfaceFlinger will consider * switching between. Only configs with a config group and resolution matching defaultConfig * will be considered for switching. The defaultConfig index corresponds to the list of configs * returned from getDisplayConfigs(). */ */ virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t defaultConfig, float minRefreshRate, int32_t defaultConfig, float maxRefreshRate) = 0; float primaryRefreshRateMin, float primaryRefreshRateMax, float appRequestRefreshRateMin, float appRequestRefreshRateMax) = 0; virtual status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, virtual status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t* outDefaultConfig, int32_t* outDefaultConfig, float* outMinRefreshRate, float* outPrimaryRefreshRateMin, float* outMaxRefreshRate) = 0; float* outPrimaryRefreshRateMax, float* outAppRequestRefreshRateMin, float* outAppRequestRefreshRateMax) = 0; /* /* * Gets whether brightness operations are supported on a display. * Gets whether brightness operations are supported on a display. * * Loading
libs/gui/include/gui/SurfaceComposerClient.h +10 −12 Original line number Original line Diff line number Diff line Loading @@ -118,21 +118,19 @@ public: // Shorthand for getDisplayConfigs element at getActiveConfig index. // Shorthand for getDisplayConfigs element at getActiveConfig index. static status_t getActiveDisplayConfig(const sp<IBinder>& display, DisplayConfig*); static status_t getActiveDisplayConfig(const sp<IBinder>& display, DisplayConfig*); // Sets the refresh rate boundaries for display configuration. // Sets the refresh rate boundaries for the display. // For all other parameters, default configuration is used. The index for the default is // corresponting to the configs returned from getDisplayConfigs(). static status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, static status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t defaultConfig, float minRefreshRate, int32_t defaultConfig, float primaryRefreshRateMin, float maxRefreshRate); float primaryRefreshRateMax, // Gets the refresh rate boundaries for display configuration. float appRequestRefreshRateMin, // For all other parameters, default configuration is used. The index for the default is float appRequestRefreshRateMax); // corresponting to the configs returned from getDisplayConfigs(). // Gets the refresh rate boundaries for the display. // The reason is passed in for telemetry tracking, and it corresponds to the list of all // the policy rules that were used. static status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, static status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t* outDefaultConfig, int32_t* outDefaultConfig, float* outMinRefreshRate, float* outPrimaryRefreshRateMin, float* outMaxRefreshRate); float* outPrimaryRefreshRateMax, float* outAppRequestRefreshRateMin, float* outAppRequestRefreshRateMax); // Gets the list of supported color modes for the given display // Gets the list of supported color modes for the given display static status_t getDisplayColorModes(const sp<IBinder>& display, static status_t getDisplayColorModes(const sp<IBinder>& display, Loading
libs/gui/tests/Surface_test.cpp +9 −4 Original line number Original line Diff line number Diff line Loading @@ -835,14 +835,19 @@ public: return NO_ERROR; return NO_ERROR; } } status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& /*displayToken*/, status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& /*displayToken*/, int32_t /*defaultConfig*/, float /*minRefreshRate*/, int32_t /*defaultConfig*/, float /*maxRefreshRate*/) { float /*primaryRefreshRateMin*/, float /*primaryRefreshRateMax*/, float /*appRequestRefreshRateMin*/, float /*appRequestRefreshRateMax*/) { return NO_ERROR; return NO_ERROR; } } status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& /*displayToken*/, status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& /*displayToken*/, int32_t* /*outDefaultConfig*/, int32_t* /*outDefaultConfig*/, float* /*outMinRefreshRate*/, float* /*outPrimaryRefreshRateMin*/, float* /*outMaxRefreshRate*/) override { float* /*outPrimaryRefreshRateMax*/, float* /*outAppRequestRefreshRateMin*/, float* /*outAppRequestRefreshRateMax*/) override { return NO_ERROR; return NO_ERROR; }; }; status_t notifyPowerHint(int32_t /*hintId*/) override { return NO_ERROR; } status_t notifyPowerHint(int32_t /*hintId*/) override { return NO_ERROR; } Loading