hwc: Fix black line in center of 4k2k.

1080p Video on 4k TV:
On newer mdp versions we don't need video destination to be even.

Portrait framebuffer on TV:
The framework chops off texels from RGB layers's crop.
Ref: frameworks/native/libs/gui/SurfaceTexture.cpp#616

When we use getNonWormHoleRegion() in HAL on a 4096 width TV,
we get a final rectangle short by 2 pixels on the right.
When we divide this frame in half for displaying using 2 pipes,
we end up not filling up the left layer mixer upto 2048.

Example:
Tv width 4096. (Portrait display on TV)
Dst left = 1440 (left black bar is 1440 pixels wide)
Dst width = 1214 (ideally should be 1216, but because texels are chopped)
4096 - (1440 + 1214) = 1442 (right black bar is 1442 pixels wide)
When the half width (1214/2 = 607) is given to left layer mixer,
its left (1440) + width (607) comes to 2047, leaving 1 pixel out!

--The texel chopping can be gotten rid of but it breaks test cases
in a way which is difficult to fix.
--The other option is to not use getNonWormHole() but to stick the full
framebuffer on display will increase bandwidth.
--Yet another option is to subtract the left rectangle from 2048,
calculating backwards. This change does that.

Change-Id: I17f3bfd1184bbf8a33d116c288d4cc2c51a3911a
2 files changed