Merge "gralloc: Do not set ION_SECURE for non-contiguous heaps"
diff --git a/libcopybit/copybit_priv.h b/libcopybit/copybit_priv.h
index fd1b27e..68dfac4 100644
--- a/libcopybit/copybit_priv.h
+++ b/libcopybit/copybit_priv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libcopybit/software_converter.cpp b/libcopybit/software_converter.cpp
index ec0f271..e26b795 100644
--- a/libcopybit/software_converter.cpp
+++ b/libcopybit/software_converter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libcopybit/software_converter.h b/libcopybit/software_converter.h
index 54b503d..6e53e16 100644
--- a/libcopybit/software_converter.h
+++ b/libcopybit/software_converter.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libexternal/external.cpp b/libexternal/external.cpp
index b721195..3ae8c4d 100644
--- a/libexternal/external.cpp
+++ b/libexternal/external.cpp
@@ -85,6 +85,7 @@
openFrameBuffer(mHdmiFbNum);
if(mFd == -1)
return -1;
+ readCEUnderscanInfo();
readResolution();
// TODO: Move this to activate
/* Used for changing the resolution
@@ -167,7 +168,7 @@
ExternalDisplay::ExternalDisplay(hwc_context_t* ctx):mFd(-1),
mCurrentMode(-1), mConnected(0), mConnectedFbNum(0), mModeCount(0),
- mHwcContext(ctx), mHdmiFbNum(-1), mWfdFbNum(-1)
+ mUnderscanSupported(false), mHwcContext(ctx), mHdmiFbNum(-1), mWfdFbNum(-1)
{
memset(&mVInfo, 0, sizeof(mVInfo));
//Determine the fb index for external display devices.
@@ -193,7 +194,12 @@
void ExternalDisplay::setActionSafeDimension(int w, int h) {
ALOGD_IF(DEBUG,"ActionSafe w=%d h=%d", w, h);
Mutex::Autolock lock(mExtDispLock);
- overlay::utils::ActionSafe::getInstance()->setDimension(w, h);
+ char actionsafeWidth[PROPERTY_VALUE_MAX];
+ char actionsafeHeight[PROPERTY_VALUE_MAX];
+ sprintf(actionsafeWidth, "%d", w);
+ property_set("hw.actionsafe.width", actionsafeWidth);
+ sprintf(actionsafeHeight, "%d", h);
+ property_set("hw.actionsafe.height", actionsafeHeight);
setExternalDisplay(true, mHdmiFbNum);
}
@@ -210,6 +216,75 @@
}
}
+void ExternalDisplay::readCEUnderscanInfo()
+{
+ int hdmiScanInfoFile = -1;
+ int len = -1;
+ char scanInfo[17];
+ char *ce_info_str = NULL;
+ const char token[] = ", \n";
+ int ce_info = -1;
+ char sysFsScanInfoFilePath[128];
+ sprintf(sysFsScanInfoFilePath, "/sys/devices/virtual/graphics/fb%d/"
+ "scan_info", mHdmiFbNum);
+
+ memset(scanInfo, 0, sizeof(scanInfo));
+ hdmiScanInfoFile = open(sysFsScanInfoFilePath, O_RDONLY, 0);
+ if (hdmiScanInfoFile < 0) {
+ ALOGD_IF(DEBUG, "%s: scan_info file '%s' not found",
+ __FUNCTION__, sysFsScanInfoFilePath);
+ return;
+ } else {
+ len = read(hdmiScanInfoFile, scanInfo, sizeof(scanInfo)-1);
+ ALOGD("%s: Scan Info string: %s length = %d",
+ __FUNCTION__, scanInfo, len);
+ if (len <= 0) {
+ close(hdmiScanInfoFile);
+ ALOGE("%s: Scan Info file empty '%s'",
+ __FUNCTION__, sysFsScanInfoFilePath);
+ return;
+ }
+ scanInfo[len] = '\0'; /* null terminate the string */
+ }
+ close(hdmiScanInfoFile);
+
+ /*
+ * The scan_info contains the three fields
+ * PT - preferred video format
+ * IT - video format
+ * CE video format - containing the underscan support information
+ */
+
+ /* PT */
+ ce_info_str = strtok(scanInfo, token);
+ if (ce_info_str) {
+ /* IT */
+ ce_info_str = strtok(NULL, token);
+ if (ce_info_str) {
+ /* CE */
+ ce_info_str = strtok(NULL, token);
+ if (ce_info_str)
+ ce_info = atoi(ce_info_str);
+ }
+ }
+
+ if (ce_info_str) {
+ // ce_info contains the underscan information
+ if (ce_info == EXT_SCAN_ALWAYS_UNDERSCANED ||
+ ce_info == EXT_SCAN_BOTH_SUPPORTED)
+ // if TV supported underscan, then driver will always underscan
+ // hence no need to apply action safe rectangle
+ mUnderscanSupported = true;
+ } else {
+ ALOGE("%s: scan_info string error", __FUNCTION__);
+ }
+
+ // Store underscan support info in a system property
+ const char* prop = (mUnderscanSupported) ? "1" : "0";
+ property_set("hw.underscan_supported", prop);
+ return;
+}
+
ExternalDisplay::~ExternalDisplay()
{
closeFrameBuffer();
@@ -393,6 +468,10 @@
memset(mEDIDModes, 0, sizeof(mEDIDModes));
mModeCount = 0;
mCurrentMode = -1;
+ mUnderscanSupported = false;
+ // Reset the underscan supported system property
+ const char* prop = "0";
+ property_set("hw.underscan_supported", prop);
}
int ExternalDisplay::getModeOrder(int mode)
@@ -528,16 +607,10 @@
mode->set_info(mVInfo);
ALOGD_IF(DEBUG, "%s: SET Info<ID=%d => Info<ID=%d %dx %d"
"(%d,%d,%d), (%d,%d,%d) %dMHz>", __FUNCTION__, ID,
- mVInfo.reserved[3], mVInfo.xres, mVInfo.yres,
+ mode->video_format, mVInfo.xres, mVInfo.yres,
mVInfo.right_margin, mVInfo.hsync_len, mVInfo.left_margin,
mVInfo.lower_margin, mVInfo.vsync_len, mVInfo.upper_margin,
mVInfo.pixclock/1000/1000);
- mVInfo.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_ALL | FB_ACTIVATE_FORCE;
- ret = ioctl(mFd, FBIOPUT_VSCREENINFO, &mVInfo);
- if(ret < 0) {
- ALOGD("In %s: FBIOPUT_VSCREENINFO failed Err Str = %s",
- __FUNCTION__, strerror(errno));
- }
#ifdef FB_METADATA_VIDEO_INFO_CODE_SUPPORT
struct msmfb_metadata metadata;
memset(&metadata, 0 , sizeof(metadata));
@@ -548,6 +621,12 @@
__FUNCTION__, strerror(errno));
}
#endif
+ mVInfo.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_ALL | FB_ACTIVATE_FORCE;
+ ret = ioctl(mFd, FBIOPUT_VSCREENINFO, &mVInfo);
+ if(ret < 0) {
+ ALOGD("In %s: FBIOPUT_VSCREENINFO failed Err Str = %s",
+ __FUNCTION__, strerror(errno));
+ }
mCurrentMode = ID;
}
}
diff --git a/libexternal/external.h b/libexternal/external.h
index d85ce44..baf3598 100644
--- a/libexternal/external.h
+++ b/libexternal/external.h
@@ -28,6 +28,13 @@
namespace qhwc {
+//Type of scanning of EDID(Video Capability Data Block)
+enum external_scansupport_type {
+ EXT_SCAN_NOT_SUPPORTED = 0,
+ EXT_SCAN_ALWAYS_OVERSCANED = 1,
+ EXT_SCAN_ALWAYS_UNDERSCANED = 2,
+ EXT_SCAN_BOTH_SUPPORTED = 3
+};
class ExternalDisplay
{
@@ -36,6 +43,7 @@
~ExternalDisplay();
int getModeCount() const;
void getEDIDModes(int *out) const;
+ bool isCEUnderscanSupported() { return mUnderscanSupported; }
void setExternalDisplay(bool connected, int extFbNum = 0);
bool isExternalConnected() { return mConnected;};
bool post();
@@ -46,6 +54,7 @@
void processUEventOffline(const char *str);
private:
+ void readCEUnderscanInfo();
bool readResolution();
int parseResolution(char* edidStr, int* edidModes);
void setResolution(int ID);
@@ -78,6 +87,7 @@
char mEDIDs[128];
int mEDIDModes[64];
int mModeCount;
+ bool mUnderscanSupported;
hwc_context_t *mHwcContext;
fb_var_screeninfo mVInfo;
int mHdmiFbNum;
diff --git a/libgenlock/genlock.cpp b/libgenlock/genlock.cpp
index 344cbaa..6f4ec6c 100644
--- a/libgenlock/genlock.cpp
+++ b/libgenlock/genlock.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libgenlock/genlock.h b/libgenlock/genlock.h
index 1976c0d..222f2a7 100644
--- a/libgenlock/genlock.h
+++ b/libgenlock/genlock.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index f680c67..6003688 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libgralloc/alloc_controller.h b/libgralloc/alloc_controller.h
index f04917a..5fe81fa 100644
--- a/libgralloc/alloc_controller.h
+++ b/libgralloc/alloc_controller.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libgralloc/fb_priv.h b/libgralloc/fb_priv.h
index 9b08dd5..b096304 100644
--- a/libgralloc/fb_priv.h
+++ b/libgralloc/fb_priv.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp
index 961d2b6..45a2749 100644
--- a/libgralloc/framebuffer.cpp
+++ b/libgralloc/framebuffer.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (c) 2010-2012 Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2012 The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp
index 291f564..3bacdbf 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (c) 2011-2012 Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012 The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libgralloc/gpu.h b/libgralloc/gpu.h
index 2920d5f..2986984 100644
--- a/libgralloc/gpu.h
+++ b/libgralloc/gpu.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libgralloc/gr.h b/libgralloc/gr.h
index b330da9..cee47de 100644
--- a/libgralloc/gr.h
+++ b/libgralloc/gr.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libgralloc/gralloc.cpp b/libgralloc/gralloc.cpp
index 7924ae3..3bb5533 100644
--- a/libgralloc/gralloc.cpp
+++ b/libgralloc/gralloc.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008, The Android Open Source Project
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libgralloc/gralloc_priv.h b/libgralloc/gralloc_priv.h
index dc755cb..ea3fcdc 100644
--- a/libgralloc/gralloc_priv.h
+++ b/libgralloc/gralloc_priv.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libgralloc/ionalloc.cpp b/libgralloc/ionalloc.cpp
index 8cee7fd..7aec73f 100644
--- a/libgralloc/ionalloc.cpp
+++ b/libgralloc/ionalloc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libgralloc/ionalloc.h b/libgralloc/ionalloc.h
index 58a490e..7a11a34 100644
--- a/libgralloc/ionalloc.h
+++ b/libgralloc/ionalloc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libgralloc/mapper.cpp b/libgralloc/mapper.cpp
index b3e371a..b8e1526 100644
--- a/libgralloc/mapper.cpp
+++ b/libgralloc/mapper.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libgralloc/memalloc.h b/libgralloc/memalloc.h
index af509fb..73ac652 100644
--- a/libgralloc/memalloc.h
+++ b/libgralloc/memalloc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index 18f75eb..a0dbbe3 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -104,6 +104,9 @@
displayFrame.top,
displayFrame.right - displayFrame.left,
displayFrame.bottom - displayFrame.top);
+ // Calculate the actionsafe dimensions for External(dpy = 1 or 2)
+ if(mDpy)
+ getActionSafePosition(ctx, mDpy, dpos.x, dpos.y, dpos.w, dpos.h);
ov.setPosition(dpos, dest);
ret = true;
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index ca3c4b5..760b134 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -258,7 +258,7 @@
dst.right > hw_w || dst.bottom > hw_h) {
ALOGD_IF(isDebug(),"%s: Destination has negative coordinates",
__FUNCTION__);
- qhwc::calculate_crop_rects(crop, dst, hw_w, hw_h, 0);
+ qhwc::calculate_crop_rects(crop, dst, hw_w, hw_h, layer->transform);
//Update calulated width and height
crop_w = crop.right - crop.left;
diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h
index 4dc5878..48c3779 100644
--- a/libhwcomposer/hwc_mdpcomp.h
+++ b/libhwcomposer/hwc_mdpcomp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (C) 2012, The Linux Foundation. All rights reserved.
* Not a Contribution, Apache license notifications and license are retained
* for attribution purposes only.
*
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index e1f413c..093c0b3 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -148,6 +148,55 @@
va_end(varargs);
}
+/* Calculates the destination position based on the action safe rectangle */
+void getActionSafePosition(hwc_context_t *ctx, int dpy, uint32_t& x,
+ uint32_t& y, uint32_t& w, uint32_t& h) {
+
+ // if external supports underscan, do nothing
+ // it will be taken care in the driver
+ if(ctx->mExtDisplay->isCEUnderscanSupported())
+ return;
+
+ float wRatio = 1.0;
+ float hRatio = 1.0;
+ float xRatio = 1.0;
+ float yRatio = 1.0;
+
+ float fbWidth = ctx->dpyAttr[dpy].xres;
+ float fbHeight = ctx->dpyAttr[dpy].yres;
+
+ float asX = 0;
+ float asY = 0;
+ float asW = fbWidth;
+ float asH= fbHeight;
+ char value[PROPERTY_VALUE_MAX];
+
+ // Apply action safe parameters
+ property_get("hw.actionsafe.width", value, "0");
+ int asWidthRatio = atoi(value);
+ property_get("hw.actionsafe.height", value, "0");
+ int asHeightRatio = atoi(value);
+ // based on the action safe ratio, get the Action safe rectangle
+ asW = fbWidth * (1.0f - asWidthRatio / 100.0f);
+ asH = fbHeight * (1.0f - asHeightRatio / 100.0f);
+ asX = (fbWidth - asW) / 2;
+ asY = (fbHeight - asH) / 2;
+
+ // calculate the position ratio
+ xRatio = (float)x/fbWidth;
+ yRatio = (float)y/fbHeight;
+ wRatio = (float)w/fbWidth;
+ hRatio = (float)h/fbHeight;
+
+ //Calculate the position...
+ x = (xRatio * asW) + asX;
+ y = (yRatio * asH) + asY;
+ w = (wRatio * asW);
+ h = (hRatio * asH);
+
+ return;
+}
+
static inline bool isAlphaScaled(hwc_layer_1_t const* layer) {
int dst_w, dst_h, src_w, src_h;
@@ -188,16 +237,14 @@
//We disregard FB being skip for now! so the else if
} else if (isSkipLayer(&list->hwLayers[i])) {
ctx->listStats[dpy].skipCount++;
- }
-
- if(!ctx->listStats[dpy].needsAlphaScale)
- ctx->listStats[dpy].needsAlphaScale = isAlphaScaled(layer);
-
- if (UNLIKELY(isYuvBuffer(hnd))) {
+ } else if (UNLIKELY(isYuvBuffer(hnd))) {
int& yuvCount = ctx->listStats[dpy].yuvCount;
ctx->listStats[dpy].yuvIndices[yuvCount] = i;
yuvCount++;
}
+
+ if(!ctx->listStats[dpy].needsAlphaScale)
+ ctx->listStats[dpy].needsAlphaScale = isAlphaScaled(layer);
}
}
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 9692986..c66f7ff 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -136,6 +136,10 @@
//Helper function to dump logs
void dumpsys_log(android::String8& buf, const char* fmt, ...);
+/* Calculates the destination position based on the action safe rectangle */
+void getActionSafePosition(hwc_context_t *ctx, int dpy, uint32_t& x,
+ uint32_t& y, uint32_t& w, uint32_t& h);
+
//Sync point impl.
int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
int fd);
diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp
index 0c0a40d..6abc7ae 100644
--- a/libhwcomposer/hwc_video.cpp
+++ b/libhwcomposer/hwc_video.cpp
@@ -171,6 +171,10 @@
displayFrame.top,
displayFrame.right - displayFrame.left,
displayFrame.bottom - displayFrame.top);
+ // Calculate the actionsafe dimensions for External(dpy = 1 or 2)
+ if(dpy)
+ getActionSafePosition(ctx, dpy, dpos.x, dpos.y, dpos.w, dpos.h);
+
ov.setPosition(dpos, dest);
if (!ov.commit(dest)) {
diff --git a/libhwcomposer/hwc_video.h b/libhwcomposer/hwc_video.h
index 09b24cc..3612018 100644
--- a/libhwcomposer/hwc_video.h
+++ b/libhwcomposer/hwc_video.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (C) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (C) 2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libhwcomposer/hwc_vsync.cpp b/libhwcomposer/hwc_vsync.cpp
index 7f7bb1f..5f62eba 100644
--- a/libhwcomposer/hwc_vsync.cpp
+++ b/libhwcomposer/hwc_vsync.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (C) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (C) 2012, The Linux Foundation. All rights reserved.
*
* Not a Contribution, Apache license notifications and license are
* retained for attribution purposes only.
diff --git a/liboverlay/overlayCtrl.cpp b/liboverlay/overlayCtrl.cpp
index 03d2564..2cbf1c5 100644
--- a/liboverlay/overlayCtrl.cpp
+++ b/liboverlay/overlayCtrl.cpp
@@ -79,8 +79,6 @@
return true;
}
-utils::ActionSafe* utils::ActionSafe::sActionSafe = NULL;
-
utils::FrameBufferInfo* utils::FrameBufferInfo::sFBInfoInstance = 0;
void Ctrl::dump() const {
diff --git a/liboverlay/overlayCtrlData.h b/liboverlay/overlayCtrlData.h
index 58f46b3..c0d4c6d 100644
--- a/liboverlay/overlayCtrlData.h
+++ b/liboverlay/overlayCtrlData.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+* Copyright (c) 2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+* * 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.
*
diff --git a/liboverlay/overlayMdp.cpp b/liboverlay/overlayMdp.cpp
index 12ff8a9..ee1aae7 100644
--- a/liboverlay/overlayMdp.cpp
+++ b/liboverlay/overlayMdp.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
-* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
+* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/liboverlay/overlayMdp.h b/liboverlay/overlayMdp.h
index 24aa3c1..9df1a04 100644
--- a/liboverlay/overlayMdp.h
+++ b/liboverlay/overlayMdp.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
-* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
+* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/liboverlay/overlayMem.h b/liboverlay/overlayMem.h
index ff8afcd..d3cabb6 100644
--- a/liboverlay/overlayMem.h
+++ b/liboverlay/overlayMem.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+* Copyright (c) 2011, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+* * 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.
*
diff --git a/liboverlay/overlayUtils.h b/liboverlay/overlayUtils.h
index cbacf7f..2f6832d 100644
--- a/liboverlay/overlayUtils.h
+++ b/liboverlay/overlayUtils.h
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+* * 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.
*
@@ -245,28 +245,6 @@
uint32_t size;
};
-class ActionSafe {
-private:
- ActionSafe() : mWidth(0.0f), mHeight(0.0f) { };
- float mWidth;
- float mHeight;
- static ActionSafe *sActionSafe;
-public:
- ~ActionSafe() { };
- static ActionSafe* getInstance() {
- if(!sActionSafe) {
- sActionSafe = new ActionSafe();
- }
- return sActionSafe;
- }
- void setDimension(int w, int h) {
- mWidth = (float)w;
- mHeight = (float)h;
- }
- float getWidth() { return mWidth; }
- float getHeight() { return mHeight; }
-};
-
enum { MAX_PATH_LEN = 256 };
/**
diff --git a/liboverlay/pipes/overlay3DPipe.h b/liboverlay/pipes/overlay3DPipe.h
index aaff336..4e5630e 100644
--- a/liboverlay/pipes/overlay3DPipe.h
+++ b/liboverlay/pipes/overlay3DPipe.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+* Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+* * 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.
*
diff --git a/libqdutils/idle_invalidator.cpp b/libqdutils/idle_invalidator.cpp
index d0c0f73..4f03968 100644
--- a/libqdutils/idle_invalidator.cpp
+++ b/libqdutils/idle_invalidator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libqdutils/idle_invalidator.h b/libqdutils/idle_invalidator.h
index 930cd35..82b1ac0 100644
--- a/libqdutils/idle_invalidator.h
+++ b/libqdutils/idle_invalidator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libqdutils/mdp_version.cpp b/libqdutils/mdp_version.cpp
index 78ca52f..49f0927 100644
--- a/libqdutils/mdp_version.cpp
+++ b/libqdutils/mdp_version.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libqdutils/mdp_version.h b/libqdutils/mdp_version.h
index 9137cd4..515d767 100644
--- a/libqdutils/mdp_version.h
+++ b/libqdutils/mdp_version.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libqdutils/profiler.cpp b/libqdutils/profiler.cpp
index e39b304..3c04382 100644
--- a/libqdutils/profiler.cpp
+++ b/libqdutils/profiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libqdutils/profiler.h b/libqdutils/profiler.h
index 6e74d04..5f270b0 100644
--- a/libqdutils/profiler.h
+++ b/libqdutils/profiler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, 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
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libqservice/QService.cpp b/libqservice/QService.cpp
index 77a9518..1c9f165 100644
--- a/libqservice/QService.cpp
+++ b/libqservice/QService.cpp
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libqservice/QService.h b/libqservice/QService.h
index a6b37f3..ab458a4 100644
--- a/libqservice/QService.h
+++ b/libqservice/QService.h
@@ -10,7 +10,7 @@
* 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 Code Aurora Forum, Inc. nor the names of its
+ * * 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.
*
diff --git a/libtilerenderer/tilerenderer.cpp b/libtilerenderer/tilerenderer.cpp
index 4ed6895..03a0aea 100644
--- a/libtilerenderer/tilerenderer.cpp
+++ b/libtilerenderer/tilerenderer.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/libtilerenderer/tilerenderer.h b/libtilerenderer/tilerenderer.h
index 7f8d608..d894d33 100644
--- a/libtilerenderer/tilerenderer.h
+++ b/libtilerenderer/tilerenderer.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.