summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordianlujitao <dianlujitao@lineageos.org>2020-05-25 18:23:49 +0800
committerMichael Bestas <mkbestas@lineageos.org>2020-12-12 02:28:19 +0200
commitff2caa1755a75d235a5bc7768677355515b3c62b (patch)
treeed75d2457b0f6bf2db5d3c32593dc1f47a0dd3e4
parent23776d7412701826203b3f28386c778d8f430b5f (diff)
sf: Exclude VDS use of HWC on non-UM platforms
Author: Bruno Martins <bgcngm@gmail.com> Date: Wed Oct 14 23:45:14 2020 +0100 Edit: Adapt to new lineage soong config Change-Id: Ic0f314f4053628667a921951f610839f36a5079c
-rw-r--r--services/surfaceflinger/Android.bp6
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp15
2 files changed, 18 insertions, 3 deletions
diff --git a/services/surfaceflinger/Android.bp b/services/surfaceflinger/Android.bp
index c10d6a311f..5ec4e4dfdc 100644
--- a/services/surfaceflinger/Android.bp
+++ b/services/surfaceflinger/Android.bp
@@ -13,7 +13,10 @@ cc_defaults {
cc_defaults {
name: "libsurfaceflinger_defaults",
- defaults: ["surfaceflinger_defaults"],
+ defaults: [
+ "surfaceflinger_defaults",
+ "surfaceflinger_qcom_ext_defaults",
+ ],
cflags: [
"-DLOG_TAG=\"SurfaceFlinger\"",
"-DGL_GLEXT_PROTOTYPES",
@@ -79,7 +82,6 @@ cc_defaults {
"android.hardware.graphics.composer@2.2-command-buffer",
"android.hardware.graphics.composer@2.3-command-buffer",
"android.hardware.graphics.composer@2.4-command-buffer",
- "display_intf_headers",
],
export_static_lib_headers: [
"libcompositionengine",
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index c8ef1cc3d4..efb7a4c4fa 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -127,11 +127,13 @@
#include "android-base/parseint.h"
#include "android-base/stringprintf.h"
+#ifdef QCOM_UM_FAMILY
#if __has_include("QtiGralloc.h")
#include "QtiGralloc.h"
#else
#include "gralloc_priv.h"
#endif
+#endif
#define MAIN_THREAD ACQUIRE(mStateLock) RELEASE(mStateLock)
@@ -2584,7 +2586,11 @@ void SurfaceFlinger::processDisplayAdded(const wp<IBinder>& displayToken,
const DisplayDeviceState& state) {
int width = 0;
int height = 0;
+#ifdef QCOM_UM_FAMILY
bool canAllocateHwcForVDS = false;
+#else
+ bool canAllocateHwcForVDS = true;
+#endif
ui::PixelFormat pixelFormat = static_cast<ui::PixelFormat>(PIXEL_FORMAT_UNKNOWN);
if (state.physical) {
const auto& activeConfig =
@@ -2601,6 +2607,7 @@ void SurfaceFlinger::processDisplayAdded(const wp<IBinder>& displayToken,
status = state.surface->query(NATIVE_WINDOW_FORMAT, &intPixelFormat);
ALOGE_IF(status != NO_ERROR, "Unable to query format (%d)", status);
pixelFormat = static_cast<ui::PixelFormat>(intPixelFormat);
+#ifdef QCOM_UM_FAMILY
if (mUseHwcVirtualDisplays || getHwComposer().isUsingVrComposer()) {
if (maxVirtualDisplaySize == 0 ||
((uint64_t)width <= maxVirtualDisplaySize &&
@@ -2614,7 +2621,7 @@ void SurfaceFlinger::processDisplayAdded(const wp<IBinder>& displayToken,
}
}
}
-
+#endif
} else {
// Virtual displays without a surface are dormant:
// they have external state (layer stack, projection,
@@ -6078,6 +6085,7 @@ status_t SurfaceFlinger::setDesiredDisplayConfigSpecsInternal(
return NO_ERROR;
}
+#ifdef QCOM_UM_FAMILY
bool SurfaceFlinger::canAllocateHwcDisplayIdForVDS(uint64_t usage) {
uint64_t flag_mask_pvt_wfd = ~0;
uint64_t flag_mask_hw_video = ~0;
@@ -6091,6 +6099,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
status_t SurfaceFlinger::setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken,
int32_t defaultConfig,