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:
@@ -37,7 +37,7 @@
|
||||
#include "mdp_version.h"
|
||||
#include "hwc_copybit.h"
|
||||
#include "hwc_dump_layers.h"
|
||||
#include "external.h"
|
||||
#include "hdmi.h"
|
||||
#include "hwc_qclient.h"
|
||||
#include "QService.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
|
||||
// external display class state
|
||||
// Initialize hdmi display attributes based on
|
||||
// hdmi display class state
|
||||
void updateDisplayInfo(hwc_context_t* ctx, int dpy) {
|
||||
ctx->dpyAttr[dpy].fd = ctx->mExtDisplay->getFd();
|
||||
ctx->dpyAttr[dpy].xres = ctx->mExtDisplay->getWidth();
|
||||
ctx->dpyAttr[dpy].yres = ctx->mExtDisplay->getHeight();
|
||||
ctx->dpyAttr[dpy].mMDPScalingMode = ctx->mExtDisplay->getMDPScalingMode();
|
||||
ctx->dpyAttr[dpy].vsync_period = ctx->mExtDisplay->getVsyncPeriod();
|
||||
ctx->dpyAttr[dpy].fd = ctx->mHDMIDisplay->getFd();
|
||||
ctx->dpyAttr[dpy].xres = ctx->mHDMIDisplay->getWidth();
|
||||
ctx->dpyAttr[dpy].yres = ctx->mHDMIDisplay->getHeight();
|
||||
ctx->dpyAttr[dpy].mMDPScalingMode = ctx->mHDMIDisplay->getMDPScalingMode();
|
||||
ctx->dpyAttr[dpy].vsync_period = ctx->mHDMIDisplay->getVsyncPeriod();
|
||||
ctx->mViewFrame[dpy].left = 0;
|
||||
ctx->mViewFrame[dpy].top = 0;
|
||||
ctx->mViewFrame[dpy].right = ctx->dpyAttr[dpy].xres;
|
||||
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) {
|
||||
memset(&(ctx->dpyAttr[dpy]), 0, sizeof(ctx->dpyAttr[dpy]));
|
||||
memset(&(ctx->listStats[dpy]), 0, sizeof(ctx->listStats[dpy]));
|
||||
@@ -260,12 +260,12 @@ void initContext(hwc_context_t *ctx)
|
||||
HWC_DISPLAY_PRIMARY);
|
||||
}
|
||||
|
||||
ctx->mExtDisplay = new ExternalDisplay();
|
||||
// Send the primary resolution to the external display class
|
||||
ctx->mHDMIDisplay = new HDMIDisplay();
|
||||
// Send the primary resolution to the hdmi display class
|
||||
// to be used for MDP scaling functionality
|
||||
uint32_t priW = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
|
||||
uint32_t priH = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
|
||||
ctx->mExtDisplay->setPrimaryAttributes(priW, priH);
|
||||
ctx->mHDMIDisplay->setPrimaryAttributes(priW, priH);
|
||||
ctx->mHWCVirtual = new HWCVirtualVDS();
|
||||
ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].isActive = 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;
|
||||
}
|
||||
|
||||
if(ctx->mExtDisplay) {
|
||||
delete ctx->mExtDisplay;
|
||||
ctx->mExtDisplay = NULL;
|
||||
if(ctx->mHDMIDisplay) {
|
||||
delete ctx->mHDMIDisplay;
|
||||
ctx->mHDMIDisplay = NULL;
|
||||
}
|
||||
|
||||
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 MDP scaling mode is enabled for external, need to query
|
||||
// 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) {
|
||||
uint32_t extW = 0, extH = 0;
|
||||
if(dpy == HWC_DISPLAY_EXTERNAL) {
|
||||
ctx->mExtDisplay->getAttributes(extW, extH);
|
||||
ctx->mHDMIDisplay->getAttributes(extW, extH);
|
||||
} else if(dpy == HWC_DISPLAY_VIRTUAL) {
|
||||
extW = ctx->mHWCVirtual->getScalingWidth();
|
||||
extH = ctx->mHWCVirtual->getScalingHeight();
|
||||
@@ -696,7 +696,7 @@ void calcExtDisplayPosition(hwc_context_t *ctx,
|
||||
float fbHeight = (float)ctx->dpyAttr[dpy].yres;
|
||||
// query MDP configured attributes
|
||||
if(dpy == HWC_DISPLAY_EXTERNAL) {
|
||||
ctx->mExtDisplay->getAttributes(extW, extH);
|
||||
ctx->mHDMIDisplay->getAttributes(extW, extH);
|
||||
} else if(dpy == HWC_DISPLAY_VIRTUAL) {
|
||||
extW = ctx->mHWCVirtual->getScalingWidth();
|
||||
extH = ctx->mHWCVirtual->getScalingHeight();
|
||||
@@ -1114,7 +1114,7 @@ bool isActionSafePresent(hwc_context_t *ctx, int dpy) {
|
||||
// Disable Actionsafe for non HDMI displays.
|
||||
if(!(dpy == HWC_DISPLAY_EXTERNAL) ||
|
||||
qdutils::MDPVersion::getInstance().is8x74v2() ||
|
||||
ctx->mExtDisplay->isCEUnderscanSupported()) {
|
||||
ctx->mHDMIDisplay->isCEUnderscanSupported()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user