Merge changes If1383a4d,If5193f75,Ia3e2dfa3
* changes:
SF: Log hotplug events
SF: Fix formatting of the layers table in dumpsys
SF: fix conversion issues
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 949227b..7e7f9fc 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -74,6 +74,9 @@
#define DEBUG_RESIZE 0
namespace android {
+namespace {
+constexpr int kDumpTableRowLength = 159;
+} // namespace
using base::StringAppendF;
using namespace android::flag_operators;
@@ -1622,11 +1625,8 @@
}
void Layer::miniDumpHeader(std::string& result) {
- result.append("-------------------------------");
- result.append("-------------------------------");
- result.append("-------------------------------");
- result.append("-------------------------------");
- result.append("-------------------\n");
+ result.append(kDumpTableRowLength, '-');
+ result.append("\n");
result.append(" Layer name\n");
result.append(" Z | ");
result.append(" Window Type | ");
@@ -1634,12 +1634,9 @@
result.append(" Transform | ");
result.append(" Disp Frame (LTRB) | ");
result.append(" Source Crop (LTRB) | ");
- result.append(" Frame Rate (Explicit) [Focused]\n");
- result.append("-------------------------------");
- result.append("-------------------------------");
- result.append("-------------------------------");
- result.append("-------------------------------");
- result.append("-------------------\n");
+ result.append(" Frame Rate (Explicit) (Seamlessness) [Focused]\n");
+ result.append(kDumpTableRowLength, '-');
+ result.append("\n");
}
std::string Layer::frameRateCompatibilityString(Layer::FrameRateCompatibility compatibility) {
@@ -1690,21 +1687,18 @@
crop.bottom);
if (layerState.frameRate.rate.isValid() ||
layerState.frameRate.type != FrameRateCompatibility::Default) {
- StringAppendF(&result, "%s %15s seamless=%s", to_string(layerState.frameRate.rate).c_str(),
+ StringAppendF(&result, "%s %15s %17s", to_string(layerState.frameRate.rate).c_str(),
frameRateCompatibilityString(layerState.frameRate.type).c_str(),
toString(layerState.frameRate.seamlessness).c_str());
} else {
- StringAppendF(&result, " ");
+ result.append(41, ' ');
}
const auto focused = isLayerFocusedBasedOnPriority(getFrameRateSelectionPriority());
StringAppendF(&result, " [%s]\n", focused ? "*" : " ");
- result.append("- - - - - - - - - - - - - - - - ");
- result.append("- - - - - - - - - - - - - - - - ");
- result.append("- - - - - - - - - - - - - - - - ");
- result.append("- - - - - - - - - - - - - - - - ");
- result.append("- - - - - - - -\n");
+ result.append(kDumpTableRowLength, '-');
+ result.append("\n");
}
void Layer::dumpFrameStats(std::string& result) const {
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 20003d0..b696d23 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1618,7 +1618,7 @@
void SurfaceFlinger::onHotplugReceived(int32_t sequenceId, hal::HWDisplayId hwcDisplayId,
hal::Connection connection) {
- ALOGV("%s(%d, %" PRIu64 ", %s)", __FUNCTION__, sequenceId, hwcDisplayId,
+ ALOGI("%s(%d, %" PRIu64 ", %s)", __FUNCTION__, sequenceId, hwcDisplayId,
connection == hal::Connection::CONNECTED ? "connected" : "disconnected");
// Ignore events that do not have the right sequenceId.
@@ -2385,6 +2385,8 @@
}
void SurfaceFlinger::dispatchDisplayHotplugEvent(PhysicalDisplayId displayId, bool connected) {
+ ALOGI("Dispatching display hotplug event displayId=%s, connected=%d",
+ to_string(displayId).c_str(), connected);
mScheduler->onHotplugReceived(mAppConnectionHandle, displayId, connected);
mScheduler->onHotplugReceived(mSfConnectionHandle, displayId, connected);
}
diff --git a/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp b/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp
index f938ba1..e93d0d0 100644
--- a/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp
+++ b/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp
@@ -14,10 +14,6 @@
* limitations under the License.
*/
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
-
#undef LOG_TAG
#define LOG_TAG "SchedulerUnittests"
@@ -83,7 +79,7 @@
std::shared_ptr<const HWC2::Display::Config> RefreshRateStatsTest::createConfig(
HwcConfigIndexType configId, int32_t configGroup, int64_t vsyncPeriod) {
- return HWC2::Display::Config::Builder(mDisplay, configId.value())
+ return HWC2::Display::Config::Builder(mDisplay, static_cast<hal::HWConfigId>(configId.value()))
.setVsyncPeriod(static_cast<int32_t>(vsyncPeriod))
.setConfigGroup(configGroup)
.build();
@@ -105,7 +101,7 @@
// Setting up tests on mobile harness can be flaky with time passing, so testing for
// exact time changes can result in flaxy numbers. To avoid that remember old
// numbers to make sure the correct values are increasing in the next test.
- int screenOff = times["ScreenOff"];
+ auto screenOff = times["ScreenOff"];
// Screen is off by default.
std::this_thread::sleep_for(std::chrono::milliseconds(2));
@@ -124,7 +120,7 @@
EXPECT_LT(0, times["90.00fps"]);
mRefreshRateStats->setPowerMode(PowerMode::DOZE);
- int ninety = mRefreshRateStats->getTotalTimes()["90.00fps"];
+ auto ninety = mRefreshRateStats->getTotalTimes()["90.00fps"];
std::this_thread::sleep_for(std::chrono::milliseconds(2));
times = mRefreshRateStats->getTotalTimes();
EXPECT_LT(screenOff, times["ScreenOff"]);
@@ -154,7 +150,7 @@
// Setting up tests on mobile harness can be flaky with time passing, so testing for
// exact time changes can result in flaxy numbers. To avoid that remember old
// numbers to make sure the correct values are increasing in the next test.
- int screenOff = times["ScreenOff"];
+ auto screenOff = times["ScreenOff"];
// Screen is off by default.
std::this_thread::sleep_for(std::chrono::milliseconds(2));
@@ -174,7 +170,7 @@
// When power mode is normal, time for configs updates.
mRefreshRateStats->setRefreshRate(config1Fps);
- int ninety = mRefreshRateStats->getTotalTimes()["90.00fps"];
+ auto ninety = mRefreshRateStats->getTotalTimes()["90.00fps"];
std::this_thread::sleep_for(std::chrono::milliseconds(2));
times = mRefreshRateStats->getTotalTimes();
EXPECT_EQ(screenOff, times["ScreenOff"]);
@@ -183,7 +179,7 @@
EXPECT_LT(0, times["60.00fps"]);
mRefreshRateStats->setRefreshRate(config0Fps);
- int sixty = mRefreshRateStats->getTotalTimes()["60.00fps"];
+ auto sixty = mRefreshRateStats->getTotalTimes()["60.00fps"];
std::this_thread::sleep_for(std::chrono::milliseconds(2));
times = mRefreshRateStats->getTotalTimes();
EXPECT_EQ(screenOff, times["ScreenOff"]);
@@ -220,6 +216,3 @@
} // namespace
} // namespace scheduler
} // namespace android
-
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic pop // ignored "-Wconversion"