summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordianlujitao <dianlujitao@lineageos.org>2020-05-25 18:23:49 +0800
committerdianlujitao <dianlujitao@lineageos.org>2020-05-25 18:23:49 +0800
commit69a8520c33d4de477f9579e53bb67398c73c4f0d (patch)
treef06494abaec4d940ac19f1d576ad0268511d71e8
parent1710e8f68eb64330703b3d68010c3cbeef5f7eb2 (diff)
downloadandroid_frameworks_native-69a8520c33d4de477f9579e53bb67398c73c4f0d.tar.gz
android_frameworks_native-69a8520c33d4de477f9579e53bb67398c73c4f0d.tar.bz2
android_frameworks_native-69a8520c33d4de477f9579e53bb67398c73c4f0d.zip
sf: Exclude VDS use of HWC on non-UM platforms
Change-Id: Ic0f314f4053628667a921951f610839f36a5079c
-rw-r--r--services/surfaceflinger/Android.bp9
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp16
2 files changed, 24 insertions, 1 deletions
diff --git a/services/surfaceflinger/Android.bp b/services/surfaceflinger/Android.bp
index 4d9188a48..37b11de07 100644
--- a/services/surfaceflinger/Android.bp
+++ b/services/surfaceflinger/Android.bp
@@ -71,8 +71,15 @@ cc_defaults {
"android.hardware.graphics.composer@2.1-command-buffer",
"android.hardware.graphics.composer@2.2-command-buffer",
"android.hardware.graphics.composer@2.3-command-buffer",
- "display_intf_headers",
],
+ product_variables: {
+ lineage: {
+ qcom_um_soong_namespace: {
+ cflags: ["-DQCOM_UM_FAMILY"],
+ header_libs: ["//%s:display_intf_headers"],
+ },
+ },
+ },
export_static_lib_headers: [
"libcompositionengine",
"librenderengine",
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 1264285df..8f3fb242d 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -120,7 +120,10 @@
#include <layerproto/LayerProtoParser.h>
#include "SurfaceFlingerProperties.h"
+
+#ifdef QCOM_UM_FAMILY
#include "gralloc_priv.h"
+#endif
namespace android {
@@ -2835,6 +2838,7 @@ void SurfaceFlinger::processDisplayChangesLocked() {
ALOGE_IF(status != NO_ERROR, "Unable to query format (%d)", status);
auto format = static_cast<ui::PixelFormat>(intFormat);
+#ifdef QCOM_UM_FAMILY
if (maxVirtualDisplaySize == 0 ||
((uint64_t)width <= maxVirtualDisplaySize &&
(uint64_t)height <= maxVirtualDisplaySize)) {
@@ -2847,6 +2851,10 @@ void SurfaceFlinger::processDisplayChangesLocked() {
getHwComposer().allocateVirtualDisplay(width, height, &format);
}
}
+#else
+ displayId =
+ getHwComposer().allocateVirtualDisplay(width, height, &format);
+#endif
}
// TODO: Plumb requested format back up to consumer
@@ -3534,12 +3542,14 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<DisplayDevice>& displayDevice,
}
case Hwc2::IComposerClient::Composition::CLIENT: {
renderengine::LayerSettings layerSettings;
+#ifdef QCOM_UM_FAMILY
if (displayDevice->isVirtual() &&
skipColorLayer(layer->getTypeId())) {
// We are not using h/w composer.
// Skip color (dim) layer for WFD direct streaming.
continue;
}
+#endif
bool prepared =
layer->prepareClientLayer(renderArea, clip, clearRegion,
supportProtectedContent, layerSettings);
@@ -6234,6 +6244,7 @@ void SurfaceFlinger::setAllowedDisplayConfigsInternal(const sp<DisplayDevice>& d
setPreferredDisplayConfig();
}
+#ifdef QCOM_UM_FAMILY
bool SurfaceFlinger::canAllocateHwcDisplayIdForVDS(uint64_t usage) {
uint64_t flag_mask_pvt_wfd = ~0;
uint64_t flag_mask_hw_video = ~0;
@@ -6251,6 +6262,11 @@ bool SurfaceFlinger::canAllocateHwcDisplayIdForVDS(uint64_t usage) {
return (allowHwcForVDS || ((usage & flag_mask_pvt_wfd) &&
(usage & flag_mask_hw_video)));
}
+#else
+bool SurfaceFlinger::canAllocateHwcDisplayIdForVDS(uint64_t) {
+ return true;
+}
+#endif
bool SurfaceFlinger::skipColorLayer(const char* layerType) {
return (sDirectStreaming && !strncmp(layerType, "ColorLayer", strlen("ColorLayer")));