hwc: Rename libexternal to serve HDMI as primary or external
This change will make is easier to build new functionality applicable to both HDMI scenarios. Change-Id: I417184568cb65a49c2ccb4199aff313ae2ee9b24
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
display-hals := libgralloc libgenlock libcopybit liblight
|
display-hals := libgralloc libgenlock libcopybit liblight
|
||||||
display-hals += libhwcomposer liboverlay libqdutils libexternal libqservice
|
display-hals += libhwcomposer liboverlay libqdutils libhdmi libqservice
|
||||||
display-hals += libmemtrack
|
display-hals += libmemtrack
|
||||||
ifeq ($(call is-vendor-board-platform,QCOM),true)
|
ifeq ($(call is-vendor-board-platform,QCOM),true)
|
||||||
include $(call all-named-subdir-makefiles,$(display-hals))
|
include $(call all-named-subdir-makefiles,$(display-hals))
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ common_includes += $(LOCAL_PATH)/../liboverlay
|
|||||||
common_includes += $(LOCAL_PATH)/../libcopybit
|
common_includes += $(LOCAL_PATH)/../libcopybit
|
||||||
common_includes += $(LOCAL_PATH)/../libqdutils
|
common_includes += $(LOCAL_PATH)/../libqdutils
|
||||||
common_includes += $(LOCAL_PATH)/../libhwcomposer
|
common_includes += $(LOCAL_PATH)/../libhwcomposer
|
||||||
common_includes += $(LOCAL_PATH)/../libexternal
|
common_includes += $(LOCAL_PATH)/../libhdmi
|
||||||
common_includes += $(LOCAL_PATH)/../libqservice
|
common_includes += $(LOCAL_PATH)/../libqservice
|
||||||
|
|
||||||
ifeq ($(TARGET_USES_POST_PROCESSING),true)
|
ifeq ($(TARGET_USES_POST_PROCESSING),true)
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
include $(LOCAL_PATH)/../common.mk
|
include $(LOCAL_PATH)/../common.mk
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_MODULE := libexternal
|
LOCAL_MODULE := libhdmi
|
||||||
LOCAL_MODULE_TAGS := optional
|
LOCAL_MODULE_TAGS := optional
|
||||||
LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes)
|
LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes)
|
||||||
LOCAL_SHARED_LIBRARIES := $(common_libs) liboverlay libqdutils
|
LOCAL_SHARED_LIBRARIES := $(common_libs) liboverlay libqdutils
|
||||||
LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdexternal\"
|
LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdhdmi\"
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
|
||||||
LOCAL_SRC_FILES := external.cpp
|
LOCAL_SRC_FILES := hdmi.cpp
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <cutils/properties.h>
|
#include <cutils/properties.h>
|
||||||
#include "hwc_utils.h"
|
#include "hwc_utils.h"
|
||||||
#include "external.h"
|
#include "hdmi.h"
|
||||||
#include "overlayUtils.h"
|
#include "overlayUtils.h"
|
||||||
#include "overlay.h"
|
#include "overlay.h"
|
||||||
#include "qd_utils.h"
|
#include "qd_utils.h"
|
||||||
@@ -83,7 +83,7 @@ EDIDData gEDIDData [] = {
|
|||||||
// Number of modes in gEDIDData
|
// Number of modes in gEDIDData
|
||||||
const int gEDIDCount = (sizeof(gEDIDData)/sizeof(gEDIDData)[0]);
|
const int gEDIDCount = (sizeof(gEDIDData)/sizeof(gEDIDData)[0]);
|
||||||
|
|
||||||
int ExternalDisplay::configure() {
|
int HDMIDisplay::configure() {
|
||||||
if(!openFrameBuffer()) {
|
if(!openFrameBuffer()) {
|
||||||
ALOGE("%s: Failed to open FB: %d", __FUNCTION__, mFbNum);
|
ALOGE("%s: Failed to open FB: %d", __FUNCTION__, mFbNum);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -113,12 +113,12 @@ int ExternalDisplay::configure() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalDisplay::getAttributes(uint32_t& width, uint32_t& height) {
|
void HDMIDisplay::getAttributes(uint32_t& width, uint32_t& height) {
|
||||||
uint32_t fps = 0;
|
uint32_t fps = 0;
|
||||||
getAttrForMode(width, height, fps);
|
getAttrForMode(width, height, fps);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ExternalDisplay::teardown() {
|
int HDMIDisplay::teardown() {
|
||||||
closeFrameBuffer();
|
closeFrameBuffer();
|
||||||
resetInfo();
|
resetInfo();
|
||||||
// unset system property
|
// unset system property
|
||||||
@@ -126,7 +126,7 @@ int ExternalDisplay::teardown() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExternalDisplay::ExternalDisplay():mFd(-1),
|
HDMIDisplay::HDMIDisplay():mFd(-1),
|
||||||
mCurrentMode(-1), mModeCount(0), mPrimaryWidth(0), mPrimaryHeight(0),
|
mCurrentMode(-1), mModeCount(0), mPrimaryWidth(0), mPrimaryHeight(0),
|
||||||
mUnderscanSupported(false)
|
mUnderscanSupported(false)
|
||||||
{
|
{
|
||||||
@@ -166,7 +166,7 @@ ExternalDisplay::ExternalDisplay():mFd(-1),
|
|||||||
* to the sysfs node, so that the driver can get that information
|
* to the sysfs node, so that the driver can get that information
|
||||||
* Used to show QCOM 8974 instead of Input 1 for example
|
* Used to show QCOM 8974 instead of Input 1 for example
|
||||||
*/
|
*/
|
||||||
void ExternalDisplay::setSPDInfo(const char* node, const char* property) {
|
void HDMIDisplay::setSPDInfo(const char* node, const char* property) {
|
||||||
char info[PROPERTY_VALUE_MAX];
|
char info[PROPERTY_VALUE_MAX];
|
||||||
ssize_t err = -1;
|
ssize_t err = -1;
|
||||||
int spdFile = openDeviceNode(node, O_RDWR);
|
int spdFile = openDeviceNode(node, O_RDWR);
|
||||||
@@ -189,12 +189,12 @@ void ExternalDisplay::setSPDInfo(const char* node, const char* property) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalDisplay::setHPD(uint32_t value) {
|
void HDMIDisplay::setHPD(uint32_t value) {
|
||||||
ALOGD_IF(DEBUG,"HPD enabled=%d", value);
|
ALOGD_IF(DEBUG,"HPD enabled=%d", value);
|
||||||
writeHPDOption(value);
|
writeHPDOption(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalDisplay::setActionSafeDimension(int w, int h) {
|
void HDMIDisplay::setActionSafeDimension(int w, int h) {
|
||||||
ALOGD_IF(DEBUG,"ActionSafe w=%d h=%d", w, h);
|
ALOGD_IF(DEBUG,"ActionSafe w=%d h=%d", w, h);
|
||||||
char actionsafeWidth[PROPERTY_VALUE_MAX];
|
char actionsafeWidth[PROPERTY_VALUE_MAX];
|
||||||
char actionsafeHeight[PROPERTY_VALUE_MAX];
|
char actionsafeHeight[PROPERTY_VALUE_MAX];
|
||||||
@@ -204,12 +204,12 @@ void ExternalDisplay::setActionSafeDimension(int w, int h) {
|
|||||||
property_set("persist.sys.actionsafe.height", actionsafeHeight);
|
property_set("persist.sys.actionsafe.height", actionsafeHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ExternalDisplay::getModeCount() const {
|
int HDMIDisplay::getModeCount() const {
|
||||||
ALOGD_IF(DEBUG,"HPD mModeCount=%d", mModeCount);
|
ALOGD_IF(DEBUG,"HPD mModeCount=%d", mModeCount);
|
||||||
return mModeCount;
|
return mModeCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalDisplay::readCEUnderscanInfo()
|
void HDMIDisplay::readCEUnderscanInfo()
|
||||||
{
|
{
|
||||||
int hdmiScanInfoFile = -1;
|
int hdmiScanInfoFile = -1;
|
||||||
ssize_t len = -1;
|
ssize_t len = -1;
|
||||||
@@ -258,8 +258,8 @@ void ExternalDisplay::readCEUnderscanInfo()
|
|||||||
|
|
||||||
if (ce_info_str) {
|
if (ce_info_str) {
|
||||||
// ce_info contains the underscan information
|
// ce_info contains the underscan information
|
||||||
if (ce_info == EXT_SCAN_ALWAYS_UNDERSCANED ||
|
if (ce_info == HDMI_SCAN_ALWAYS_UNDERSCANED ||
|
||||||
ce_info == EXT_SCAN_BOTH_SUPPORTED)
|
ce_info == HDMI_SCAN_BOTH_SUPPORTED)
|
||||||
// if TV supported underscan, then driver will always underscan
|
// if TV supported underscan, then driver will always underscan
|
||||||
// hence no need to apply action safe rectangle
|
// hence no need to apply action safe rectangle
|
||||||
mUnderscanSupported = true;
|
mUnderscanSupported = true;
|
||||||
@@ -273,7 +273,7 @@ void ExternalDisplay::readCEUnderscanInfo()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExternalDisplay::~ExternalDisplay()
|
HDMIDisplay::~HDMIDisplay()
|
||||||
{
|
{
|
||||||
delete [] supported_video_mode_lut;
|
delete [] supported_video_mode_lut;
|
||||||
closeFrameBuffer();
|
closeFrameBuffer();
|
||||||
@@ -309,7 +309,7 @@ void setDisplayTiming(struct fb_var_screeninfo &info,
|
|||||||
info.upper_margin = mode->back_porch_v;
|
info.upper_margin = mode->back_porch_v;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ExternalDisplay::parseResolution(char* edidStr)
|
int HDMIDisplay::parseResolution(char* edidStr)
|
||||||
{
|
{
|
||||||
char delim = ',';
|
char delim = ',';
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@@ -330,7 +330,7 @@ int ExternalDisplay::parseResolution(char* edidStr)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExternalDisplay::readResolution()
|
bool HDMIDisplay::readResolution()
|
||||||
{
|
{
|
||||||
ssize_t len = -1;
|
ssize_t len = -1;
|
||||||
char edidStr[128] = {'\0'};
|
char edidStr[128] = {'\0'};
|
||||||
@@ -364,7 +364,7 @@ bool ExternalDisplay::readResolution()
|
|||||||
return (len > 0);
|
return (len > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExternalDisplay::openFrameBuffer()
|
bool HDMIDisplay::openFrameBuffer()
|
||||||
{
|
{
|
||||||
if (mFd == -1) {
|
if (mFd == -1) {
|
||||||
char strDevPath[MAX_SYSFS_FILE_PATH];
|
char strDevPath[MAX_SYSFS_FILE_PATH];
|
||||||
@@ -376,7 +376,7 @@ bool ExternalDisplay::openFrameBuffer()
|
|||||||
return (mFd > 0);
|
return (mFd > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExternalDisplay::closeFrameBuffer()
|
bool HDMIDisplay::closeFrameBuffer()
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if(mFd >= 0) {
|
if(mFd >= 0) {
|
||||||
@@ -387,7 +387,7 @@ bool ExternalDisplay::closeFrameBuffer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clears the vinfo, edid, best modes
|
// clears the vinfo, edid, best modes
|
||||||
void ExternalDisplay::resetInfo()
|
void HDMIDisplay::resetInfo()
|
||||||
{
|
{
|
||||||
memset(&mVInfo, 0, sizeof(mVInfo));
|
memset(&mVInfo, 0, sizeof(mVInfo));
|
||||||
memset(mEDIDModes, 0, sizeof(mEDIDModes));
|
memset(mEDIDModes, 0, sizeof(mEDIDModes));
|
||||||
@@ -403,7 +403,7 @@ void ExternalDisplay::resetInfo()
|
|||||||
property_set("hw.underscan_supported", prop);
|
property_set("hw.underscan_supported", prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ExternalDisplay::getModeOrder(int mode)
|
int HDMIDisplay::getModeOrder(int mode)
|
||||||
{
|
{
|
||||||
for (int dataIndex = 0; dataIndex < gEDIDCount; dataIndex++) {
|
for (int dataIndex = 0; dataIndex < gEDIDCount; dataIndex++) {
|
||||||
if (gEDIDData[dataIndex].mMode == mode) {
|
if (gEDIDData[dataIndex].mMode == mode) {
|
||||||
@@ -415,7 +415,7 @@ int ExternalDisplay::getModeOrder(int mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the user mode set(if any) using adb shell
|
/// Returns the user mode set(if any) using adb shell
|
||||||
int ExternalDisplay::getUserMode() {
|
int HDMIDisplay::getUserMode() {
|
||||||
/* Based on the property set the resolution */
|
/* Based on the property set the resolution */
|
||||||
char property_value[PROPERTY_VALUE_MAX];
|
char property_value[PROPERTY_VALUE_MAX];
|
||||||
property_get("hw.hdmi.resolution", property_value, "-1");
|
property_get("hw.hdmi.resolution", property_value, "-1");
|
||||||
@@ -429,7 +429,7 @@ int ExternalDisplay::getUserMode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the best mode for the current HD TV
|
// Get the best mode for the current HD TV
|
||||||
int ExternalDisplay::getBestMode() {
|
int HDMIDisplay::getBestMode() {
|
||||||
int bestOrder = 0;
|
int bestOrder = 0;
|
||||||
int bestMode = HDMI_VFRMT_640x480p60_4_3;
|
int bestMode = HDMI_VFRMT_640x480p60_4_3;
|
||||||
// for all the edid read, get the best mode
|
// for all the edid read, get the best mode
|
||||||
@@ -444,7 +444,7 @@ int ExternalDisplay::getBestMode() {
|
|||||||
return bestMode;
|
return bestMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool ExternalDisplay::isValidMode(int ID)
|
inline bool HDMIDisplay::isValidMode(int ID)
|
||||||
{
|
{
|
||||||
bool valid = false;
|
bool valid = false;
|
||||||
for (int i = 0; i < mModeCount; i++) {
|
for (int i = 0; i < mModeCount; i++) {
|
||||||
@@ -457,7 +457,7 @@ inline bool ExternalDisplay::isValidMode(int ID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the mode(ID) is interlaced mode format
|
// returns true if the mode(ID) is interlaced mode format
|
||||||
bool ExternalDisplay::isInterlacedMode(int ID) {
|
bool HDMIDisplay::isInterlacedMode(int ID) {
|
||||||
bool interlaced = false;
|
bool interlaced = false;
|
||||||
switch(ID) {
|
switch(ID) {
|
||||||
case HDMI_VFRMT_1440x480i60_4_3:
|
case HDMI_VFRMT_1440x480i60_4_3:
|
||||||
@@ -476,7 +476,7 @@ bool ExternalDisplay::isInterlacedMode(int ID) {
|
|||||||
|
|
||||||
// Does a put_vscreen info on the HDMI interface which will update
|
// Does a put_vscreen info on the HDMI interface which will update
|
||||||
// the configuration (resolution, timing info) to match mCurrentMode
|
// the configuration (resolution, timing info) to match mCurrentMode
|
||||||
void ExternalDisplay::activateDisplay()
|
void HDMIDisplay::activateDisplay()
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
ret = ioctl(mFd, FBIOGET_VSCREENINFO, &mVInfo);
|
ret = ioctl(mFd, FBIOGET_VSCREENINFO, &mVInfo);
|
||||||
@@ -526,7 +526,7 @@ void ExternalDisplay::activateDisplay()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExternalDisplay::writeHPDOption(int userOption) const
|
bool HDMIDisplay::writeHPDOption(int userOption) const
|
||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
if(mFbNum != -1) {
|
if(mFbNum != -1) {
|
||||||
@@ -550,7 +550,7 @@ bool ExternalDisplay::writeHPDOption(int userOption) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ExternalDisplay::setAttributes() {
|
void HDMIDisplay::setAttributes() {
|
||||||
uint32_t fps = 0;
|
uint32_t fps = 0;
|
||||||
// Always set dpyAttr res to mVInfo res
|
// Always set dpyAttr res to mVInfo res
|
||||||
getAttrForMode(mXres, mYres, fps);
|
getAttrForMode(mXres, mYres, fps);
|
||||||
@@ -619,7 +619,7 @@ void ExternalDisplay::setAttributes() {
|
|||||||
ALOGD_IF(DEBUG, "%s xres=%d, yres=%d", __FUNCTION__, mXres, mYres);
|
ALOGD_IF(DEBUG, "%s xres=%d, yres=%d", __FUNCTION__, mXres, mYres);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalDisplay::getAttrForMode(uint32_t& width, uint32_t& height,
|
void HDMIDisplay::getAttrForMode(uint32_t& width, uint32_t& height,
|
||||||
uint32_t& fps) {
|
uint32_t& fps) {
|
||||||
for (int dataIndex = 0; dataIndex < gEDIDCount; dataIndex++) {
|
for (int dataIndex = 0; dataIndex < gEDIDCount; dataIndex++) {
|
||||||
if (gEDIDData[dataIndex].mMode == mCurrentMode) {
|
if (gEDIDData[dataIndex].mMode == mCurrentMode) {
|
||||||
@@ -633,7 +633,7 @@ void ExternalDisplay::getAttrForMode(uint32_t& width, uint32_t& height,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* returns the fd related to the node specified*/
|
/* returns the fd related to the node specified*/
|
||||||
int ExternalDisplay::openDeviceNode(const char* node, int fileMode) const {
|
int HDMIDisplay::openDeviceNode(const char* node, int fileMode) const {
|
||||||
char sysFsFilePath[MAX_SYSFS_FILE_PATH];
|
char sysFsFilePath[MAX_SYSFS_FILE_PATH];
|
||||||
memset(sysFsFilePath, 0, sizeof(sysFsFilePath));
|
memset(sysFsFilePath, 0, sizeof(sysFsFilePath));
|
||||||
snprintf(sysFsFilePath , sizeof(sysFsFilePath),
|
snprintf(sysFsFilePath , sizeof(sysFsFilePath),
|
||||||
@@ -649,12 +649,12 @@ int ExternalDisplay::openDeviceNode(const char* node, int fileMode) const {
|
|||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExternalDisplay::isHDMIPrimaryDisplay() {
|
bool HDMIDisplay::isHDMIPrimaryDisplay() {
|
||||||
int hdmiNode = qdutils::getHDMINode();
|
int hdmiNode = qdutils::getHDMINode();
|
||||||
return (hdmiNode == HWC_DISPLAY_PRIMARY);
|
return (hdmiNode == HWC_DISPLAY_PRIMARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ExternalDisplay::getConnectedState() {
|
int HDMIDisplay::getConnectedState() {
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int mFbNum = qdutils::getHDMINode();
|
int mFbNum = qdutils::getHDMINode();
|
||||||
int connectedNode = openDeviceNode("connected", O_RDONLY);
|
int connectedNode = openDeviceNode("connected", O_RDONLY);
|
||||||
@@ -679,7 +679,7 @@ int ExternalDisplay::getConnectedState() {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalDisplay::setPrimaryAttributes(uint32_t primaryWidth,
|
void HDMIDisplay::setPrimaryAttributes(uint32_t primaryWidth,
|
||||||
uint32_t primaryHeight) {
|
uint32_t primaryHeight) {
|
||||||
mPrimaryHeight = primaryHeight;
|
mPrimaryHeight = primaryHeight;
|
||||||
mPrimaryWidth = primaryWidth;
|
mPrimaryWidth = primaryWidth;
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HWC_EXTERNAL_DISPLAY_H
|
#ifndef HWC_HDMI_DISPLAY_H
|
||||||
#define HWC_EXTERNAL_DISPLAY_H
|
#define HWC_HDMI_DISPLAY_H
|
||||||
|
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
|
|
||||||
@@ -28,11 +28,11 @@ struct msm_hdmi_mode_timing_info;
|
|||||||
namespace qhwc {
|
namespace qhwc {
|
||||||
|
|
||||||
//Type of scanning of EDID(Video Capability Data Block)
|
//Type of scanning of EDID(Video Capability Data Block)
|
||||||
enum external_scansupport_type {
|
enum hdmi_scansupport_type {
|
||||||
EXT_SCAN_NOT_SUPPORTED = 0,
|
HDMI_SCAN_NOT_SUPPORTED = 0,
|
||||||
EXT_SCAN_ALWAYS_OVERSCANED = 1,
|
HDMI_SCAN_ALWAYS_OVERSCANED = 1,
|
||||||
EXT_SCAN_ALWAYS_UNDERSCANED = 2,
|
HDMI_SCAN_ALWAYS_UNDERSCANED = 2,
|
||||||
EXT_SCAN_BOTH_SUPPORTED = 3
|
HDMI_SCAN_BOTH_SUPPORTED = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
// Structure to store EDID related data
|
// Structure to store EDID related data
|
||||||
@@ -45,11 +45,11 @@ struct EDIDData {
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExternalDisplay
|
class HDMIDisplay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ExternalDisplay();
|
HDMIDisplay();
|
||||||
~ExternalDisplay();
|
~HDMIDisplay();
|
||||||
void setHPD(uint32_t startEnd);
|
void setHPD(uint32_t startEnd);
|
||||||
void setActionSafeDimension(int w, int h);
|
void setActionSafeDimension(int w, int h);
|
||||||
bool isCEUnderscanSupported() { return mUnderscanSupported; }
|
bool isCEUnderscanSupported() { return mUnderscanSupported; }
|
||||||
@@ -107,4 +107,4 @@ private:
|
|||||||
|
|
||||||
}; //qhwc
|
}; //qhwc
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
#endif //HWC_EXTERNAL_DISPLAY_H
|
#endif //HWC_HDMI_DISPLAY_H
|
||||||
@@ -9,7 +9,7 @@ LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes) \
|
|||||||
$(TOP)/external/skia/include/core \
|
$(TOP)/external/skia/include/core \
|
||||||
$(TOP)/external/skia/include/images
|
$(TOP)/external/skia/include/images
|
||||||
LOCAL_SHARED_LIBRARIES := $(common_libs) libEGL liboverlay \
|
LOCAL_SHARED_LIBRARIES := $(common_libs) libEGL liboverlay \
|
||||||
libexternal libqdutils libhardware_legacy \
|
libhdmi libqdutils libhardware_legacy \
|
||||||
libdl libmemalloc libqservice libsync \
|
libdl libmemalloc libqservice libsync \
|
||||||
libbinder libmedia
|
libbinder libmedia
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
#include "hwc_fbupdate.h"
|
#include "hwc_fbupdate.h"
|
||||||
#include "hwc_mdpcomp.h"
|
#include "hwc_mdpcomp.h"
|
||||||
#include "hwc_dump_layers.h"
|
#include "hwc_dump_layers.h"
|
||||||
#include "external.h"
|
#include "hdmi.h"
|
||||||
#include "hwc_copybit.h"
|
#include "hwc_copybit.h"
|
||||||
#include "hwc_ad.h"
|
#include "hwc_ad.h"
|
||||||
#include "profiler.h"
|
#include "profiler.h"
|
||||||
@@ -442,7 +442,7 @@ static int hwc_setPowerMode(struct hwc_composer_device_1* dev, int dpy,
|
|||||||
if(mode == HWC_POWER_MODE_NORMAL) {
|
if(mode == HWC_POWER_MODE_NORMAL) {
|
||||||
// Enable HPD here, as during bootup POWER_MODE_NORMAL is set
|
// Enable HPD here, as during bootup POWER_MODE_NORMAL is set
|
||||||
// when SF is completely initialized
|
// when SF is completely initialized
|
||||||
ctx->mExtDisplay->setHPD(1);
|
ctx->mHDMIDisplay->setHPD(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF);
|
ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF);
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
#include <mdp_version.h>
|
#include <mdp_version.h>
|
||||||
#include "hwc_ad.h"
|
#include "hwc_ad.h"
|
||||||
#include "hwc_utils.h"
|
#include "hwc_utils.h"
|
||||||
#include "external.h"
|
|
||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
using namespace overlay;
|
using namespace overlay;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
#include <overlayRotator.h>
|
#include <overlayRotator.h>
|
||||||
#include "hwc_fbupdate.h"
|
#include "hwc_fbupdate.h"
|
||||||
#include "mdp_version.h"
|
#include "mdp_version.h"
|
||||||
#include "external.h"
|
|
||||||
|
|
||||||
using namespace qdutils;
|
using namespace qdutils;
|
||||||
using namespace overlay;
|
using namespace overlay;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "hwc_mdpcomp.h"
|
#include "hwc_mdpcomp.h"
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include "external.h"
|
#include "hdmi.h"
|
||||||
#include "qdMetaData.h"
|
#include "qdMetaData.h"
|
||||||
#include "mdp_version.h"
|
#include "mdp_version.h"
|
||||||
#include "hwc_fbupdate.h"
|
#include "hwc_fbupdate.h"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "hwc_mdpcomp.h"
|
#include "hwc_mdpcomp.h"
|
||||||
#include "hwc_copybit.h"
|
#include "hwc_copybit.h"
|
||||||
#include "comptype.h"
|
#include "comptype.h"
|
||||||
#include "external.h"
|
#include "hdmi.h"
|
||||||
#include "hwc_virtual.h"
|
#include "hwc_virtual.h"
|
||||||
#include "mdp_version.h"
|
#include "mdp_version.h"
|
||||||
using namespace overlay;
|
using namespace overlay;
|
||||||
@@ -109,7 +109,7 @@ static void handle_uevent(hwc_context_t* ctx, const char* udata, int len)
|
|||||||
|
|
||||||
Locker::Autolock _l(ctx->mDrawLock);
|
Locker::Autolock _l(ctx->mDrawLock);
|
||||||
destroyCompositionResources(ctx, dpy);
|
destroyCompositionResources(ctx, dpy);
|
||||||
ctx->mExtDisplay->teardown();
|
ctx->mHDMIDisplay->teardown();
|
||||||
resetDisplayInfo(ctx, dpy);
|
resetDisplayInfo(ctx, dpy);
|
||||||
|
|
||||||
/* We need to send hotplug to SF only when we are disconnecting
|
/* We need to send hotplug to SF only when we are disconnecting
|
||||||
@@ -163,8 +163,8 @@ static void handle_uevent(hwc_context_t* ctx, const char* udata, int len)
|
|||||||
"uevent thread", __FUNCTION__);
|
"uevent thread", __FUNCTION__);
|
||||||
ctx->mWfdSyncLock.unlock();
|
ctx->mWfdSyncLock.unlock();
|
||||||
}
|
}
|
||||||
ctx->mExtDisplay->configure();
|
ctx->mHDMIDisplay->configure();
|
||||||
ctx->mExtDisplay->activateDisplay();
|
ctx->mHDMIDisplay->activateDisplay();
|
||||||
|
|
||||||
Locker::Autolock _l(ctx->mDrawLock);
|
Locker::Autolock _l(ctx->mDrawLock);
|
||||||
updateDisplayInfo(ctx, dpy);
|
updateDisplayInfo(ctx, dpy);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include "mdp_version.h"
|
#include "mdp_version.h"
|
||||||
#include "hwc_copybit.h"
|
#include "hwc_copybit.h"
|
||||||
#include "hwc_dump_layers.h"
|
#include "hwc_dump_layers.h"
|
||||||
#include "external.h"
|
#include "hdmi.h"
|
||||||
#include "hwc_qclient.h"
|
#include "hwc_qclient.h"
|
||||||
#include "QService.h"
|
#include "QService.h"
|
||||||
#include "comptype.h"
|
#include "comptype.h"
|
||||||
@@ -112,21 +112,21 @@ void changeResolution(hwc_context_t *ctx, int xres_orig, int yres_orig,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize external display attributes based on
|
// Initialize hdmi display attributes based on
|
||||||
// external display class state
|
// hdmi display class state
|
||||||
void updateDisplayInfo(hwc_context_t* ctx, int dpy) {
|
void updateDisplayInfo(hwc_context_t* ctx, int dpy) {
|
||||||
ctx->dpyAttr[dpy].fd = ctx->mExtDisplay->getFd();
|
ctx->dpyAttr[dpy].fd = ctx->mHDMIDisplay->getFd();
|
||||||
ctx->dpyAttr[dpy].xres = ctx->mExtDisplay->getWidth();
|
ctx->dpyAttr[dpy].xres = ctx->mHDMIDisplay->getWidth();
|
||||||
ctx->dpyAttr[dpy].yres = ctx->mExtDisplay->getHeight();
|
ctx->dpyAttr[dpy].yres = ctx->mHDMIDisplay->getHeight();
|
||||||
ctx->dpyAttr[dpy].mMDPScalingMode = ctx->mExtDisplay->getMDPScalingMode();
|
ctx->dpyAttr[dpy].mMDPScalingMode = ctx->mHDMIDisplay->getMDPScalingMode();
|
||||||
ctx->dpyAttr[dpy].vsync_period = ctx->mExtDisplay->getVsyncPeriod();
|
ctx->dpyAttr[dpy].vsync_period = ctx->mHDMIDisplay->getVsyncPeriod();
|
||||||
ctx->mViewFrame[dpy].left = 0;
|
ctx->mViewFrame[dpy].left = 0;
|
||||||
ctx->mViewFrame[dpy].top = 0;
|
ctx->mViewFrame[dpy].top = 0;
|
||||||
ctx->mViewFrame[dpy].right = ctx->dpyAttr[dpy].xres;
|
ctx->mViewFrame[dpy].right = ctx->dpyAttr[dpy].xres;
|
||||||
ctx->mViewFrame[dpy].bottom = ctx->dpyAttr[dpy].yres;
|
ctx->mViewFrame[dpy].bottom = ctx->dpyAttr[dpy].yres;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset external display attributes and list stats structures
|
// Reset hdmi display attributes and list stats structures
|
||||||
void resetDisplayInfo(hwc_context_t* ctx, int dpy) {
|
void resetDisplayInfo(hwc_context_t* ctx, int dpy) {
|
||||||
memset(&(ctx->dpyAttr[dpy]), 0, sizeof(ctx->dpyAttr[dpy]));
|
memset(&(ctx->dpyAttr[dpy]), 0, sizeof(ctx->dpyAttr[dpy]));
|
||||||
memset(&(ctx->listStats[dpy]), 0, sizeof(ctx->listStats[dpy]));
|
memset(&(ctx->listStats[dpy]), 0, sizeof(ctx->listStats[dpy]));
|
||||||
@@ -260,12 +260,12 @@ void initContext(hwc_context_t *ctx)
|
|||||||
HWC_DISPLAY_PRIMARY);
|
HWC_DISPLAY_PRIMARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->mExtDisplay = new ExternalDisplay();
|
ctx->mHDMIDisplay = new HDMIDisplay();
|
||||||
// Send the primary resolution to the external display class
|
// Send the primary resolution to the hdmi display class
|
||||||
// to be used for MDP scaling functionality
|
// to be used for MDP scaling functionality
|
||||||
uint32_t priW = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
|
uint32_t priW = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
|
||||||
uint32_t priH = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
|
uint32_t priH = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
|
||||||
ctx->mExtDisplay->setPrimaryAttributes(priW, priH);
|
ctx->mHDMIDisplay->setPrimaryAttributes(priW, priH);
|
||||||
ctx->mHWCVirtual = new HWCVirtualVDS();
|
ctx->mHWCVirtual = new HWCVirtualVDS();
|
||||||
ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].isActive = false;
|
ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].isActive = false;
|
||||||
ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].connected = false;
|
ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].connected = false;
|
||||||
@@ -366,9 +366,9 @@ void closeContext(hwc_context_t *ctx)
|
|||||||
ctx->dpyAttr[HWC_DISPLAY_PRIMARY].fd = -1;
|
ctx->dpyAttr[HWC_DISPLAY_PRIMARY].fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ctx->mExtDisplay) {
|
if(ctx->mHDMIDisplay) {
|
||||||
delete ctx->mExtDisplay;
|
delete ctx->mHDMIDisplay;
|
||||||
ctx->mExtDisplay = NULL;
|
ctx->mHDMIDisplay = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
|
for(int i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
|
||||||
@@ -478,7 +478,7 @@ void getActionSafePosition(hwc_context_t *ctx, int dpy, hwc_rect_t& rect) {
|
|||||||
if(ctx->dpyAttr[dpy].mMDPScalingMode) {
|
if(ctx->dpyAttr[dpy].mMDPScalingMode) {
|
||||||
// if MDP scaling mode is enabled for external, need to query
|
// if MDP scaling mode is enabled for external, need to query
|
||||||
// the actual width and height, as that is the physical w & h
|
// the actual width and height, as that is the physical w & h
|
||||||
ctx->mExtDisplay->getAttributes(fbWidth, fbHeight);
|
ctx->mHDMIDisplay->getAttributes(fbWidth, fbHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -610,7 +610,7 @@ void getAspectRatioPosition(hwc_context_t* ctx, int dpy, int extOrientation,
|
|||||||
if(ctx->dpyAttr[dpy].mMDPScalingMode) {
|
if(ctx->dpyAttr[dpy].mMDPScalingMode) {
|
||||||
uint32_t extW = 0, extH = 0;
|
uint32_t extW = 0, extH = 0;
|
||||||
if(dpy == HWC_DISPLAY_EXTERNAL) {
|
if(dpy == HWC_DISPLAY_EXTERNAL) {
|
||||||
ctx->mExtDisplay->getAttributes(extW, extH);
|
ctx->mHDMIDisplay->getAttributes(extW, extH);
|
||||||
} else if(dpy == HWC_DISPLAY_VIRTUAL) {
|
} else if(dpy == HWC_DISPLAY_VIRTUAL) {
|
||||||
extW = ctx->mHWCVirtual->getScalingWidth();
|
extW = ctx->mHWCVirtual->getScalingWidth();
|
||||||
extH = ctx->mHWCVirtual->getScalingHeight();
|
extH = ctx->mHWCVirtual->getScalingHeight();
|
||||||
@@ -696,7 +696,7 @@ void calcExtDisplayPosition(hwc_context_t *ctx,
|
|||||||
float fbHeight = (float)ctx->dpyAttr[dpy].yres;
|
float fbHeight = (float)ctx->dpyAttr[dpy].yres;
|
||||||
// query MDP configured attributes
|
// query MDP configured attributes
|
||||||
if(dpy == HWC_DISPLAY_EXTERNAL) {
|
if(dpy == HWC_DISPLAY_EXTERNAL) {
|
||||||
ctx->mExtDisplay->getAttributes(extW, extH);
|
ctx->mHDMIDisplay->getAttributes(extW, extH);
|
||||||
} else if(dpy == HWC_DISPLAY_VIRTUAL) {
|
} else if(dpy == HWC_DISPLAY_VIRTUAL) {
|
||||||
extW = ctx->mHWCVirtual->getScalingWidth();
|
extW = ctx->mHWCVirtual->getScalingWidth();
|
||||||
extH = ctx->mHWCVirtual->getScalingHeight();
|
extH = ctx->mHWCVirtual->getScalingHeight();
|
||||||
@@ -1114,7 +1114,7 @@ bool isActionSafePresent(hwc_context_t *ctx, int dpy) {
|
|||||||
// Disable Actionsafe for non HDMI displays.
|
// Disable Actionsafe for non HDMI displays.
|
||||||
if(!(dpy == HWC_DISPLAY_EXTERNAL) ||
|
if(!(dpy == HWC_DISPLAY_EXTERNAL) ||
|
||||||
qdutils::MDPVersion::getInstance().is8x74v2() ||
|
qdutils::MDPVersion::getInstance().is8x74v2() ||
|
||||||
ctx->mExtDisplay->isCEUnderscanSupported()) {
|
ctx->mHDMIDisplay->isCEUnderscanSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class RotMgr;
|
|||||||
namespace qhwc {
|
namespace qhwc {
|
||||||
//fwrd decl
|
//fwrd decl
|
||||||
class QueuedBufferStore;
|
class QueuedBufferStore;
|
||||||
class ExternalDisplay;
|
class HDMIDisplay;
|
||||||
class VirtualDisplay;
|
class VirtualDisplay;
|
||||||
class IFBUpdate;
|
class IFBUpdate;
|
||||||
class IVideoOverlay;
|
class IVideoOverlay;
|
||||||
@@ -545,8 +545,9 @@ struct hwc_context_t {
|
|||||||
|
|
||||||
//Primary and external FB updater
|
//Primary and external FB updater
|
||||||
qhwc::IFBUpdate *mFBUpdate[HWC_NUM_DISPLAY_TYPES];
|
qhwc::IFBUpdate *mFBUpdate[HWC_NUM_DISPLAY_TYPES];
|
||||||
// External display related information
|
// HDMI display related object. Used to configure/teardown
|
||||||
qhwc::ExternalDisplay *mExtDisplay;
|
// HDMI when it is connected as primary or external.
|
||||||
|
qhwc::HDMIDisplay *mHDMIDisplay;
|
||||||
qhwc::MDPInfo mMDP;
|
qhwc::MDPInfo mMDP;
|
||||||
qhwc::VsyncState vstate;
|
qhwc::VsyncState vstate;
|
||||||
qhwc::DisplayAttributes dpyAttr[HWC_NUM_DISPLAY_TYPES];
|
qhwc::DisplayAttributes dpyAttr[HWC_NUM_DISPLAY_TYPES];
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#include "hwc_utils.h"
|
#include "hwc_utils.h"
|
||||||
#include "qd_utils.h"
|
#include "qd_utils.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "external.h"
|
|
||||||
#include "overlay.h"
|
#include "overlay.h"
|
||||||
#define __STDC_FORMAT_MACROS 1
|
#define __STDC_FORMAT_MACROS 1
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user