Loading libs/graphicsenv/GraphicsEnv.cpp +15 −11 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ #include <memory> #include <string> #include <thread> // TODO(b/37049319) Get this from a header once one exists extern "C" { Loading Loading @@ -163,6 +164,7 @@ void GraphicsEnv::setDriverPathAndSphalLibraries(const std::string path, void GraphicsEnv::hintActivityLaunch() { ATRACE_CALL(); std::thread trySendGpuStatsThread([this]() { // If there's already graphics driver preloaded in the process, just send // the stats info to GpuStats directly through async binder. std::lock_guard<std::mutex> lock(mStatsLock); Loading @@ -174,6 +176,8 @@ void GraphicsEnv::hintActivityLaunch() { mGpuStats.vkDriverToSend = false; sendGpuStatsLocked(GraphicsEnv::Api::API_VK, true, mGpuStats.vkDriverLoadingTime); } }); trySendGpuStatsThread.detach(); } void GraphicsEnv::setGpuStats(const std::string& driverPackageName, Loading libs/gui/Surface.cpp +11 −1 Original line number Diff line number Diff line Loading @@ -1920,7 +1920,8 @@ status_t Surface::getAndFlushRemovedBuffers(std::vector<sp<GraphicBuffer>>* out) return OK; } status_t Surface::attachAndQueueBuffer(Surface* surface, sp<GraphicBuffer> buffer) { status_t Surface::attachAndQueueBufferWithDataspace(Surface* surface, sp<GraphicBuffer> buffer, Dataspace dataspace) { if (buffer == nullptr) { return BAD_VALUE; } Loading @@ -1929,6 +1930,11 @@ status_t Surface::attachAndQueueBuffer(Surface* surface, sp<GraphicBuffer> buffe if (err != OK) { return err; } ui::Dataspace tmpDataspace = surface->getBuffersDataSpace(); err = surface->setBuffersDataSpace(dataspace); if (err != OK) { return err; } err = surface->attachBuffer(buffer->getNativeBuffer()); if (err != OK) { return err; Loading @@ -1937,6 +1943,10 @@ status_t Surface::attachAndQueueBuffer(Surface* surface, sp<GraphicBuffer> buffe if (err != OK) { return err; } err = surface->setBuffersDataSpace(tmpDataspace); if (err != OK) { return err; } err = surface->disconnect(NATIVE_WINDOW_API_CPU); return err; } Loading libs/gui/include/gui/Surface.h +2 −1 Original line number Diff line number Diff line Loading @@ -292,7 +292,8 @@ public: ui::Dataspace getBuffersDataSpace(); static status_t attachAndQueueBuffer(Surface* surface, sp<GraphicBuffer> buffer); static status_t attachAndQueueBufferWithDataspace(Surface* surface, sp<GraphicBuffer> buffer, ui::Dataspace dataspace); protected: enum { NUM_BUFFER_SLOTS = BufferQueueDefs::NUM_BUFFER_SLOTS }; Loading services/surfaceflinger/Scheduler/LayerHistory.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -46,11 +46,13 @@ LayerHistory::LayerHistory() { LayerHistory::~LayerHistory() = default; std::unique_ptr<LayerHistory::LayerHandle> LayerHistory::createLayer(const std::string name, float minRefreshRate, float maxRefreshRate) { const int64_t id = sNextId++; std::lock_guard lock(mLock); mInactiveLayerInfos.emplace(id, std::make_shared<LayerInfo>(name, maxRefreshRate)); mInactiveLayerInfos.emplace(id, std::make_shared<LayerInfo>(name, minRefreshRate, maxRefreshRate)); return std::make_unique<LayerHistory::LayerHandle>(*this, id); } Loading services/surfaceflinger/Scheduler/LayerHistory.h +2 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,8 @@ public: ~LayerHistory(); // When the layer is first created, register it. std::unique_ptr<LayerHandle> createLayer(const std::string name, float maxRefreshRate); std::unique_ptr<LayerHandle> createLayer(const std::string name, float minRefreshRate, float maxRefreshRate); // Method for inserting layers and their requested present time into the unordered map. void insert(const std::unique_ptr<LayerHandle>& layerHandle, nsecs_t presentTime, bool isHdr); Loading Loading
libs/graphicsenv/GraphicsEnv.cpp +15 −11 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ #include <memory> #include <string> #include <thread> // TODO(b/37049319) Get this from a header once one exists extern "C" { Loading Loading @@ -163,6 +164,7 @@ void GraphicsEnv::setDriverPathAndSphalLibraries(const std::string path, void GraphicsEnv::hintActivityLaunch() { ATRACE_CALL(); std::thread trySendGpuStatsThread([this]() { // If there's already graphics driver preloaded in the process, just send // the stats info to GpuStats directly through async binder. std::lock_guard<std::mutex> lock(mStatsLock); Loading @@ -174,6 +176,8 @@ void GraphicsEnv::hintActivityLaunch() { mGpuStats.vkDriverToSend = false; sendGpuStatsLocked(GraphicsEnv::Api::API_VK, true, mGpuStats.vkDriverLoadingTime); } }); trySendGpuStatsThread.detach(); } void GraphicsEnv::setGpuStats(const std::string& driverPackageName, Loading
libs/gui/Surface.cpp +11 −1 Original line number Diff line number Diff line Loading @@ -1920,7 +1920,8 @@ status_t Surface::getAndFlushRemovedBuffers(std::vector<sp<GraphicBuffer>>* out) return OK; } status_t Surface::attachAndQueueBuffer(Surface* surface, sp<GraphicBuffer> buffer) { status_t Surface::attachAndQueueBufferWithDataspace(Surface* surface, sp<GraphicBuffer> buffer, Dataspace dataspace) { if (buffer == nullptr) { return BAD_VALUE; } Loading @@ -1929,6 +1930,11 @@ status_t Surface::attachAndQueueBuffer(Surface* surface, sp<GraphicBuffer> buffe if (err != OK) { return err; } ui::Dataspace tmpDataspace = surface->getBuffersDataSpace(); err = surface->setBuffersDataSpace(dataspace); if (err != OK) { return err; } err = surface->attachBuffer(buffer->getNativeBuffer()); if (err != OK) { return err; Loading @@ -1937,6 +1943,10 @@ status_t Surface::attachAndQueueBuffer(Surface* surface, sp<GraphicBuffer> buffe if (err != OK) { return err; } err = surface->setBuffersDataSpace(tmpDataspace); if (err != OK) { return err; } err = surface->disconnect(NATIVE_WINDOW_API_CPU); return err; } Loading
libs/gui/include/gui/Surface.h +2 −1 Original line number Diff line number Diff line Loading @@ -292,7 +292,8 @@ public: ui::Dataspace getBuffersDataSpace(); static status_t attachAndQueueBuffer(Surface* surface, sp<GraphicBuffer> buffer); static status_t attachAndQueueBufferWithDataspace(Surface* surface, sp<GraphicBuffer> buffer, ui::Dataspace dataspace); protected: enum { NUM_BUFFER_SLOTS = BufferQueueDefs::NUM_BUFFER_SLOTS }; Loading
services/surfaceflinger/Scheduler/LayerHistory.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -46,11 +46,13 @@ LayerHistory::LayerHistory() { LayerHistory::~LayerHistory() = default; std::unique_ptr<LayerHistory::LayerHandle> LayerHistory::createLayer(const std::string name, float minRefreshRate, float maxRefreshRate) { const int64_t id = sNextId++; std::lock_guard lock(mLock); mInactiveLayerInfos.emplace(id, std::make_shared<LayerInfo>(name, maxRefreshRate)); mInactiveLayerInfos.emplace(id, std::make_shared<LayerInfo>(name, minRefreshRate, maxRefreshRate)); return std::make_unique<LayerHistory::LayerHandle>(*this, id); } Loading
services/surfaceflinger/Scheduler/LayerHistory.h +2 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,8 @@ public: ~LayerHistory(); // When the layer is first created, register it. std::unique_ptr<LayerHandle> createLayer(const std::string name, float maxRefreshRate); std::unique_ptr<LayerHandle> createLayer(const std::string name, float minRefreshRate, float maxRefreshRate); // Method for inserting layers and their requested present time into the unordered map. void insert(const std::unique_ptr<LayerHandle>& layerHandle, nsecs_t presentTime, bool isHdr); Loading