summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorDileep Marchya <dmarchya@codeaurora.org>2015-09-02 18:49:21 -0700
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:22:28 -0600
commit24e0fdd93b8fedf65ae73d0e006abf0b64a1a7c2 (patch)
treee5a590893927da9ded663166ffe1a39b26f505c0 /services/surfaceflinger
parenta1288c979df92ab7b1a8cae7e0710cda3451c8df (diff)
downloadframeworks_native-24e0fdd93b8fedf65ae73d0e006abf0b64a1a7c2.zip
frameworks_native-24e0fdd93b8fedf65ae73d0e006abf0b64a1a7c2.tar.gz
frameworks_native-24e0fdd93b8fedf65ae73d0e006abf0b64a1a7c2.tar.bz2
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
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp9
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.h6
-rw-r--r--services/surfaceflinger/Layer.h2
-rw-r--r--services/surfaceflinger/LayerDim.cpp9
-rw-r--r--services/surfaceflinger/LayerDim.h2
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h1
6 files changed, 28 insertions, 1 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 84c6af9..8331828 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -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() {
@@ -1000,6 +1005,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) {
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
index d262f84..952635f 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.h
@@ -120,6 +120,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);
@@ -165,6 +168,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;
};
// ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 25437ac..910ac97 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -205,7 +205,7 @@ public:
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);
diff --git a/services/surfaceflinger/LayerDim.cpp b/services/surfaceflinger/LayerDim.cpp
index 14aa328..b8d549a 100644
--- a/services/surfaceflinger/LayerDim.cpp
+++ b/services/surfaceflinger/LayerDim.cpp
@@ -58,6 +58,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();
+ }
+}
// ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/LayerDim.h b/services/surfaceflinger/LayerDim.h
index a0cfca9..b66591b 100644
--- a/services/surfaceflinger/LayerDim.h
+++ b/services/surfaceflinger/LayerDim.h
@@ -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);
};
// ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index bb0bfc4..2c50432 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -140,6 +140,7 @@ private:
friend class Client;
friend class DisplayEventConnection;
friend class Layer;
+ friend class LayerDim;
friend class MonitoredProducer;
// This value is specified in number of frames. Log frame stats at most