Loading services/surfaceflinger/Layer.cpp +17 −5 Original line number Diff line number Diff line Loading @@ -719,9 +719,14 @@ std::vector<compositionengine::LayerFE::LayerSettings> Layer::prepareClientCompo Hwc2::IComposerClient::Composition Layer::getCompositionType( const sp<const DisplayDevice>& display) const { const auto outputLayer = findOutputLayerForDisplay(display); LOG_FATAL_IF(!outputLayer); return outputLayer->getState().hwc ? (*outputLayer->getState().hwc).hwcCompositionType : Hwc2::IComposerClient::Composition::CLIENT; if (outputLayer == nullptr) { return Hwc2::IComposerClient::Composition::INVALID; } if (outputLayer->getState().hwc) { return (*outputLayer->getState().hwc).hwcCompositionType; } else { return Hwc2::IComposerClient::Composition::CLIENT; } } bool Layer::getClearClientTarget(const sp<const DisplayDevice>& display) const { Loading Loading @@ -2052,13 +2057,20 @@ void Layer::setInputInfo(const InputWindowInfo& info) { setTransactionFlags(eTransactionNeeded); } LayerProto* Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags) const { LayerProto* Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags, const sp<const DisplayDevice>& device) const { LayerProto* layerProto = layersProto.add_layers(); writeToProtoDrawingState(layerProto, traceFlags); writeToProtoCommonState(layerProto, LayerVector::StateSet::Drawing, traceFlags); // Only populate for the primary display. if (device) { const Hwc2::IComposerClient::Composition compositionType = getCompositionType(device); layerProto->set_hwc_composition_type(static_cast<HwcCompositionType>(compositionType)); } for (const sp<Layer>& layer : mDrawingChildren) { layer->writeToProto(layersProto, traceFlags); layer->writeToProto(layersProto, traceFlags, device); } return layerProto; Loading services/surfaceflinger/Layer.h +2 −1 Original line number Diff line number Diff line Loading @@ -506,7 +506,8 @@ public: bool isRemovedFromCurrentState() const; LayerProto* writeToProto(LayersProto& layersProto, uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const; uint32_t traceFlags = SurfaceTracing::TRACE_ALL, const sp<const DisplayDevice>& device = nullptr) const; // Write states that are modified by the main thread. This includes drawing // state as well as buffer data. This should be called in the main or tracing Loading services/surfaceflinger/SurfaceFlinger.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -4450,13 +4450,20 @@ void SurfaceFlinger::dumpWideColorInfo(std::string& result) const { } LayersProto SurfaceFlinger::dumpDrawingStateProto(uint32_t traceFlags) const { Mutex::Autolock _l(mStateLock); const auto device = getDefaultDisplayDeviceLocked(); LayersProto layersProto; for (const sp<Layer>& layer : mDrawingState.layersSortedByZ) { layer->writeToProto(layersProto, traceFlags); layer->writeToProto(layersProto, traceFlags, device); } return layersProto; } void SurfaceFlinger::dumpHwc(std::string& result) const { getHwComposer().dump(result); } void SurfaceFlinger::dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t traceFlags) const { // Add a fake invisible root layer to the proto output and parent all the offscreen layers to // it. Loading @@ -4471,7 +4478,8 @@ void SurfaceFlinger::dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t rootProto->add_children(offscreenLayer->sequence); // Add layer LayerProto* layerProto = offscreenLayer->writeToProto(layersProto, traceFlags); LayerProto* layerProto = offscreenLayer->writeToProto(layersProto, traceFlags, nullptr /*device*/); layerProto->set_parent(offscreenRootLayerId); } } Loading services/surfaceflinger/SurfaceFlinger.h +2 −0 Original line number Diff line number Diff line Loading @@ -921,6 +921,8 @@ private: LayersProto dumpDrawingStateProto(uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const; void dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const; // Dumps state from HW Composer void dumpHwc(std::string& result) const; LayersProto dumpProtoFromMainThread(uint32_t traceFlags = SurfaceTracing::TRACE_ALL) EXCLUDES(mStateLock); void dumpOffscreenLayers(std::string& result) EXCLUDES(mStateLock); Loading services/surfaceflinger/SurfaceTracing.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,12 @@ LayersTraceProto SurfaceTracing::traceLayersLocked(const char* where) { mFlinger.dumpOffscreenLayersProto(layers); entry.mutable_layers()->Swap(&layers); if (mTraceFlags & SurfaceTracing::TRACE_HWC) { std::string hwcDump; mFlinger.dumpHwc(hwcDump); entry.set_hwc_blob(hwcDump); } return entry; } Loading Loading
services/surfaceflinger/Layer.cpp +17 −5 Original line number Diff line number Diff line Loading @@ -719,9 +719,14 @@ std::vector<compositionengine::LayerFE::LayerSettings> Layer::prepareClientCompo Hwc2::IComposerClient::Composition Layer::getCompositionType( const sp<const DisplayDevice>& display) const { const auto outputLayer = findOutputLayerForDisplay(display); LOG_FATAL_IF(!outputLayer); return outputLayer->getState().hwc ? (*outputLayer->getState().hwc).hwcCompositionType : Hwc2::IComposerClient::Composition::CLIENT; if (outputLayer == nullptr) { return Hwc2::IComposerClient::Composition::INVALID; } if (outputLayer->getState().hwc) { return (*outputLayer->getState().hwc).hwcCompositionType; } else { return Hwc2::IComposerClient::Composition::CLIENT; } } bool Layer::getClearClientTarget(const sp<const DisplayDevice>& display) const { Loading Loading @@ -2052,13 +2057,20 @@ void Layer::setInputInfo(const InputWindowInfo& info) { setTransactionFlags(eTransactionNeeded); } LayerProto* Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags) const { LayerProto* Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags, const sp<const DisplayDevice>& device) const { LayerProto* layerProto = layersProto.add_layers(); writeToProtoDrawingState(layerProto, traceFlags); writeToProtoCommonState(layerProto, LayerVector::StateSet::Drawing, traceFlags); // Only populate for the primary display. if (device) { const Hwc2::IComposerClient::Composition compositionType = getCompositionType(device); layerProto->set_hwc_composition_type(static_cast<HwcCompositionType>(compositionType)); } for (const sp<Layer>& layer : mDrawingChildren) { layer->writeToProto(layersProto, traceFlags); layer->writeToProto(layersProto, traceFlags, device); } return layerProto; Loading
services/surfaceflinger/Layer.h +2 −1 Original line number Diff line number Diff line Loading @@ -506,7 +506,8 @@ public: bool isRemovedFromCurrentState() const; LayerProto* writeToProto(LayersProto& layersProto, uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const; uint32_t traceFlags = SurfaceTracing::TRACE_ALL, const sp<const DisplayDevice>& device = nullptr) const; // Write states that are modified by the main thread. This includes drawing // state as well as buffer data. This should be called in the main or tracing Loading
services/surfaceflinger/SurfaceFlinger.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -4450,13 +4450,20 @@ void SurfaceFlinger::dumpWideColorInfo(std::string& result) const { } LayersProto SurfaceFlinger::dumpDrawingStateProto(uint32_t traceFlags) const { Mutex::Autolock _l(mStateLock); const auto device = getDefaultDisplayDeviceLocked(); LayersProto layersProto; for (const sp<Layer>& layer : mDrawingState.layersSortedByZ) { layer->writeToProto(layersProto, traceFlags); layer->writeToProto(layersProto, traceFlags, device); } return layersProto; } void SurfaceFlinger::dumpHwc(std::string& result) const { getHwComposer().dump(result); } void SurfaceFlinger::dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t traceFlags) const { // Add a fake invisible root layer to the proto output and parent all the offscreen layers to // it. Loading @@ -4471,7 +4478,8 @@ void SurfaceFlinger::dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t rootProto->add_children(offscreenLayer->sequence); // Add layer LayerProto* layerProto = offscreenLayer->writeToProto(layersProto, traceFlags); LayerProto* layerProto = offscreenLayer->writeToProto(layersProto, traceFlags, nullptr /*device*/); layerProto->set_parent(offscreenRootLayerId); } } Loading
services/surfaceflinger/SurfaceFlinger.h +2 −0 Original line number Diff line number Diff line Loading @@ -921,6 +921,8 @@ private: LayersProto dumpDrawingStateProto(uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const; void dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const; // Dumps state from HW Composer void dumpHwc(std::string& result) const; LayersProto dumpProtoFromMainThread(uint32_t traceFlags = SurfaceTracing::TRACE_ALL) EXCLUDES(mStateLock); void dumpOffscreenLayers(std::string& result) EXCLUDES(mStateLock); Loading
services/surfaceflinger/SurfaceTracing.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,12 @@ LayersTraceProto SurfaceTracing::traceLayersLocked(const char* where) { mFlinger.dumpOffscreenLayersProto(layers); entry.mutable_layers()->Swap(&layers); if (mTraceFlags & SurfaceTracing::TRACE_HWC) { std::string hwcDump; mFlinger.dumpHwc(hwcDump); entry.set_hwc_blob(hwcDump); } return entry; } Loading