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

Commit 1863a962 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6282804 from 3bbfb422 to rvc-release

Change-Id: Ida297d79bbc1f0a60071b2642c69650c500785d3
parents 52122b7b 3bbfb422
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1729,6 +1729,8 @@ static void DumpstateTelephonyOnly(const std::string& calling_package) {
    RunDumpsys("DUMPSYS", {"netpolicy"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10));
    RunDumpsys("DUMPSYS", {"network_management"}, CommandOptions::WithTimeout(90).Build(),
               SEC_TO_MSEC(10));
    RunDumpsys("DUMPSYS", {"telephony.registry"}, CommandOptions::WithTimeout(90).Build(),
               SEC_TO_MSEC(10));
    if (include_sensitive_info) {
        // Contains raw IP addresses, omit from reports on user builds.
        RunDumpsys("DUMPSYS", {"netd"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10));
+7 −3
Original line number Diff line number Diff line
@@ -957,10 +957,14 @@ status_t GLESRenderEngine::drawLayers(const DisplaySettings& display,
        return NO_ERROR;
    }

    if (bufferFence.get() >= 0 && !waitFence(std::move(bufferFence))) {
    if (bufferFence.get() >= 0) {
        // Duplicate the fence for passing to waitFence.
        base::unique_fd bufferFenceDup(dup(bufferFence.get()));
        if (bufferFenceDup < 0 || !waitFence(std::move(bufferFenceDup))) {
            ATRACE_NAME("Waiting before draw");
            sync_wait(bufferFence.get(), -1);
        }
    }

    if (buffer == nullptr) {
        ALOGE("No output buffer provided. Aborting GPU composition.");
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ static inline void sBufferDescriptorInfo(std::string name, uint32_t width, uint3
    outDescriptorInfo->layerCount = layerCount;
    outDescriptorInfo->format = static_cast<hardware::graphics::common::V1_2::PixelFormat>(format);
    outDescriptorInfo->usage = usage;
    outDescriptorInfo->reservedSize = 0;
}

} // anonymous namespace
+33 −5
Original line number Diff line number Diff line
@@ -57,9 +57,12 @@ using ui::Dataspace;
 */

FramebufferSurface::FramebufferSurface(HWComposer& hwc, DisplayId displayId,
                                       const sp<IGraphicBufferConsumer>& consumer)
                                       const sp<IGraphicBufferConsumer>& consumer,
                                       uint32_t maxWidth, uint32_t maxHeight)
      : ConsumerBase(consumer),
        mDisplayId(displayId),
        mMaxWidth(maxWidth),
        mMaxHeight(maxHeight),
        mCurrentBufferSlot(-1),
        mCurrentBuffer(),
        mCurrentFence(Fence::NO_FENCE),
@@ -75,14 +78,16 @@ FramebufferSurface::FramebufferSurface(HWComposer& hwc, DisplayId displayId,
                                       GRALLOC_USAGE_HW_RENDER |
                                       GRALLOC_USAGE_HW_COMPOSER);
    const auto& activeConfig = mHwc.getActiveConfig(displayId);
    mConsumer->setDefaultBufferSize(activeConfig->getWidth(),
            activeConfig->getHeight());
    ui::Size limitedSize =
            limitFramebufferSize(activeConfig->getWidth(), activeConfig->getHeight());
    mConsumer->setDefaultBufferSize(limitedSize.width, limitedSize.height);
    mConsumer->setMaxAcquiredBufferCount(
            SurfaceFlinger::maxFrameBufferAcquiredBuffers - 1);
}

void FramebufferSurface::resizeBuffers(const uint32_t width, const uint32_t height) {
    mConsumer->setDefaultBufferSize(width, height);
void FramebufferSurface::resizeBuffers(uint32_t width, uint32_t height) {
    ui::Size limitedSize = limitFramebufferSize(width, height);
    mConsumer->setDefaultBufferSize(limitedSize.width, limitedSize.height);
}

status_t FramebufferSurface::beginFrame(bool /*mustRecompose*/) {
@@ -177,6 +182,29 @@ void FramebufferSurface::onFrameCommitted() {
    }
}

ui::Size FramebufferSurface::limitFramebufferSize(uint32_t width, uint32_t height) {
    // TODO(b/149495759): Use the ui::Size constructor once it no longer is broken.
    ui::Size framebufferSize;
    framebufferSize.width = width;
    framebufferSize.height = height;
    bool wasLimited = true;
    if (width > mMaxWidth && mMaxWidth != 0) {
        float aspectRatio = float(width) / float(height);
        framebufferSize.height = mMaxWidth / aspectRatio;
        framebufferSize.width = mMaxWidth;
        wasLimited = true;
    }
    if (height > mMaxHeight && mMaxHeight != 0) {
        float aspectRatio = float(width) / float(height);
        framebufferSize.height = mMaxHeight;
        framebufferSize.width = mMaxHeight * aspectRatio;
        wasLimited = true;
    }
    ALOGI_IF(wasLimited, "framebuffer size has been limited to [%dx%d] from [%dx%d]",
             framebufferSize.width, framebufferSize.height, width, height);
    return framebufferSize;
}

void FramebufferSurface::dumpAsString(String8& result) const {
    Mutex::Autolock lock(mMutex);
    result.appendFormat("  FramebufferSurface: dataspace: %s(%d)\n",
+15 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <compositionengine/DisplaySurface.h>
#include <compositionengine/impl/HwcBufferCache.h>
#include <gui/ConsumerBase.h>
#include <ui/Size.h>

#include "DisplayIdentification.h"

@@ -39,7 +40,8 @@ class HWComposer;
class FramebufferSurface : public ConsumerBase, public compositionengine::DisplaySurface {
public:
    FramebufferSurface(HWComposer& hwc, DisplayId displayId,
                       const sp<IGraphicBufferConsumer>& consumer);
                       const sp<IGraphicBufferConsumer>& consumer, uint32_t maxWidth,
                       uint32_t maxHeight);

    virtual status_t beginFrame(bool mustRecompose);
    virtual status_t prepareFrame(CompositionType compositionType);
@@ -47,7 +49,7 @@ public:
    virtual void onFrameCommitted();
    virtual void dumpAsString(String8& result) const;

    virtual void resizeBuffers(const uint32_t width, const uint32_t height);
    virtual void resizeBuffers(uint32_t width, uint32_t height);

    virtual const sp<Fence>& getClientTargetAcquireFence() const override;

@@ -58,6 +60,9 @@ private:

    virtual void dumpLocked(String8& result, const char* prefix) const;

    // Limits the width and height by the maximum width specified in the constructor.
    ui::Size limitFramebufferSize(uint32_t width, uint32_t height);

    // nextBuffer waits for and then latches the next buffer from the
    // BufferQueue and releases the previously latched buffer to the
    // BufferQueue.  The new buffer is returned in the 'buffer' argument.
@@ -66,6 +71,14 @@ private:

    const DisplayId mDisplayId;

    // Framebuffer size has a dimension limitation in pixels based on the graphics capabilities of
    // the device.
    const uint32_t mMaxWidth;

    // Framebuffer size has a dimension limitation in pixels based on the graphics capabilities of
    // the device.
    const uint32_t mMaxHeight;

    // mCurrentBufferIndex is the slot index of the current buffer or
    // INVALID_BUFFER_SLOT to indicate that either there is no current buffer
    // or the buffer is not associated with a slot.
Loading