|
From 31518ae60f839087b56d93063494f541c2ac0ef4 Mon Sep 17 00:00:00 2001 |
|
From: Shubhang <[email protected]> |
|
Date: Tue, 21 Jan 2014 23:27:53 +0530 |
|
Subject: [PATCH] I9082: fix hwc issues |
|
|
|
This is just a rebase on Carbon Kitkat |
|
Original patch for CM11- https://gist.github.com/pawitp/7891444 |
|
Credits to pawitp for the patch |
|
|
|
Change-Id: Ib6520123f1e7bcdcb2ec8c73fe1d98e85c26fd1d |
|
--- |
|
libs/binder/Parcel.cpp | 12 ++++++++++++ |
|
services/surfaceflinger/DisplayHardware/HWComposer.cpp | 5 +++++ |
|
services/surfaceflinger/Layer.cpp | 3 +++ |
|
services/surfaceflinger/SurfaceFlinger.cpp | 9 +++++++++ |
|
4 files changed, 29 insertions(+) |
|
|
|
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp |
|
index 38e019c..26e54f1 100644 |
|
--- a/libs/binder/Parcel.cpp |
|
+++ b/libs/binder/Parcel.cpp |
|
@@ -808,6 +808,12 @@ status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob) |
|
return status; |
|
} |
|
|
|
+extern "C" status_t _ZN7android6Parcel5writeERKNS0_26FlattenableHelperInterfaceE(void *parcel, void *val); |
|
+ |
|
+extern "C" status_t _ZN7android6Parcel5writeERKNS_11FlattenableE(void *parcel, void *val) { |
|
+ return _ZN7android6Parcel5writeERKNS0_26FlattenableHelperInterfaceE(parcel, val); |
|
+} |
|
+ |
|
status_t Parcel::write(const FlattenableHelperInterface& val) |
|
{ |
|
status_t err; |
|
@@ -1184,6 +1190,12 @@ status_t Parcel::readBlob(size_t len, ReadableBlob* outBlob) const |
|
return NO_ERROR; |
|
} |
|
|
|
+extern "C" status_t _ZNK7android6Parcel4readERNS0_26FlattenableHelperInterfaceE(void *parcel, void *val); |
|
+ |
|
+extern "C" status_t _ZNK7android6Parcel4readERNS_11FlattenableE(void *parcel, void *val) { |
|
+ return _ZNK7android6Parcel4readERNS0_26FlattenableHelperInterfaceE(parcel, val); |
|
+} |
|
+ |
|
status_t Parcel::read(FlattenableHelperInterface& val) const |
|
{ |
|
// size |
|
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp |
|
index 02c8f9b..dc14bdc 100644 |
|
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp |
|
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp |
|
@@ -1178,13 +1178,18 @@ public: |
|
//getLayer()->compositionType = HWC_FRAMEBUFFER; |
|
} |
|
virtual void setPlaneAlpha(uint8_t alpha) { |
|
+// CAPRI_HWC does not respect planeAlpha despite being v1.2 |
|
+#ifndef CAPRI_HWC |
|
if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_2)) { |
|
getLayer()->planeAlpha = alpha; |
|
} else { |
|
+#endif |
|
if (alpha < 0xFF) { |
|
getLayer()->flags |= HWC_SKIP_LAYER; |
|
} |
|
+#ifndef CAPRI_HWC |
|
} |
|
+#endif |
|
} |
|
virtual void setDefaultState() { |
|
hwc_layer_1_t* const l = getLayer(); |
|
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp |
|
index 75fca20..05aa131 100644 |
|
--- a/services/surfaceflinger/Layer.cpp |
|
+++ b/services/surfaceflinger/Layer.cpp |
|
@@ -1186,6 +1186,8 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const |
|
|
|
void Layer::updateTransformHint(const sp<const DisplayDevice>& hw) const { |
|
uint32_t orientation = 0; |
|
+// CAPRI_HWC has display problem in landscape mode when transform is used |
|
+#ifndef CAPRI_HWC |
|
if (!mFlinger->mDebugDisableTransformHint) { |
|
// The transform hint is used to improve performance, but we can |
|
// only have a single transform hint, it cannot |
|
@@ -1196,6 +1198,7 @@ void Layer::updateTransformHint(const sp<const DisplayDevice>& hw) const { |
|
orientation = 0; |
|
} |
|
} |
|
+#endif |
|
mSurfaceFlingerConsumer->setTransformHint(orientation); |
|
} |
|
|
|
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp |
|
index 339e798..ffe94a9 100644 |
|
--- a/services/surfaceflinger/SurfaceFlinger.cpp |
|
+++ b/services/surfaceflinger/SurfaceFlinger.cpp |
|
@@ -1108,6 +1108,7 @@ void SurfaceFlinger::setUpHWComposer() { |
|
sp<const DisplayDevice> hw(mDisplays[dpy]); |
|
const int32_t id = hw->getHwcDisplayId(); |
|
if (id >= 0) { |
|
+#ifdef QCOM_HARDWARE |
|
// Get the layers in the current drawying state |
|
const LayerVector& layers(mDrawingState.layersSortedByZ); |
|
bool freezeSurfacePresent = false; |
|
@@ -1127,6 +1128,7 @@ void SurfaceFlinger::setUpHWComposer() { |
|
} |
|
} |
|
} |
|
+#endif |
|
|
|
const Vector< sp<Layer> >& currentLayers( |
|
hw->getVisibleLayersSortedByZ()); |
|
@@ -1140,6 +1142,7 @@ void SurfaceFlinger::setUpHWComposer() { |
|
*/ |
|
const sp<Layer>& layer(currentLayers[i]); |
|
layer->setPerFrameData(hw, *cur); |
|
+#ifdef QCOM_HARDWARE |
|
if(freezeSurfacePresent) { |
|
// if freezeSurfacePresent, set ANIMATING flag |
|
cur->setAnimating(true); |
|
@@ -1160,6 +1163,7 @@ void SurfaceFlinger::setUpHWComposer() { |
|
} |
|
} |
|
} |
|
+#endif |
|
} |
|
} |
|
} |
|
@@ -3157,6 +3161,11 @@ status_t SurfaceFlinger::captureScreenImplLocked( |
|
{ |
|
ATRACE_CALL(); |
|
|
|
+// Rotation artifact problems when useReadPixels is false |
|
+#ifdef CAPRI_HWC |
|
+ useReadPixels = true; |
|
+#endif |
|
+ |
|
// get screen geometry |
|
const uint32_t hw_w = hw->getWidth(); |
|
const uint32_t hw_h = hw->getHeight(); |
|
-- |
|
1.8.5.2 |