Set priority among various display devices

* When a non-WFD virtual display device (SSD/
screenrecord) is active along with
non-hybrid WFD solution(WFD faked on
external), give preference to non-hybrid WFD
device over non-WFD virtual display device.

* This is needed only in cases when WFD is
enabled via v4l2 rather than using VDS api's.

Change-Id: I63e53baa214bdcdac19430ca30b939cdd7416cbb
This commit is contained in:
Raj Kamal
2014-01-27 19:35:13 +05:30
parent 8bb48d3314
commit 52b4fdbdbd
6 changed files with 54 additions and 14 deletions

View File

@@ -188,6 +188,7 @@ void initContext(hwc_context_t *ctx)
ctx->vstate.enable = false;
ctx->vstate.fakevsync = false;
ctx->mExtOrientation = 0;
ctx->numActiveDisplays = 1;
//Right now hwc starts the service but anybody could do it, or it could be
//independent process as well.
@@ -1910,6 +1911,32 @@ void reset_layer_prop(hwc_context_t* ctx, int dpy, int numAppLayers) {
ctx->layerProp[dpy] = new LayerProp[numAppLayers];
}
/* Since we fake non-Hybrid WFD solution as external display, this
* function helps us in determining the priority between external
* (hdmi/non-Hybrid WFD display) and virtual display devices(SSD/
* screenrecord). This can be removed once wfd-client migrates to
* using virtual-display api's.
*/
bool canUseMDPforVirtualDisplay(hwc_context_t* ctx,
const hwc_display_contents_1_t *list) {
/* We rely on the fact that for pure virtual display solution
* list->outbuf will be a non-NULL handle.
*
* If there are three active displays (which means there is one
* primary, one external and one virtual active display)
* we give mdss/mdp hw resources(pipes,smp,etc) for external
* display(hdmi/non-Hybrid WFD display) rather than for virtual
* display(SSD/screenrecord)
*/
if(list->outbuf and (ctx->numActiveDisplays == HWC_NUM_DISPLAY_TYPES)) {
return false;
}
return true;
}
void BwcPM::setBwc(hwc_context_t *ctx, const hwc_rect_t& crop,
const hwc_rect_t& dst, const int& transform,
ovutils::eMdpFlags& mdpFlags) {