summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayUtils.cpp
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-13 02:15:45 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-13 02:15:45 +0100
commitd3ad4f1e64dfe162c03fbbbe79c21c3c20641f18 (patch)
treea21f7d76365795800eebfd006d34803a9304e04c /services/surfaceflinger/DisplayUtils.cpp
parentb2381c3e4b90d845d9713b7b29d64317b7f21ce8 (diff)
parentb22bca465e55618a949d9cbdea665a1a3a831241 (diff)
downloadframeworks_native-d3ad4f1e64dfe162c03fbbbe79c21c3c20641f18.zip
frameworks_native-d3ad4f1e64dfe162c03fbbbe79c21c3c20641f18.tar.gz
frameworks_native-d3ad4f1e64dfe162c03fbbbe79c21c3c20641f18.tar.bz2
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_frameworks_native into replicant-6.0
Diffstat (limited to 'services/surfaceflinger/DisplayUtils.cpp')
-rw-r--r--services/surfaceflinger/DisplayUtils.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/services/surfaceflinger/DisplayUtils.cpp b/services/surfaceflinger/DisplayUtils.cpp
index a07e69e..e618e89 100644
--- a/services/surfaceflinger/DisplayUtils.cpp
+++ b/services/surfaceflinger/DisplayUtils.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015 - 2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -45,6 +45,10 @@
#include <ExSurfaceFlinger/ExHWComposer.h>
#include <ExSurfaceFlinger/ExVirtualDisplaySurface.h>
#include <gralloc_priv.h>
+#ifdef SDM_TARGET
+#include <qd_utils.h>
+#include <display_config.h>
+#endif
#endif
#include <dlfcn.h>
#include <cutils/properties.h>
@@ -176,8 +180,25 @@ bool DisplayUtils::canAllocateHwcDisplayIdForVDS(int usage) {
#ifdef QTI_BSP
#ifdef FORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
- // Reserve hardware acceleration for WFD use-case
- flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
+#ifdef SDM_TARGET
+ int hdmi_node = qdutils::getHDMINode();
+ if(hdmi_node == HWC_DISPLAY_PRIMARY) {
+ int active_config = qdutils::getActiveConfig(HWC_DISPLAY_PRIMARY);
+ if(active_config >= 0) {
+ qdutils::DisplayAttributes attr = qdutils::getDisplayAttributes(active_config,
+ HWC_DISPLAY_PRIMARY);
+ if(!attr.is_yuv) {
+ // Reserve hardware acceleration for WFD use-case
+ flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
+ }
+ }
+ } else {
+#endif
+ // Reserve hardware acceleration for WFD use-case
+ flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
+#ifdef SDM_TARGET
+ }
+#endif
#else
// Don't allocate HWC display unless we force HWC copy, otherwise
// incompatible buffers are sent to the media stack