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

Commit bac313c9 authored by Dileep Marchya's avatar Dileep Marchya Committed by Linux Build Service Account
Browse files

SurfaceFlinger: Add dim layer information into HWC layer.

- Set dim layer flag = 0x80000000 to send dim layer hint to HWC.
- Clear HWC_SKIP_LAYER flag when dim layer flag is set.

Change-Id: I56904c65fb487e6e89d4c057015443730d727299
parent 7952dcfc
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -190,6 +190,11 @@ HWComposer::HWComposer(
        // we don't have VSYNC support, we need to fake it
        mVSyncThread = new VSyncThread(*this);
    }

    mDimComp = 0;
    if (mHwc) {
        mHwc->query(mHwc, HWC_BACKGROUND_LAYER_SUPPORTED, &mDimComp);
    }
}

HWComposer::~HWComposer() {
@@ -1005,6 +1010,10 @@ public:
            getLayer()->flags &= ~HWC_SKIP_LAYER;
        }
    }
    virtual void setDim() {
        setSkip(false);
        getLayer()->flags |= 0x80000000;
    }
    virtual void setIsCursorLayerHint(bool isCursor) {
        if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_4)) {
            if (isCursor) {
+6 −0
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ public:
    // does this display have layers handled by GLES
    bool hasGlesComposition(int32_t id) const;

    // does this display support dim layer composition
    bool hasDimComposition() const { return (mDimComp == 1); }

    // get the releaseFence file descriptor for a display's framebuffer layer.
    // the release fence is only valid after commit()
    sp<Fence> getAndResetReleaseFence(int32_t id);
@@ -162,6 +165,7 @@ public:
        virtual sp<Fence> getAndResetReleaseFence() = 0;
        virtual void setDefaultState() = 0;
        virtual void setSkip(bool skip) = 0;
        virtual void setDim() = 0;
        virtual void setIsCursorLayerHint(bool isCursor = true) = 0;
        virtual void setBlending(uint32_t blending) = 0;
        virtual void setTransform(uint32_t transform) = 0;
@@ -379,6 +383,8 @@ private:

    // thread-safe
    mutable Mutex mEventControlLock;

    int mDimComp;
};

// ---------------------------------------------------------------------------
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ public:
#else
    void setGeometry(const sp<const DisplayDevice>& hw,
            HWComposer::HWCLayerInterface& layer);
    void setPerFrameData(const sp<const DisplayDevice>& hw,
    virtual void setPerFrameData(const sp<const DisplayDevice>& hw,
            HWComposer::HWCLayerInterface& layer);
    void setAcquireFence(const sp<const DisplayDevice>& hw,
            HWComposer::HWCLayerInterface& layer);
+9 −0
Original line number Diff line number Diff line
@@ -62,6 +62,15 @@ bool LayerDim::isVisible() const {
    return !(s.flags & layer_state_t::eLayerHidden) && s.alpha;
}

void LayerDim::setPerFrameData(const sp<const DisplayDevice>& hw,
        HWComposer::HWCLayerInterface& layer) {
  HWComposer& hwc = mFlinger->getHwComposer();

  Layer::setPerFrameData(hw, layer);
  if (hwc.hasDimComposition()) {
    layer.setDim();
  }
}

// ---------------------------------------------------------------------------

+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ public:
    virtual bool isSecure() const         { return false; }
    virtual bool isFixedSize() const      { return true; }
    virtual bool isVisible() const;
    virtual void setPerFrameData(const sp<const DisplayDevice>& hw,
            HWComposer::HWCLayerInterface& layer);
};

// ---------------------------------------------------------------------------
Loading