Loading services/surfaceflinger/DisplayHardware/HWComposer.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -359,6 +359,27 @@ std::shared_ptr<const HWC2::Display::Config> return config; } std::vector<int32_t> HWComposer::getColorModes(int32_t displayId) const { std::vector<int32_t> modes; if (!isValidDisplay(displayId)) { ALOGE("getColorModes: Attempted to access invalid display %d", displayId); return modes; } const std::shared_ptr<HWC2::Display>& hwcDisplay = mDisplayData[displayId].hwcDisplay; auto error = hwcDisplay->getColorModes(&modes); if (error != HWC2::Error::None) { ALOGE("getColorModes failed for display %d: %s (%d)", displayId, to_string(error).c_str(), static_cast<int32_t>(error)); return std::vector<int32_t>(); } return modes; } void HWComposer::setVsyncEnabled(int32_t disp, HWC2::Vsync enabled) { if (disp < 0 || disp >= HWC_DISPLAY_VIRTUAL) { ALOGD("setVsyncEnabled: Ignoring for virtual display %d", disp); Loading services/surfaceflinger/DisplayHardware/HWComposer.h +2 −9 Original line number Diff line number Diff line Loading @@ -137,15 +137,6 @@ public: void setVsyncEnabled(int32_t disp, HWC2::Vsync enabled); struct DisplayConfig { uint32_t width; uint32_t height; float xdpi; float ydpi; nsecs_t refresh; int colorTransform; }; // Query display parameters. Pass in a display index (e.g. // HWC_DISPLAY_PRIMARY). nsecs_t getRefreshTimestamp(int32_t disp) const; Loading @@ -158,6 +149,8 @@ public: std::shared_ptr<const HWC2::Display::Config> getActiveConfig(int32_t displayId) const; std::vector<int32_t> getColorModes(int32_t displayId) const; // for debugging ---------------------------------------------------------- void dump(String8& out) const; Loading services/surfaceflinger/SurfaceFlinger.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -614,9 +614,6 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, info.fps = 1e9 / hwConfig->getVsyncPeriod(); info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS; // TODO: Hook this back up info.colorTransform = 0; // This is how far in advance a buffer must be queued for // presentation at a given time. If you want a buffer to appear // on the screen at time N, you must submit the buffer before Loading @@ -635,8 +632,19 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, // All non-virtual displays are currently considered secure. info.secure = true; // DisplayManager expects each color mode to be its own display // info record. std::vector<int32_t> modes = getHwComposer().getColorModes(type); if (modes.size() == 0) { info.colorTransform = 0; configs->push_back(info); } for (int32_t mode : modes) { info.colorTransform = mode; configs->push_back(info); } } return NO_ERROR; } Loading Loading
services/surfaceflinger/DisplayHardware/HWComposer.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -359,6 +359,27 @@ std::shared_ptr<const HWC2::Display::Config> return config; } std::vector<int32_t> HWComposer::getColorModes(int32_t displayId) const { std::vector<int32_t> modes; if (!isValidDisplay(displayId)) { ALOGE("getColorModes: Attempted to access invalid display %d", displayId); return modes; } const std::shared_ptr<HWC2::Display>& hwcDisplay = mDisplayData[displayId].hwcDisplay; auto error = hwcDisplay->getColorModes(&modes); if (error != HWC2::Error::None) { ALOGE("getColorModes failed for display %d: %s (%d)", displayId, to_string(error).c_str(), static_cast<int32_t>(error)); return std::vector<int32_t>(); } return modes; } void HWComposer::setVsyncEnabled(int32_t disp, HWC2::Vsync enabled) { if (disp < 0 || disp >= HWC_DISPLAY_VIRTUAL) { ALOGD("setVsyncEnabled: Ignoring for virtual display %d", disp); Loading
services/surfaceflinger/DisplayHardware/HWComposer.h +2 −9 Original line number Diff line number Diff line Loading @@ -137,15 +137,6 @@ public: void setVsyncEnabled(int32_t disp, HWC2::Vsync enabled); struct DisplayConfig { uint32_t width; uint32_t height; float xdpi; float ydpi; nsecs_t refresh; int colorTransform; }; // Query display parameters. Pass in a display index (e.g. // HWC_DISPLAY_PRIMARY). nsecs_t getRefreshTimestamp(int32_t disp) const; Loading @@ -158,6 +149,8 @@ public: std::shared_ptr<const HWC2::Display::Config> getActiveConfig(int32_t displayId) const; std::vector<int32_t> getColorModes(int32_t displayId) const; // for debugging ---------------------------------------------------------- void dump(String8& out) const; Loading
services/surfaceflinger/SurfaceFlinger.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -614,9 +614,6 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, info.fps = 1e9 / hwConfig->getVsyncPeriod(); info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS; // TODO: Hook this back up info.colorTransform = 0; // This is how far in advance a buffer must be queued for // presentation at a given time. If you want a buffer to appear // on the screen at time N, you must submit the buffer before Loading @@ -635,8 +632,19 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, // All non-virtual displays are currently considered secure. info.secure = true; // DisplayManager expects each color mode to be its own display // info record. std::vector<int32_t> modes = getHwComposer().getColorModes(type); if (modes.size() == 0) { info.colorTransform = 0; configs->push_back(info); } for (int32_t mode : modes) { info.colorTransform = mode; configs->push_back(info); } } return NO_ERROR; } Loading