hwc: Refactor of allowing virtual displays to HWC
1. Since SF doesnt invoke blank for virtual display,
handle pipe clean up as part of Primary display
blank.
2. Support virtual display to query display attributes.
This refactor is done to address Framework reboot issue.
Change-Id: I266a87228193fd85252a22242b66dd4af5f3033f
This commit is contained in:
@@ -88,7 +88,7 @@ static void hwc_registerProcs(struct hwc_composer_device_1* dev,
|
||||
//Helper
|
||||
static void reset(hwc_context_t *ctx, int numDisplays,
|
||||
hwc_display_contents_1_t** displays) {
|
||||
for(int i = 0; i < MAX_DISPLAYS; i++) {
|
||||
for(int i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
|
||||
hwc_display_contents_1_t *list = displays[i];
|
||||
// XXX:SurfaceFlinger no longer guarantees that this
|
||||
// value is reset on every prepare. However, for the layer
|
||||
@@ -105,8 +105,6 @@ static void reset(hwc_context_t *ctx, int numDisplays,
|
||||
ctx->mFBUpdate[i]->reset();
|
||||
if(ctx->mCopyBit[i])
|
||||
ctx->mCopyBit[i]->reset();
|
||||
if(ctx->mLayerRotMap[i])
|
||||
ctx->mLayerRotMap[i]->reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,8 +517,9 @@ int hwc_getDisplayConfigs(struct hwc_composer_device_1* dev, int disp,
|
||||
ret = 0; //NO_ERROR
|
||||
break;
|
||||
case HWC_DISPLAY_EXTERNAL:
|
||||
case HWC_DISPLAY_VIRTUAL:
|
||||
ret = -1; //Not connected
|
||||
if(ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].connected) {
|
||||
if(ctx->dpyAttr[disp].connected) {
|
||||
ret = 0; //NO_ERROR
|
||||
if(*numConfigs > 0) {
|
||||
configs[0] = 0;
|
||||
@@ -536,8 +535,8 @@ int hwc_getDisplayAttributes(struct hwc_composer_device_1* dev, int disp,
|
||||
uint32_t config, const uint32_t* attributes, int32_t* values) {
|
||||
|
||||
hwc_context_t* ctx = (hwc_context_t*)(dev);
|
||||
//If hotpluggable displays are inactive return error
|
||||
if(disp == HWC_DISPLAY_EXTERNAL && !ctx->dpyAttr[disp].connected) {
|
||||
//If hotpluggable displays(i.e, HDMI, WFD) are inactive return error
|
||||
if( (disp >= HWC_DISPLAY_EXTERNAL) && !ctx->dpyAttr[disp].connected) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -591,7 +590,7 @@ void hwc_dump(struct hwc_composer_device_1* dev, char *buff, int buff_len)
|
||||
dumpsys_log(aBuf, "Qualcomm HWC state:\n");
|
||||
dumpsys_log(aBuf, " MDPVersion=%d\n", ctx->mMDP.version);
|
||||
dumpsys_log(aBuf, " DisplayPanel=%c\n", ctx->mMDP.panel);
|
||||
for(int dpy = 0; dpy < MAX_DISPLAYS; dpy++) {
|
||||
for(int dpy = 0; dpy < HWC_NUM_DISPLAY_TYPES; dpy++) {
|
||||
if(ctx->mMDPComp[dpy])
|
||||
ctx->mMDPComp[dpy]->dump(aBuf);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ void initContext(hwc_context_t *ctx)
|
||||
MDPComp::getObject(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres,
|
||||
rightSplit, HWC_DISPLAY_PRIMARY);
|
||||
|
||||
for (uint32_t i = 0; i < MAX_DISPLAYS; i++) {
|
||||
for (uint32_t i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
|
||||
ctx->mHwcDebug[i] = new HwcDebug(i);
|
||||
ctx->mLayerRotMap[i] = new LayerRotMap();
|
||||
}
|
||||
@@ -199,7 +199,7 @@ void closeContext(hwc_context_t *ctx)
|
||||
ctx->mRotMgr = NULL;
|
||||
}
|
||||
|
||||
for(int i = 0; i < MAX_DISPLAYS; i++) {
|
||||
for(int i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
|
||||
if(ctx->mCopyBit[i]) {
|
||||
delete ctx->mCopyBit[i];
|
||||
ctx->mCopyBit[i] = NULL;
|
||||
@@ -216,7 +216,7 @@ void closeContext(hwc_context_t *ctx)
|
||||
ctx->mExtDisplay = NULL;
|
||||
}
|
||||
|
||||
for(int i = 0; i < MAX_DISPLAYS; i++) {
|
||||
for(int i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
|
||||
if(ctx->mFBUpdate[i]) {
|
||||
delete ctx->mFBUpdate[i];
|
||||
ctx->mFBUpdate[i] = NULL;
|
||||
|
||||
@@ -35,10 +35,6 @@
|
||||
#define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false ))
|
||||
#define MAX_NUM_APP_LAYERS 32
|
||||
|
||||
// For support of virtual displays
|
||||
#define HWC_DISPLAY_VIRTUAL (HWC_DISPLAY_EXTERNAL+1)
|
||||
#define MAX_DISPLAYS (HWC_NUM_DISPLAY_TYPES+1)
|
||||
|
||||
//Fwrd decls
|
||||
struct hwc_context_t;
|
||||
|
||||
@@ -305,7 +301,7 @@ struct hwc_context_t {
|
||||
const hwc_procs_t* proc;
|
||||
|
||||
//CopyBit objects
|
||||
qhwc::CopyBit *mCopyBit[MAX_DISPLAYS];
|
||||
qhwc::CopyBit *mCopyBit[HWC_NUM_DISPLAY_TYPES];
|
||||
|
||||
//Overlay object - NULL for non overlay devices
|
||||
overlay::Overlay *mOverlay;
|
||||
@@ -313,16 +309,16 @@ struct hwc_context_t {
|
||||
overlay::RotMgr *mRotMgr;
|
||||
|
||||
//Primary and external FB updater
|
||||
qhwc::IFBUpdate *mFBUpdate[MAX_DISPLAYS];
|
||||
qhwc::IFBUpdate *mFBUpdate[HWC_NUM_DISPLAY_TYPES];
|
||||
// External display related information
|
||||
qhwc::ExternalDisplay *mExtDisplay;
|
||||
qhwc::MDPInfo mMDP;
|
||||
qhwc::VsyncState vstate;
|
||||
qhwc::DisplayAttributes dpyAttr[MAX_DISPLAYS];
|
||||
qhwc::ListStats listStats[MAX_DISPLAYS];
|
||||
qhwc::LayerProp *layerProp[MAX_DISPLAYS];
|
||||
qhwc::MDPComp *mMDPComp[MAX_DISPLAYS];
|
||||
qhwc::HwcDebug *mHwcDebug[MAX_DISPLAYS];
|
||||
qhwc::DisplayAttributes dpyAttr[HWC_NUM_DISPLAY_TYPES];
|
||||
qhwc::ListStats listStats[HWC_NUM_DISPLAY_TYPES];
|
||||
qhwc::LayerProp *layerProp[HWC_NUM_DISPLAY_TYPES];
|
||||
qhwc::MDPComp *mMDPComp[HWC_NUM_DISPLAY_TYPES];
|
||||
qhwc::HwcDebug *mHwcDebug[HWC_NUM_DISPLAY_TYPES];
|
||||
|
||||
// No animation on External display feature
|
||||
// Notifies hwcomposer about the device orientation before animation.
|
||||
@@ -347,7 +343,7 @@ struct hwc_context_t {
|
||||
int mExtOrientation;
|
||||
//Flags the transition of a video session
|
||||
bool mVideoTransFlag;
|
||||
qhwc::LayerRotMap *mLayerRotMap[MAX_DISPLAYS];
|
||||
qhwc::LayerRotMap *mLayerRotMap[HWC_NUM_DISPLAY_TYPES];
|
||||
};
|
||||
|
||||
namespace qhwc {
|
||||
|
||||
Reference in New Issue
Block a user