Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e0ca948 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5698755 from 85eb8e18 to qt-qpr1-release

Change-Id: Ia806c1a4df3d081ff48657e1a3a0d904021c03d2
parents 95a0f08e 85eb8e18
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@

#include <memory>
#include <string>
#include <thread>

// TODO(b/37049319) Get this from a header once one exists
extern "C" {
@@ -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);
@@ -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,
+11 −1
Original line number Diff line number Diff line
@@ -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;
    }
@@ -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;
@@ -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;
}
+2 −1
Original line number Diff line number Diff line
@@ -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 };
+3 −1
Original line number Diff line number Diff line
@@ -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);
}

+2 −1
Original line number Diff line number Diff line
@@ -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