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

Commit 6c9ed1ae authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Promotion of android-framework.lnx.2.0-00016.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1076967   Ia8af95d214ba72b5657f32f7827a1e6278629f17   HWC2: Use SolidColor composition for DimLayer
1070250   I187e1f869f17eeac7429cd566bf7bb8a8d4835ea   sf: Fix to allow hwc composition through property
1062200 1076967   I1c6a271f9a7b5d6eea9a9db61d971f262d0cfe84   SF: Fix a couple of Layer ref count issues
1076967   If2ee044411cb883e75e34b458be65cf4bf8d3b69   surfaceflinger: Compile QC addons with USE_HWC2
1076967   I7b7e3e3f7a918e74df0be27418196c81b4332564   HWC2: Hook up to BoardConfig variable
1076967   Ib1b5d81e42a63d0e65b189f7c6c62e661e0ab6ae   HWC2: Fix virtual displays
1074697   Iead2142a588e57f041a4778cb443aafaf06214f4   SurfaceFlinger: Use TARGET_OUT_HEADERS
1076967   Ib2f4889531556c7ab00e3b270319c321e9f32c84   HWC2: Clear transform for SolidColor layers
1078544   I89008f9c3f765b3db16d41dc40d5a0e79c56a737   surfaceflinger: Increase SurfaceFlinger dump buffer size
1076967   Iad87f02c3e44e86db43a15c258ee66b0cde14faa   HWC2: Skip validate/present if display is off
1076967   I570e6041ba72d64971bb6c364e8e7b6f84eeff08   HWC2: Don't set null handle for client layers
1076967   I1e41e5f548d4b8329590a082d9b69155ba365be9   Build SF executable with USE_HWC2 when needed
1076967   Ie966e37d95f53bcc050eef064d24bbe26748b7fd   HWC2: Kill logspam for non-HWC virtual displays

Change-Id: I2aeb5e07aea130730d5a158cbbbc77b13460415c
CRs-Fixed: 1062200, 1078544, 1076967, 1070250, 1074697
parents f203e3d3 bf981866
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -56,8 +56,7 @@ endif
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
#LOCAL_CFLAGS += -DENABLE_FENCE_TRACKING

USE_HWC2 := false
ifeq ($(USE_HWC2),true)
ifeq ($(TARGET_USES_HWC2),true)
    LOCAL_CFLAGS += -DUSE_HWC2
    LOCAL_SRC_FILES += \
        SurfaceFlinger.cpp \
@@ -141,8 +140,7 @@ ifeq ($(TARGET_USES_QCOM_BSP), true)
    LOCAL_C_INCLUDES += $(BOARD_DISPLAY_HAL)/libgralloc
    LOCAL_C_INCLUDES += $(BOARD_DISPLAY_HAL)/libqdutils
  else
    LOCAL_C_INCLUDES += hardware/qcom/display/libgralloc
    LOCAL_C_INCLUDES += hardware/qcom/display/libqdutils
    LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/qcom/display
  endif
    LOCAL_SHARED_LIBRARIES += libqdutils
    LOCAL_SHARED_LIBRARIES += libqdMetaData
@@ -171,6 +169,10 @@ ifneq ($(ENABLE_CPUSETS),)
    LOCAL_CFLAGS += -DENABLE_CPUSETS
endif

ifeq ($(TARGET_USES_HWC2),true)
    LOCAL_CFLAGS += -DUSE_HWC2
endif

LOCAL_SRC_FILES := \
    main_surfaceflinger.cpp

+1 −4
Original line number Diff line number Diff line
@@ -43,10 +43,7 @@ Client::~Client()
{
    const size_t count = mLayers.size();
    for (size_t i=0 ; i<count ; i++) {
        sp<Layer> layer(mLayers.valueAt(i).promote());
        if (layer != 0) {
            mFlinger->removeLayer(layer);
        }
        mFlinger->removeLayer(mLayers.valueAt(i));
    }
}

