libcopybit: Enable premultiplied alpha support

Premultiplied alpha is now supported on MDP3.x.
Enable it from userspace.
Also make flags as int since values are exceeding 255(uint8_t).

CRs-fixed: 347803
(cherry picked from commit 3dcbcb1f8672067f85e2f53e6321c27df6d6fbe6)

Change-Id: I865379b368726e95cab7aa669fbf27d5207240c5
Merge "libcopybit: Enable premultiplied alpha support" into ics_chocolate
libgralloc: fb size alignment to pagesize

Align framebuffer size and offset to pagesize, calculate
framebuffer size based on this alignment and use it for
mapping framebuffer in userspace and page flipping.

CRs-fixed: 332175

(cherry picked from commit d89b0493b4651fbaaeccccf0ae880cbf1a3a3479)

Change-Id: I7840f7f3c5c42852087cb9df6ae85680c971c601
libgralloc: fix the calculation of fb virtual y resolution

calculate the yresolution virtual according to the hole
introduced by 4k alignment of frame buffer.

CRs-fixed: 325134

(cherry picked from commit 464443a5d3b216e06e644d0e41c234490c3c46c2)

Change-Id: Id7a93e11e2f3c1d52a26ec3669a9d710c369bf41
libhwcomposer: Implement idletimeout fallback for MDP composition .

Background: On MDP compositon, MDP keeps reading contents from the
pipes even on Idle Screen i.e. even when HWC is not queueing any new
buffers to MDP. Above data traffic leads to high power consumption.

Implementation: This change introduces a timer in HWC which will
timeout if there are no updates in bypass composition path for
the period specified via debug.bypass.idletime. Also SurfaceFlinger
will be notified to redraw the current frame which will be composed
into FB.

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: Ic3a467596068fa553271b5cd8c2831e544e3211d
(cherry picked from commit ad1d9a019234ab03dbc79b1ddb73c86e560e3e74)

Conflicts:

	libhwcomposer/hwcomposer.cpp
liboverlay: set correct flags for external display channel

When external display is connected during video playback, the
flags to overlay was not set properly.
Pass the flags which comes from the hwc, by just changing the
WAIT_FOR_VSYNC(external should not wait for vsync)

(cherry picked from commit 857cfcba2d120d5da4916c7cb4fe119a08d1ce68)

Change-Id: I13100bebd223780eb9c709f384f0e4644e8295dc
hwcomposer: fix blank screen on external display.

fixes the black screen when external display is connected
during bypass and when video is paused.

(cherry picked from commit 2ffc188a6cad26a347e565211564640173f340ac)

Change-Id: I6caeda8bbc744a45164e2ae139345ba4aab55dab
CRs-fixed: 346284
Merge "hwcomposer: fix blank screen on external display." into ics_chocolate
liboverlay: Remove evening-out of layer destination coords.

Evening-out of layer destination coords causes a noticeable up & down
shift in the screen when video layer drawing switches between Overlay
and GPU. This is most easily observed during video playback or pause,
when a UI layer (like Menu) is displayed / hidden. Remove evening-out
of layer destination coords to fix the video layer "twitching" issue.

Change-Id: I3f43b53a7609c9ad8cc983c353fba6dc97460158
CRs-fixed: 348856 350073
qcom/display: Add support for video rotation on HDMI

- Enable rotator for HDMI for video
- cleanup updateOverlaySource API, it does not need
  orientation info

Change-Id: Id53a42cbc4265015ea2714d25df1b02af60ee5e4
CRs-fixed: 341691, 330719, 342199, 344308
liboverlay: Call overlay set ioctl, only if input params change.

Change-Id: I753c30be4062be10655d7072c795052ef65f87ae

Conflicts:

	liboverlay/overlayLibUI.cpp
Fix secure flags value in overlay.

Remove the member "secure" from overlay_buf_info.
This member was used to indicate secure content and this info was
later extracted out into existing flags. Now we use the same flags,
right from hwc to mark secure content.

The member above had junk value, since it wasnt initialized.
This caused, normal videos to fail with IOMMU. Removal of the member and
marking the existing flags fixes this.

Change-Id: Ib5a2439fde7114c20e478fbee5e4d276680c316a
liboverlay: check for flip when rotating 90 or 270 deg

- In setTransform, when rotating to 90 or 270 deg, also consider
  the case of current flip values(if any)
- This is needed when switching b/w front camera/back camera/
  camcorder

Change-Id: Ieae8f90438dda24006ede4cf925acf46ecec5b32
(cherry picked from commit c5defdb54862490c502f255d7811cf73b8962b8d)
libcopybit: Fix source stride for software YUV buffer copy.

Incorrect source stride setting for software YUV buffer copy causes
the software converter used by apps like Video Telephony app to
crash. Correct the source stride setting passed to YUV buffer memcpy.

CRs-Fixed: 346928
(cherry picked from commit db92bedc081365e447233bbdd6e070e88a5cbc19)

Change-Id: I5edf7ff4d38e8b55eece9e856adeeab972e80fa0
Merge commit '719f492d9261829faf34a589d7b2d30d119bdc59' into ics