Loading cmds/dumpstate/dumpstate.cpp +59 −2 Original line number Diff line number Diff line Loading @@ -1802,8 +1802,8 @@ static Dumpstate::RunStatus dumpstate() { // Add linker configuration directory ds.AddDir(LINKERCONFIG_DIR, true); /* Dump cgroupfs */ ds.AddDir(CGROUPFS_DIR, true); /* Dump frozen cgroupfs */ dump_frozen_cgroupfs(); if (ds.dump_pool_) { WAIT_TASK_WITH_CONSENT_CHECK(DUMP_INCIDENT_REPORT_TASK, ds.dump_pool_); Loading Loading @@ -4169,6 +4169,63 @@ void dump_route_tables() { fclose(fp); } void dump_frozen_cgroupfs(const char *dir, int level, int (*dump_from_fd)(const char* title, const char* path, int fd)) { DIR *dirp; struct dirent *d; char *newpath = nullptr; dirp = opendir(dir); if (dirp == nullptr) { MYLOGE("%s: %s\n", dir, strerror(errno)); return; } for (; ((d = readdir(dirp))); free(newpath), newpath = nullptr) { if ((d->d_name[0] == '.') && (((d->d_name[1] == '.') && (d->d_name[2] == '\0')) || (d->d_name[1] == '\0'))) { continue; } if (d->d_type == DT_DIR) { asprintf(&newpath, "%s/%s/", dir, d->d_name); if (!newpath) { continue; } if (level == 0 && !strncmp(d->d_name, "uid_", 4)) { dump_frozen_cgroupfs(newpath, 1, dump_from_fd); } else if (level == 1 && !strncmp(d->d_name, "pid_", 4)) { char *freezer = nullptr; asprintf(&freezer, "%s/%s", newpath, "cgroup.freeze"); if (freezer) { FILE* fp = fopen(freezer, "r"); if (fp != NULL) { int frozen; fscanf(fp, "%d", &frozen); if (frozen > 0) { dump_files("", newpath, skip_none, dump_from_fd); } fclose(fp); } free(freezer); } } } } closedir(dirp); } void dump_frozen_cgroupfs() { if (!ds.IsZipping()) { MYLOGD("Not adding cgroupfs because it's not a zipped bugreport\n"); return; } MYLOGD("Adding frozen processes from %s\n", CGROUPFS_DIR); DurationReporter duration_reporter("FROZEN CGROUPFS"); if (PropertiesHelper::IsDryRun()) return; dump_frozen_cgroupfs(CGROUPFS_DIR, 0, _add_file_from_fd); } void Dumpstate::UpdateProgress(int32_t delta_sec) { if (progress_ == nullptr) { MYLOGE("UpdateProgress: progress_ not set\n"); Loading cmds/dumpstate/dumpstate.h +3 −0 Original line number Diff line number Diff line Loading @@ -637,6 +637,9 @@ void do_dmesg(); /* Prints the contents of all the routing tables, both IPv4 and IPv6. */ void dump_route_tables(); /* Dump subdirectories of cgroupfs if the corresponding process is frozen */ void dump_frozen_cgroupfs(); /* Play a sound via Stagefright */ void play_sound(const char *path); Loading libs/gui/BLASTBufferQueue.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -190,13 +190,15 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, SurfaceComposerClient::Transaction t; const bool surfaceControlChanged = !SurfaceControl::isSameSurface(mSurfaceControl, surface); if (surfaceControlChanged && mSurfaceControl != nullptr) { BQA_LOGD("Updating SurfaceControl without recreating BBQ"); } bool applyTransaction = false; // Always update the native object even though they might have the same layer handle, so we can // get the updated transform hint from WM. mSurfaceControl = surface; if (surfaceControlChanged) { BQA_LOGD("Updating SurfaceControl without recreating BBQ"); t.setFlags(mSurfaceControl, layer_state_t::eEnableBackpressure, layer_state_t::eEnableBackpressure); applyTransaction = true; Loading libs/gui/ISurfaceComposer.cpp +41 −0 Original line number Diff line number Diff line Loading @@ -1134,6 +1134,34 @@ public: return NO_ERROR; } status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken, bool* outSupport) const override { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to write interface token: %d", error); return error; } error = data.writeStrongBinder(displayToken); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to write display token: %d", error); return error; } error = remote()->transact(BnSurfaceComposer::GET_DISPLAY_DECORATION_SUPPORT, data, &reply); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to transact: %d", error); return error; } bool support; error = reply.readBool(&support); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read support: %d", error); return error; } *outSupport = support; return NO_ERROR; } status_t setFrameRate(const sp<IGraphicBufferProducer>& surface, float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy) override { Parcel data, reply; Loading Loading @@ -2016,6 +2044,19 @@ status_t BnSurfaceComposer::onTransact( return setGlobalShadowSettings(ambientColor, spotColor, lightPosY, lightPosZ, lightRadius); } case GET_DISPLAY_DECORATION_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read display token: %d", error); return error; } bool support = false; error = getDisplayDecorationSupport(displayToken, &support); reply->writeBool(support); return error; } case SET_FRAME_RATE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> binder; Loading libs/gui/SurfaceComposerClient.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -2216,6 +2216,12 @@ status_t SurfaceComposerClient::setGlobalShadowSettings(const half4& ambientColo lightRadius); } bool SurfaceComposerClient::getDisplayDecorationSupport(const sp<IBinder>& displayToken) { bool support = false; ComposerService::getComposerService()->getDisplayDecorationSupport(displayToken, &support); return support; } int SurfaceComposerClient::getGPUContextPriority() { return ComposerService::getComposerService()->getGPUContextPriority(); } Loading Loading
cmds/dumpstate/dumpstate.cpp +59 −2 Original line number Diff line number Diff line Loading @@ -1802,8 +1802,8 @@ static Dumpstate::RunStatus dumpstate() { // Add linker configuration directory ds.AddDir(LINKERCONFIG_DIR, true); /* Dump cgroupfs */ ds.AddDir(CGROUPFS_DIR, true); /* Dump frozen cgroupfs */ dump_frozen_cgroupfs(); if (ds.dump_pool_) { WAIT_TASK_WITH_CONSENT_CHECK(DUMP_INCIDENT_REPORT_TASK, ds.dump_pool_); Loading Loading @@ -4169,6 +4169,63 @@ void dump_route_tables() { fclose(fp); } void dump_frozen_cgroupfs(const char *dir, int level, int (*dump_from_fd)(const char* title, const char* path, int fd)) { DIR *dirp; struct dirent *d; char *newpath = nullptr; dirp = opendir(dir); if (dirp == nullptr) { MYLOGE("%s: %s\n", dir, strerror(errno)); return; } for (; ((d = readdir(dirp))); free(newpath), newpath = nullptr) { if ((d->d_name[0] == '.') && (((d->d_name[1] == '.') && (d->d_name[2] == '\0')) || (d->d_name[1] == '\0'))) { continue; } if (d->d_type == DT_DIR) { asprintf(&newpath, "%s/%s/", dir, d->d_name); if (!newpath) { continue; } if (level == 0 && !strncmp(d->d_name, "uid_", 4)) { dump_frozen_cgroupfs(newpath, 1, dump_from_fd); } else if (level == 1 && !strncmp(d->d_name, "pid_", 4)) { char *freezer = nullptr; asprintf(&freezer, "%s/%s", newpath, "cgroup.freeze"); if (freezer) { FILE* fp = fopen(freezer, "r"); if (fp != NULL) { int frozen; fscanf(fp, "%d", &frozen); if (frozen > 0) { dump_files("", newpath, skip_none, dump_from_fd); } fclose(fp); } free(freezer); } } } } closedir(dirp); } void dump_frozen_cgroupfs() { if (!ds.IsZipping()) { MYLOGD("Not adding cgroupfs because it's not a zipped bugreport\n"); return; } MYLOGD("Adding frozen processes from %s\n", CGROUPFS_DIR); DurationReporter duration_reporter("FROZEN CGROUPFS"); if (PropertiesHelper::IsDryRun()) return; dump_frozen_cgroupfs(CGROUPFS_DIR, 0, _add_file_from_fd); } void Dumpstate::UpdateProgress(int32_t delta_sec) { if (progress_ == nullptr) { MYLOGE("UpdateProgress: progress_ not set\n"); Loading
cmds/dumpstate/dumpstate.h +3 −0 Original line number Diff line number Diff line Loading @@ -637,6 +637,9 @@ void do_dmesg(); /* Prints the contents of all the routing tables, both IPv4 and IPv6. */ void dump_route_tables(); /* Dump subdirectories of cgroupfs if the corresponding process is frozen */ void dump_frozen_cgroupfs(); /* Play a sound via Stagefright */ void play_sound(const char *path); Loading
libs/gui/BLASTBufferQueue.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -190,13 +190,15 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, SurfaceComposerClient::Transaction t; const bool surfaceControlChanged = !SurfaceControl::isSameSurface(mSurfaceControl, surface); if (surfaceControlChanged && mSurfaceControl != nullptr) { BQA_LOGD("Updating SurfaceControl without recreating BBQ"); } bool applyTransaction = false; // Always update the native object even though they might have the same layer handle, so we can // get the updated transform hint from WM. mSurfaceControl = surface; if (surfaceControlChanged) { BQA_LOGD("Updating SurfaceControl without recreating BBQ"); t.setFlags(mSurfaceControl, layer_state_t::eEnableBackpressure, layer_state_t::eEnableBackpressure); applyTransaction = true; Loading
libs/gui/ISurfaceComposer.cpp +41 −0 Original line number Diff line number Diff line Loading @@ -1134,6 +1134,34 @@ public: return NO_ERROR; } status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken, bool* outSupport) const override { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to write interface token: %d", error); return error; } error = data.writeStrongBinder(displayToken); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to write display token: %d", error); return error; } error = remote()->transact(BnSurfaceComposer::GET_DISPLAY_DECORATION_SUPPORT, data, &reply); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to transact: %d", error); return error; } bool support; error = reply.readBool(&support); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read support: %d", error); return error; } *outSupport = support; return NO_ERROR; } status_t setFrameRate(const sp<IGraphicBufferProducer>& surface, float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy) override { Parcel data, reply; Loading Loading @@ -2016,6 +2044,19 @@ status_t BnSurfaceComposer::onTransact( return setGlobalShadowSettings(ambientColor, spotColor, lightPosY, lightPosZ, lightRadius); } case GET_DISPLAY_DECORATION_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read display token: %d", error); return error; } bool support = false; error = getDisplayDecorationSupport(displayToken, &support); reply->writeBool(support); return error; } case SET_FRAME_RATE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> binder; Loading
libs/gui/SurfaceComposerClient.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -2216,6 +2216,12 @@ status_t SurfaceComposerClient::setGlobalShadowSettings(const half4& ambientColo lightRadius); } bool SurfaceComposerClient::getDisplayDecorationSupport(const sp<IBinder>& displayToken) { bool support = false; ComposerService::getComposerService()->getDisplayDecorationSupport(displayToken, &support); return support; } int SurfaceComposerClient::getGPUContextPriority() { return ComposerService::getComposerService()->getGPUContextPriority(); } Loading