disable led while charging

Fixes b/6970382

Change-Id: Idb823059424a0fa1f6382dc01d56c6c4f668c45c
Overlay: Switch the flip for MDP, on 90 rotated source

Camera client doesn't factor in the 90-rotated source when setting the flip
Switch the flips when the source is 90-rotated.

Change-Id: Ia5f18afff4384a33b8ad2ca051be1a120aefa4d5
Acked-by: Kinjal Bhavsar <kbhavsar@codeaurora.org>
hwcomposer : Disable bypass, when connected to external display

Change-Id: I3690e2145967e95a4a8c2fdb5ced34fef6eba639
Acked-by: Ravi Kumar Neti <c_rneti@qualcomm.com>
hwc: qbuf: Add API to unlock all

Add API to unlock all current and previous buffers.
This is essential in suspend cases.

Change-Id: I61c26db2e0e2b3e5e7f526a62a56424a8632f1d8
liboverlay: ensure open fd's are always closed

Ensures that reset and  mFd.Close is always called when MdpCtrl
and MdpData are closed down.

Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>
Change-Id: I775ba7cfe45c67e6acf874e3f4e8b4fa6fbe33b8
Update for cleanups in hwc interface

Also store the hwc_procs_t* into a dedicated field instead of one of
the hwc_composer_device_1_t::reserved_procs slots, which are supposed
to be NULL so the structure can be extended without breaking backwards
binary compatibility.

Change-Id: I11e6bc713958d854aba418242caa749cbcb21f1d
gralloc: Support camera and video encoder flags

- Set private flags for these formats so that the camera HAL
can differentiate between the allocated buffers.
- Usage flags define format

Change-Id: Ib3cfad12ab2ba79662207609138633769b1504e6
liboverlay: Add support for MDSS Rotator.

Acked-by: Sushil Chauhan <sushilchauhan@codeaurora.org>

Change-Id: I60a2b0ce2b491d03b2b1a04966113e253b7f3dd8
liboverlay: Changes in getting FrameBufferInfo on MDSS.

- MSMFB_OVERLAY_GET does not need to be called.
- MDSS always supports border fill.

Acked-by: Sushil Chauhan <sushilchauhan@codeaurora.org>

Change-Id: I04afc5119b2467eb026b11b6f558cca21b5454c7
hwc/fb/overlay: wait for fbpost and pan display

Draw sequence in hwc_set
--eglSwapBuffers
--wait for fb_post. Its ok to draw to External only at this point.
--draw to external   | Parallel with PAN
--commit to external | Parallel with PAN
--wait for pan (happening in fb_post) to finish.

Call MSMFB_OVERLAY_SET ioctl only when params change.

These thing together ensure a correct sequence and should fix tearing and
stuttering, the latter assuming there are no other display pipeline delays.

Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>

Change-Id: Ibb0ad8485fa6b30dc6ac07ae8b25a760941c08ce
hwc: Unlock prev. buffers in N+1th draw round.

Unlock previously locked overlay buffers in N+1th draw round, rather than N+2th.
This is now possible because of wait for PAN.
Provides an opportunity to improve genlock behavior.

Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>

Change-Id: I13d9c39e276918c3d3d27b2f07ed486b27b58441
liboverlay: Adjust values to align with MDP requirement

For YUV only:
Crop rectangle (src_rect) needs to be even for x/y and w/h
Destination dst_rect w/h need to be even (x/y can be odd).

Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>

Change-Id: Ib0c1b7d31773e71d60f080b4beacaa68e32a990e
hwcomposer: keep secure content in an overlay when below skip layer

Secure content can not be displayed unless in an overlay.  Since
getLayerStats marks all layers under the skip layer for framebuffer
composition, when there is a skip layer on top of protected content,
the protected content disappears since surfaceflinger doesn't draw
protected layers.

Acked-by: Amara Venkata Mastan Manoj Kumar <manojavm@codeaurora.org>
Change-Id: I59dd5dffad08dbf578baa459f5f4c726b6674c83
hwc: Fix fps calculation.

Fps is returned directly by the driver. No need of additional calculations.

Change-Id: I17bed4347f094b71340ca39e37b66fbcf9fdba9c
hwc: Do not create copybit.

Do not create copybit instance.
Fix copybit init and deinit sequence.

Change-Id: Ia669f4cc89c85294a040400a750aa72a93e579b8
Gralloc: Fall back to HW_CAMERA_WRITE if HW_VIDEO_ENCODER is not set.

In both video encoding and camera preview cases, HW_CAMERA_WRITE will
be set. This is a hack so that if HW_VIDEO_ENCODER is set, allocate
NV12 format; otherwise, allocate NV21 format.

Change-Id: I61dc96b125e026159f55048cb79783578832460a
gralloc: Check for HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED

Check for HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED before assigning format based
on usage bits.

Change-Id: Ie140f3f8a7002febc2fab729686d646b349c3b75
overlay: Remove OVASSERT from getFormatString utility

Remove OVASSERT from getFormatString utility. OVASSERTS should happen only from
critically wrong states of overlay.
Just failing in this utility method would allow a fall back to GPU.

Change-Id: I4467a750574ee90aee4fa2e0fbb041e7f386a63b
Overlay: Change MDP format for YV12 buffers

   Android uses different alignments for YV12 buffers.
   Hence, introduce a new format (MDP_Y_CR_CB_GH2V2) for
   such buffers.

Acked-by: Amara Venkata Mastan Manoj Kumar <manojavm@codeaurora.org>
Change-Id: Id4d58dd77f22c9efb8ece9caa34a8717964bf58d
hwc: video: Create crop and position structs only once.

Create crop and position structs only once.
Fix bug where x and y were not updated.

Change-Id: I7c6a873ba207997baa302b8999bdaf34cc938dba