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
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index f1f81c1..b8e6976 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -219,17 +219,19 @@
         ov.setTransform(orient, destR);
 
         hwc_rect_t displayFrame = sourceCrop;
-        //For FB left, top will always be 0
-        //That should also be the case if using 2 mixers for single display
-        ovutils::Dim dposL(displayFrame.left,
+        const int halfWidth = (displayFrame.right - displayFrame.left) / 2;
+        const int height = displayFrame.bottom - displayFrame.top;
+
+        ovutils::Dim dposL(MAX_DISPLAY_DIM - halfWidth,
                            displayFrame.top,
-                           (displayFrame.right - displayFrame.left) / 2,
-                           displayFrame.bottom - displayFrame.top);
+                           halfWidth,
+                           height);
         ov.setPosition(dposL, destL);
+
         ovutils::Dim dposR(0,
                            displayFrame.top,
-                           (displayFrame.right - displayFrame.left) / 2,
-                           displayFrame.bottom - displayFrame.top);
+                           halfWidth,
+                           height);
         ov.setPosition(dposR, destR);
 
         ret = true;