Merge branch 'LA.BF64.1.2.2_rb4.7' of git://codeaurora.org/platform/frameworks/native into cm-13.0

Change-Id: Ib29f744a0f7baac5d5ad8a7e9c5c14303b6aeec1
This commit is contained in:
Steve Kondik 2015-11-16 14:36:34 -08:00
commit 05e03ad508
7 changed files with 117 additions and 6 deletions

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2014, 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
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!-- Feature for devices with an ambient temperature sensor. -->
<permissions>
<feature name="android.hardware.sensor.ambient_temperature" />
</permissions>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2014, 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
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!-- Feature for devices with relative humidity sensor. -->
<permissions>
<feature name="android.hardware.sensor.relative_humidity" />
</permissions>

View File

@ -36,6 +36,9 @@
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
#ifdef QTI_BSP
#include <exhwcomposer_defs.h>
#endif
#include <android/configuration.h>
@ -711,13 +714,14 @@ status_t HWComposer::prepare() {
disp.hasFbComp = false;
disp.hasOvComp = false;
if (disp.list) {
for (size_t i=0 ; i<disp.list->numHwLayers ; i++) {
hwc_layer_1_t& l = disp.list->hwLayers[i];
for (size_t j=0 ; j<disp.list->numHwLayers ; j++) {
hwc_layer_1_t& l = disp.list->hwLayers[j];
//ALOGD("prepare: %d, type=%d, handle=%p",
// i, l.compositionType, l.handle);
if (l.flags & HWC_SKIP_LAYER) {
if ((i == DisplayDevice::DISPLAY_PRIMARY) &&
l.flags & HWC_SKIP_LAYER) {
l.compositionType = HWC_FRAMEBUFFER;
}
if (l.compositionType == HWC_FRAMEBUFFER) {
@ -1006,6 +1010,17 @@ public:
}
}
}
virtual void setAnimating(bool animating) {
if (animating) {
#ifdef QTI_BSP
getLayer()->flags |= HWC_SCREENSHOT_ANIMATOR_LAYER;
#endif
} else {
#ifdef QTI_BSP
getLayer()->flags &= ~HWC_SCREENSHOT_ANIMATOR_LAYER;
#endif
}
}
virtual void setDefaultState() {
hwc_layer_1_t* const l = getLayer();
l->compositionType = HWC_FRAMEBUFFER;

View File

@ -181,6 +181,7 @@ public:
virtual void setAcquireFenceFd(int fenceFd) = 0;
virtual void setPlaneAlpha(uint8_t alpha) = 0;
virtual void onDisplayed() = 0;
virtual void setAnimating(bool animating)= 0;
};
/*

View File

@ -44,6 +44,7 @@
#include <ExLayer.h>
#include <DisplayHardware/ExHWComposer.h>
#include <DisplayHardware/ExVirtualDisplaySurface.h>
#include <gralloc_priv.h>
#endif
#include <dlfcn.h>
#include <cutils/properties.h>
@ -169,5 +170,17 @@ bool DisplayUtils::createV4L2BasedVirtualDisplay(HWComposer* hwc, int32_t &hwcDi
return false;
}
bool DisplayUtils::canAllocateHwcDisplayIdForVDS(int usage) {
// on AOSP builds with QTI_BSP disabled, we should allocate hwc display id for virtual display
int flag_mask = 0xffffffff;
#if QTI_BSP
// Reserve hardware acceleration for WFD use-case
flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
#endif
return (usage & flag_mask);
}
}; // namespace android

View File

@ -61,6 +61,7 @@ class DisplayUtils {
sp<IGraphicBufferProducer> &producer, sp<IGraphicBufferProducer> bqProducer,
sp<IGraphicBufferConsumer> bqConsumer, String8 currentStateDisplayName,
bool currentStateIsSecure, int currentStateType);
bool canAllocateHwcDisplayIdForVDS(int usage);
DisplayUtils();
private:
static DisplayUtils* sDisplayUtils;

View File

@ -1478,6 +1478,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
if (state.surface != NULL) {
int width = 0;
DisplayUtils* displayUtils = DisplayUtils::getInstance();
int status = state.surface->query(
NATIVE_WINDOW_WIDTH, &width);
ALOGE_IF(status != NO_ERROR,
@ -1490,11 +1491,19 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
if (MAX_VIRTUAL_DISPLAY_DIMENSION == 0 ||
(width <= MAX_VIRTUAL_DISPLAY_DIMENSION &&
height <= MAX_VIRTUAL_DISPLAY_DIMENSION)) {
hwcDisplayId = allocateHwcDisplayId(state.type);
int usage = 0;
status = state.surface->query(
NATIVE_WINDOW_CONSUMER_USAGE_BITS, &usage);
ALOGW_IF(status != NO_ERROR,
"Unable to query usage (%d)", status);
if ( (status == NO_ERROR) &&
displayUtils->canAllocateHwcDisplayIdForVDS(usage)) {
hwcDisplayId = allocateHwcDisplayId(state.type);
}
}
DisplayUtils::getInstance()->initVDSInstance(mHwc, hwcDisplayId,
state.surface, dispSurface, producer, bqProducer, bqConsumer,
displayUtils->initVDSInstance(mHwc, hwcDisplayId, state.surface,
dispSurface, producer, bqProducer, bqConsumer,
state.displayName, state.isSecure, state.type);
}