Skip to content

Commit

Permalink
Revert "Revert "liboverlay: fix mdp and rotator color formats""
Browse files Browse the repository at this point in the history
This reverts commit 8d1a92b.
Turned out to be a kernel-side failure on both tested devices.
msm's kernel-3.0 swaps the R/B channels as of commit
8b5f9dbb7a6da665769ce478b93de7ac61f0d81d (msm_fb: display: fix
incorrect MDP formats components unpack pattern), and was
incompatible with this revert.

Change-Id: I9c58c08b18d00e91184d3bc4c2744851ba5dfa3e
  • Loading branch information
rmcc committed Mar 26, 2012
1 parent 8b02643 commit df46884
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions liboverlay/overlayLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ int overlay::get_mdp_format(int format) {
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
return MDP_Y_CBCR_H2V1;
case HAL_PIXEL_FORMAT_YCbCr_420_SP:
return MDP_Y_CRCB_H2V2;
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
return MDP_Y_CBCR_H2V2;
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
return MDP_Y_CRCB_H2V2;
case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
return MDP_Y_CRCB_H2V2_TILE;
return MDP_Y_CBCR_H2V2_TILE;
case HAL_PIXEL_FORMAT_YV12:
return MDP_Y_CR_CB_GH2V2;
default:
Expand Down Expand Up @@ -1220,7 +1220,7 @@ bool OverlayControlChannel::setOverlayInformation(const overlay_buffer_info& inf
mOVInfo.dst_rect.y = 0;
mOVInfo.dst_rect.w = w;
mOVInfo.dst_rect.h = h;
if(format == MDP_Y_CRCB_H2V2_TILE) {
if(format == MDP_Y_CRCB_H2V2_TILE || format == MDP_Y_CBCR_H2V2_TILE) {
if (mNoRot) {
mOVInfo.src_rect.w = w - ((((w-1)/64 +1)*64) - w);
mOVInfo.src_rect.h = h - ((((h-1)/32 +1)*32) - h);
Expand Down Expand Up @@ -1345,7 +1345,7 @@ bool OverlayControlChannel::startOVRotatorSessions(
mRotInfo.src_rect.h = h;
mRotInfo.dst.width = w;
mRotInfo.dst.height = h;
if(format == MDP_Y_CRCB_H2V2_TILE) {
if(format == MDP_Y_CRCB_H2V2_TILE || format == MDP_Y_CBCR_H2V2_TILE) {
mRotInfo.src.width = (((w-1)/64 +1)*64);
mRotInfo.src.height = (((h-1)/32 +1)*32);
mRotInfo.src_rect.w = (((w-1)/64 +1)*64);
Expand Down Expand Up @@ -1693,29 +1693,23 @@ bool OverlayControlChannel::setTransform(int value, bool fetch) {
mOVInfo.user_data[0] = mdp_rotation;
mRotInfo.rotations = mOVInfo.user_data[0];

/* Rotator always outputs non-tiled formats.
If rotator is used, set Overlay input to non-tiled
Else, overlay input remains tiled */
if (mOVInfo.user_data[0]) {
mOVInfo.src.format = get_rot_output_format(mRotInfo.src.format);
//Always enable rotation for UI mirror usecase
if (mOVInfo.user_data[0] || mUIChannel)
mRotInfo.enable = 1;
}
else {
//We can switch between rotator ON and OFF. Reset overlay
//i/p format whenever this happens
if(mRotInfo.dst.format == mOVInfo.src.format)
mOVInfo.src.format = mRotInfo.src.format;
else
mRotInfo.enable = 0;
//Always enable rotation for UI mirror usecase
if(mUIChannel)
mRotInfo.enable = 1;
}

if (ioctl(mRotFD, MSM_ROTATOR_IOCTL_START, &mRotInfo)) {
reportError("setTransform, rotator start failed");
return false;
}

/* set input format to overlay depending on rotator being used or not */
if (mRotInfo.enable)
mOVInfo.src.format = mRotInfo.dst.format;
else
mOVInfo.src.format = mRotInfo.src.format;

if ((mOVInfo.user_data[0] == MDP_ROT_90) ||
(mOVInfo.user_data[0] == MDP_ROT_270))
mOVInfo.flags |= MDP_SOURCE_ROTATED_90;
Expand Down

0 comments on commit df46884

Please sign in to comment.