+16 −2
Original line number Diff line number Diff line
@@ -149,7 +149,12 @@ Device::~Device()
    }

    for (auto element : mDisplays) {
        auto display = element.second;
        auto display = element.second.lock();
        if (!display) {
            ALOGE("~Device: Found a display (%" PRId64 " that has already been"
                    " destroyed", element.first);
            continue;
        }

        DisplayType displayType = HWC2::DisplayType::Invalid;
        auto error = display->getType(&displayType);
@@ -208,6 +213,10 @@ Error Device::createVirtualDisplay(uint32_t width, uint32_t height,
    ALOGI("Created virtual display");
    *format = static_cast<android_pixel_format_t>(intFormat);
    *outDisplay = getDisplayById(displayId);
    if (!*outDisplay) {
        ALOGE("Failed to get display by id");
        return Error::BadDisplay;
    }
    (*outDisplay)->setVirtual();
    return Error::None;
}
@@ -289,7 +298,10 @@ void Device::callVsync(std::shared_ptr<Display> display, nsecs_t timestamp)

std::shared_ptr<Display> Device::getDisplayById(hwc2_display_t id) {
    if (mDisplays.count(id) != 0) {
        return mDisplays.at(id);
        auto strongDisplay = mDisplays[id].lock();
        ALOGE_IF(!strongDisplay, "Display %" PRId64 " is in mDisplays but is no"
                " longer alive", id);
        return strongDisplay;
    }

    auto display = std::make_shared<Display>(*this, id);
@@ -430,6 +442,7 @@ void Device::destroyVirtualDisplay(hwc2_display_t display)
    auto error = static_cast<Error>(intError);
    ALOGE_IF(error != Error::None, "destroyVirtualDisplay(%" PRIu64 ") failed:"
            " %s (%d)", display, to_string(error).c_str(), intError);
    mDisplays.erase(display);
}

// Display methods
@@ -810,6 +823,7 @@ Error Display::setOutputBuffer(const sp<GraphicBuffer>& buffer,
    auto handle = buffer->getNativeBuffer()->handle;
    int32_t intError = mDevice.mSetOutputBuffer(mDevice.mHwcDevice, mId, handle,
            fenceFd);
    close(fenceFd);
    return static_cast<Error>(intError);
}

+3 −2
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ public:
    // Other Device methods

    // This will create a Display if one is not found, but it will not be marked
    // as connected
    // as connected. This Display may be null if the display has been torn down
    // but has not been removed from the map yet.
    std::shared_ptr<Display> getDisplayById(hwc2_display_t id);

    bool hasCapability(HWC2::Capability capability) const;
@@ -181,7 +182,7 @@ private:
    HWC2_PFN_SET_LAYER_Z_ORDER mSetLayerZOrder;

    std::vector<Capability> mCapabilities;
    std::unordered_map<hwc2_display_t, std::shared_ptr<Display>> mDisplays;
    std::unordered_map<hwc2_display_t, std::weak_ptr<Display>> mDisplays;

    HotplugCallback mHotplug;
    std::vector<std::pair<std::shared_ptr<Display>, Connection>>
+14 −0
Original line number Diff line number Diff line
@@ -422,6 +422,10 @@ status_t HWComposer::prepare(DisplayDevice& displayDevice) {

    Mutex::Autolock _l(mDisplayLock);
    auto displayId = displayDevice.getHwcDisplayId();
    if (displayId == DisplayDevice::DISPLAY_ID_INVALID) {
        ALOGV("Skipping HWComposer prepare for non-HWC display");
        return NO_ERROR;
    }
    if (!isValidDisplay(displayId)) {
        return BAD_INDEX;
    }
@@ -515,6 +519,11 @@ status_t HWComposer::prepare(DisplayDevice& displayDevice) {
}

bool HWComposer::hasDeviceComposition(int32_t displayId) const {
    if (displayId == DisplayDevice::DISPLAY_ID_INVALID) {
        // Displays without a corresponding HWC display are never composed by
        // the device
        return false;
    }
    if (!isValidDisplay(displayId)) {
        ALOGE("hasDeviceComposition: Invalid display %d", displayId);
        return false;
@@ -523,6 +532,11 @@ bool HWComposer::hasDeviceComposition(int32_t displayId) const {
}

bool HWComposer::hasClientComposition(int32_t displayId) const {
    if (displayId == DisplayDevice::DISPLAY_ID_INVALID) {
        // Displays without a corresponding HWC display are always composed by
        // the client
        return true;
    }
    if (!isValidDisplay(displayId)) {
        ALOGE("hasClientComposition: Invalid display %d", displayId);
        return true;
Loading