Loading services/surfaceflinger/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ cc_defaults { "libGLESv1_CM", "libGLESv2", "libgui", "libhardware", "libhidlbase", "liblayers_proto", "liblog", Loading services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public: status_t(DisplayId, uint32_t, const sp<Fence>&, const sp<GraphicBuffer>&, ui::Dataspace)); MOCK_METHOD1(presentAndGetReleaseFences, status_t(DisplayId)); MOCK_METHOD2(setPowerMode, status_t(DisplayId, int)); MOCK_METHOD2(setPowerMode, status_t(DisplayId, hal::PowerMode)); MOCK_METHOD2(setActiveConfig, status_t(DisplayId, size_t)); MOCK_METHOD2(setColorTransform, status_t(DisplayId, const mat4&)); MOCK_METHOD1(disconnectDisplay, void(DisplayId)); Loading services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -716,7 +716,7 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest { } void expectSetColorCall() { hwc_color_t color = {static_cast<uint8_t>(std::round(kColor.r * 255)), const hal::Color color = {static_cast<uint8_t>(std::round(kColor.r * 255)), static_cast<uint8_t>(std::round(kColor.g * 255)), static_cast<uint8_t>(std::round(kColor.b * 255)), 255}; Loading services/surfaceflinger/DisplayDevice.cpp +8 −5 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ namespace android { namespace hal = hardware::graphics::composer::hal; using android::base::StringAppendF; ui::Transform::RotationFlags DisplayDevice::sPrimaryDisplayRotationFlags = ui::Transform::ROT_0; Loading Loading @@ -119,17 +121,17 @@ uint32_t DisplayDevice::getPageFlipCount() const { } // ---------------------------------------------------------------------------- void DisplayDevice::setPowerMode(int mode) { void DisplayDevice::setPowerMode(hal::PowerMode mode) { mPowerMode = mode; getCompositionDisplay()->setCompositionEnabled(mPowerMode != HWC_POWER_MODE_OFF); getCompositionDisplay()->setCompositionEnabled(mPowerMode != hal::PowerMode::OFF); } int DisplayDevice::getPowerMode() const { hal::PowerMode DisplayDevice::getPowerMode() const { return mPowerMode; } bool DisplayDevice::isPoweredOn() const { return mPowerMode != HWC_POWER_MODE_OFF; return mPowerMode != hal::PowerMode::OFF; } void DisplayDevice::setActiveConfig(HwcConfigIndexType mode) { Loading Loading @@ -262,7 +264,8 @@ void DisplayDevice::dump(std::string& result) const { StringAppendF(&result, "+ %s\n", getDebugName().c_str()); result.append(" "); StringAppendF(&result, "powerMode=%d, ", mPowerMode); StringAppendF(&result, "powerMode=%s (%d), ", to_string(mPowerMode).c_str(), static_cast<int32_t>(mPowerMode)); StringAppendF(&result, "activeConfig=%d, ", mActiveConfig.value()); getCompositionDisplay()->dump(result); } Loading services/surfaceflinger/DisplayDevice.h +7 −6 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ #include <android/native_window.h> #include <binder/IBinder.h> #include <gui/LayerState.h> #include <hardware/hwcomposer_defs.h> #include <math/mat4.h> #include <renderengine/RenderEngine.h> #include <system/window.h> Loading Loading @@ -136,8 +135,8 @@ public: /* ------------------------------------------------------------------------ * Display power mode management. */ int getPowerMode() const; void setPowerMode(int mode); hardware::graphics::composer::hal::PowerMode getPowerMode() const; void setPowerMode(hardware::graphics::composer::hal::PowerMode mode); bool isPoweredOn() const; ui::Dataspace getCompositionDataSpace() const; Loading Loading @@ -173,7 +172,8 @@ private: static ui::Transform::RotationFlags sPrimaryDisplayRotationFlags; int mPowerMode = HWC_POWER_MODE_OFF; hardware::graphics::composer::hal::PowerMode mPowerMode = hardware::graphics::composer::hal::PowerMode::OFF; HwcConfigIndexType mActiveConfig; // TODO(b/74619554): Remove special cases for primary display. Loading @@ -184,7 +184,7 @@ struct DisplayDeviceState { struct Physical { DisplayId id; DisplayConnectionType type; android::hardware::graphics::composer::hal::HWDisplayId hwcDisplayId; hardware::graphics::composer::hal::HWDisplayId hwcDisplayId; bool operator==(const Physical& other) const { return id == other.id && type == other.type && hwcDisplayId == other.hwcDisplayId; Loading Loading @@ -228,7 +228,8 @@ struct DisplayDeviceCreationArgs { HdrCapabilities hdrCapabilities; int32_t supportedPerFrameMetadata{0}; std::unordered_map<ui::ColorMode, std::vector<ui::RenderIntent>> hwcColorModes; int initialPowerMode{HWC_POWER_MODE_NORMAL}; hardware::graphics::composer::hal::PowerMode initialPowerMode{ hardware::graphics::composer::hal::PowerMode::ON}; bool isPrimary{false}; }; Loading Loading
services/surfaceflinger/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ cc_defaults { "libGLESv1_CM", "libGLESv2", "libgui", "libhardware", "libhidlbase", "liblayers_proto", "liblog", Loading
services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public: status_t(DisplayId, uint32_t, const sp<Fence>&, const sp<GraphicBuffer>&, ui::Dataspace)); MOCK_METHOD1(presentAndGetReleaseFences, status_t(DisplayId)); MOCK_METHOD2(setPowerMode, status_t(DisplayId, int)); MOCK_METHOD2(setPowerMode, status_t(DisplayId, hal::PowerMode)); MOCK_METHOD2(setActiveConfig, status_t(DisplayId, size_t)); MOCK_METHOD2(setColorTransform, status_t(DisplayId, const mat4&)); MOCK_METHOD1(disconnectDisplay, void(DisplayId)); Loading
services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -716,7 +716,7 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest { } void expectSetColorCall() { hwc_color_t color = {static_cast<uint8_t>(std::round(kColor.r * 255)), const hal::Color color = {static_cast<uint8_t>(std::round(kColor.r * 255)), static_cast<uint8_t>(std::round(kColor.g * 255)), static_cast<uint8_t>(std::round(kColor.b * 255)), 255}; Loading
services/surfaceflinger/DisplayDevice.cpp +8 −5 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ namespace android { namespace hal = hardware::graphics::composer::hal; using android::base::StringAppendF; ui::Transform::RotationFlags DisplayDevice::sPrimaryDisplayRotationFlags = ui::Transform::ROT_0; Loading Loading @@ -119,17 +121,17 @@ uint32_t DisplayDevice::getPageFlipCount() const { } // ---------------------------------------------------------------------------- void DisplayDevice::setPowerMode(int mode) { void DisplayDevice::setPowerMode(hal::PowerMode mode) { mPowerMode = mode; getCompositionDisplay()->setCompositionEnabled(mPowerMode != HWC_POWER_MODE_OFF); getCompositionDisplay()->setCompositionEnabled(mPowerMode != hal::PowerMode::OFF); } int DisplayDevice::getPowerMode() const { hal::PowerMode DisplayDevice::getPowerMode() const { return mPowerMode; } bool DisplayDevice::isPoweredOn() const { return mPowerMode != HWC_POWER_MODE_OFF; return mPowerMode != hal::PowerMode::OFF; } void DisplayDevice::setActiveConfig(HwcConfigIndexType mode) { Loading Loading @@ -262,7 +264,8 @@ void DisplayDevice::dump(std::string& result) const { StringAppendF(&result, "+ %s\n", getDebugName().c_str()); result.append(" "); StringAppendF(&result, "powerMode=%d, ", mPowerMode); StringAppendF(&result, "powerMode=%s (%d), ", to_string(mPowerMode).c_str(), static_cast<int32_t>(mPowerMode)); StringAppendF(&result, "activeConfig=%d, ", mActiveConfig.value()); getCompositionDisplay()->dump(result); } Loading
services/surfaceflinger/DisplayDevice.h +7 −6 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ #include <android/native_window.h> #include <binder/IBinder.h> #include <gui/LayerState.h> #include <hardware/hwcomposer_defs.h> #include <math/mat4.h> #include <renderengine/RenderEngine.h> #include <system/window.h> Loading Loading @@ -136,8 +135,8 @@ public: /* ------------------------------------------------------------------------ * Display power mode management. */ int getPowerMode() const; void setPowerMode(int mode); hardware::graphics::composer::hal::PowerMode getPowerMode() const; void setPowerMode(hardware::graphics::composer::hal::PowerMode mode); bool isPoweredOn() const; ui::Dataspace getCompositionDataSpace() const; Loading Loading @@ -173,7 +172,8 @@ private: static ui::Transform::RotationFlags sPrimaryDisplayRotationFlags; int mPowerMode = HWC_POWER_MODE_OFF; hardware::graphics::composer::hal::PowerMode mPowerMode = hardware::graphics::composer::hal::PowerMode::OFF; HwcConfigIndexType mActiveConfig; // TODO(b/74619554): Remove special cases for primary display. Loading @@ -184,7 +184,7 @@ struct DisplayDeviceState { struct Physical { DisplayId id; DisplayConnectionType type; android::hardware::graphics::composer::hal::HWDisplayId hwcDisplayId; hardware::graphics::composer::hal::HWDisplayId hwcDisplayId; bool operator==(const Physical& other) const { return id == other.id && type == other.type && hwcDisplayId == other.hwcDisplayId; Loading Loading @@ -228,7 +228,8 @@ struct DisplayDeviceCreationArgs { HdrCapabilities hdrCapabilities; int32_t supportedPerFrameMetadata{0}; std::unordered_map<ui::ColorMode, std::vector<ui::RenderIntent>> hwcColorModes; int initialPowerMode{HWC_POWER_MODE_NORMAL}; hardware::graphics::composer::hal::PowerMode initialPowerMode{ hardware::graphics::composer::hal::PowerMode::ON}; bool isPrimary{false}; }; Loading