hwc: split display: Fix left split default value if not published
If the left split is not published by the driver then the default should be even split. This was missing from the configuration in utils. This is already taken care of in framebuffer configuration and mdp composition. Change-Id: I3db44481fd791809146752ddff56420dcbe89fb4
This commit is contained in:
@@ -288,16 +288,8 @@ bool FBUpdateHighRes::configure(hwc_context_t *ctx,
|
|||||||
hwc_rect_t displayFrame = layer->displayFrame;
|
hwc_rect_t displayFrame = layer->displayFrame;
|
||||||
|
|
||||||
const float xres = ctx->dpyAttr[mDpy].xres;
|
const float xres = ctx->dpyAttr[mDpy].xres;
|
||||||
//Default even split for all displays with high res
|
const int lSplit = getLeftSplit(ctx, mDpy);
|
||||||
float lSplit = xres / 2;
|
|
||||||
if(mDpy == HWC_DISPLAY_PRIMARY &&
|
|
||||||
qdutils::MDPVersion::getInstance().getLeftSplit()) {
|
|
||||||
//Override if split published by driver for primary
|
|
||||||
lSplit = qdutils::MDPVersion::getInstance().getLeftSplit();
|
|
||||||
}
|
|
||||||
|
|
||||||
const float lSplitRatio = lSplit / xres;
|
const float lSplitRatio = lSplit / xres;
|
||||||
|
|
||||||
const float lCropWidth =
|
const float lCropWidth =
|
||||||
(sourceCrop.right - sourceCrop.left) * lSplitRatio;
|
(sourceCrop.right - sourceCrop.left) * lSplitRatio;
|
||||||
|
|
||||||
|
|||||||
@@ -980,13 +980,8 @@ int MDPCompHighRes::pipesNeeded(hwc_context_t *ctx,
|
|||||||
int mixer) {
|
int mixer) {
|
||||||
int pipesNeeded = 0;
|
int pipesNeeded = 0;
|
||||||
const int xres = ctx->dpyAttr[mDpy].xres;
|
const int xres = ctx->dpyAttr[mDpy].xres;
|
||||||
//Default even split for all displays with high res
|
|
||||||
int lSplit = xres / 2;
|
const int lSplit = getLeftSplit(ctx, mDpy);
|
||||||
if(mDpy == HWC_DISPLAY_PRIMARY &&
|
|
||||||
qdutils::MDPVersion::getInstance().getLeftSplit()) {
|
|
||||||
//Override if split published by driver for primary
|
|
||||||
lSplit = qdutils::MDPVersion::getInstance().getLeftSplit();
|
|
||||||
}
|
|
||||||
|
|
||||||
for(int i = 0; i < mCurrentFrame.layerCount; ++i) {
|
for(int i = 0; i < mCurrentFrame.layerCount; ++i) {
|
||||||
if(!mCurrentFrame.isFBComposed[i]) {
|
if(!mCurrentFrame.isFBComposed[i]) {
|
||||||
@@ -1028,13 +1023,7 @@ bool MDPCompHighRes::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
|
|||||||
MdpPipeInfoHighRes& pipe_info,
|
MdpPipeInfoHighRes& pipe_info,
|
||||||
ePipeType type) {
|
ePipeType type) {
|
||||||
const int xres = ctx->dpyAttr[mDpy].xres;
|
const int xres = ctx->dpyAttr[mDpy].xres;
|
||||||
//Default even split for all displays with high res
|
const int lSplit = getLeftSplit(ctx, mDpy);
|
||||||
int lSplit = xres / 2;
|
|
||||||
if(mDpy == HWC_DISPLAY_PRIMARY &&
|
|
||||||
qdutils::MDPVersion::getInstance().getLeftSplit()) {
|
|
||||||
//Override if split published by driver for primary
|
|
||||||
lSplit = qdutils::MDPVersion::getInstance().getLeftSplit();
|
|
||||||
}
|
|
||||||
|
|
||||||
hwc_rect_t dst = layer->displayFrame;
|
hwc_rect_t dst = layer->displayFrame;
|
||||||
pipe_info.lIndex = ovutils::OV_INVALID;
|
pipe_info.lIndex = ovutils::OV_INVALID;
|
||||||
|
|||||||
@@ -1090,7 +1090,8 @@ int configureHighRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
|||||||
hwc_rect_t tmp_cropL, tmp_dstL;
|
hwc_rect_t tmp_cropL, tmp_dstL;
|
||||||
hwc_rect_t tmp_cropR, tmp_dstR;
|
hwc_rect_t tmp_cropR, tmp_dstR;
|
||||||
|
|
||||||
const int lSplit = qdutils::MDPVersion::getInstance().getLeftSplit();
|
const int lSplit = getLeftSplit(ctx, dpy);
|
||||||
|
|
||||||
if(lDest != OV_INVALID) {
|
if(lDest != OV_INVALID) {
|
||||||
tmp_cropL = crop;
|
tmp_cropL = crop;
|
||||||
tmp_dstL = dst;
|
tmp_dstL = dst;
|
||||||
@@ -1166,6 +1167,16 @@ bool canUseRotator(hwc_context_t *ctx) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getLeftSplit(hwc_context_t *ctx, const int& dpy) {
|
||||||
|
//Default even split for all displays with high res
|
||||||
|
int lSplit = ctx->dpyAttr[dpy].xres / 2;
|
||||||
|
if(dpy == HWC_DISPLAY_PRIMARY &&
|
||||||
|
qdutils::MDPVersion::getInstance().getLeftSplit()) {
|
||||||
|
//Override if split published by driver for primary
|
||||||
|
lSplit = qdutils::MDPVersion::getInstance().getLeftSplit();
|
||||||
|
}
|
||||||
|
return lSplit;
|
||||||
|
}
|
||||||
|
|
||||||
void BwcPM::setBwc(hwc_context_t *ctx, const hwc_rect_t& crop,
|
void BwcPM::setBwc(hwc_context_t *ctx, const hwc_rect_t& crop,
|
||||||
const hwc_rect_t& dst, const int& transform,
|
const hwc_rect_t& dst, const int& transform,
|
||||||
|
|||||||
@@ -225,6 +225,8 @@ int configureHighRes(hwc_context_t *ctx, hwc_layer_1_t *layer, const int& dpy,
|
|||||||
//but the variety of scenarios is too high to warrant that.
|
//but the variety of scenarios is too high to warrant that.
|
||||||
bool canUseRotator(hwc_context_t *ctx);
|
bool canUseRotator(hwc_context_t *ctx);
|
||||||
|
|
||||||
|
int getLeftSplit(hwc_context_t *ctx, const int& dpy);
|
||||||
|
|
||||||
// Inline utility functions
|
// Inline utility functions
|
||||||
static inline bool isSkipLayer(const hwc_layer_1_t* l) {
|
static inline bool isSkipLayer(const hwc_layer_1_t* l) {
|
||||||
return (UNLIKELY(l && (l->flags & HWC_SKIP_LAYER)));
|
return (UNLIKELY(l && (l->flags & HWC_SKIP_LAYER)));
|
||||||
|
|||||||
Reference in New Issue
Block a user