hwc: Handle more events from driver.

In certain cases, such as the shutdown sequence, the driver may
blank itself without any direction from SurfaceFlinger.
In such cases the HWC should make sure that no further updates on
the display occur.
Handle events from driver in a more generic way to include blank
events and leave room for any other events that need to be polled
on from the driver.

Change-Id: I0aab9f30046f07ca9c90c73cadabcadc150565c8
CRs-fixed: 627814
display: set compiler option to print all warning messages

- Remove -Werror which would stop compilation, instead add -Wall
and -Wconversion, which would still print out the warning messages.
- Helps in fixing the warnings without breaking the compilation

Change-Id: Iffa4687a267d405a3011521f0882a9aefd88b5ce
copybit: Use proper type casts and pointers

- Remove unused variables
- Use proper type casts for pointers.

Change-Id: Ie07c67d759d76f418fae08accdcfb1855511dedf
hqd: Adjust resolution based on aspect ratio

When the MDP downscale path is enabled we assign the primary
resolution as the external display's dimensions. However, the
aspect ratios of the external and primary displays can be different.
As a result, directly assigning primary resolution could lead
to an incorrect final image.

We get around this by calculating a new resolution by
keeping aspect ratio intact.

Change-Id: I217718a5474862154fe60837fc6518408d2c32c7
hwc: Enable downscale feature through system property

Add support to turn the MDP downscale feature ON through the
use of a system property. 'sys.hwc.mdp_downscale_enabled' shall be
set to 'true' in build.prop file to enable this functionality.

This is required for OEMs that might have privacy concerns over panel
size information being exposed.

Change-Id: I354b25b1fdabe5786aed7552f2afccda35412467
gralloc: Set colorspace in the metadata

Since camera now uses the metadata to store the color space,
store the default color space values here as well instead of
storing in the flags.

Change-Id: I11ee84f391a8ee9d06267aa05645fa9467dc23a6
hqd: Add support for 565 macro tile format

Extend macro tile feature support to rgb565 format.

Change-Id: I3d696d1ec66bfd95fcf3d243a1d669cb074da77f
libgralloc: Invoke adreno for ASTC format padding.

Invoke adreno util API to calculate padding bytes for ASTC
formats.

Change-Id: I96af0199a0029786fd2975a7c002d5414c797521
libgralloc: use proper types and type casts

- Use proper types for pointers
- Resolve compiler errors
- handle proper type casts
- remove unused variables

Change-Id: I628ebe174485d30abadea4ca40b67f9aab1a0652
gralloc: Add support for lock_ycbcr

Fill the android_ycbcr struct for HAL_PIXEL_FORMAT_YCbCr_*_888
formats.
This is a flexible YUV format that allows gralloc to set a
hardware specific YUV format based on the usage flags passed in.
Here we set the format similar to how we set the implementation
defined format and set the android_ycbcr structure to point to
the appropriate plane offsets.
Reference:  HAL_PIXEL_FORMAT_YCbCr_420_888 definition in
system/core/include/system/graphics.h

Change-Id: If0c7abf5e206bf982ad333da2dae57cbac302733
gralloc: Perform func to return stride and height

The custom stride and height can be set by video
decoder for smooth streaming. Return this in
perform so that graphics can use it

Change-Id: I44c814b2bae1f61d3ec5c36a22d1c6119542b10a
libgralloc: include <sys/ioctl.h>

- In ionalloc.cpp, include <sys/ioctl.h> instead of <linux/ioctl.h>, in
  the similar way as other HAL libraries are including.
- Helps in resolving compilation warnings

Change-Id: I9068e1e2dd97ce580aeecc25f611900127502fc7
gralloc: add GRALLOC_MODULE_PERFORM_GET_COLOR_SPACE_FROM_HANDLE

Provide query for graphics to determine the color space.

Change-Id: Ib710f44845f7449db6c62906b424d4a1b54400cb
libvirtual: Fix logic to detect DRC use case

We detect DRC based on the resolution of the external display. If the
external display has non-zero width/height then we know it was
previously configured during the same session and is going for DRC.

Change-Id: Iaa0b112370a95f2719738c991411776dcfe17f88
hwc: Fix for HDMI video playback out of boundary in portrait.

Fix for out of boundary video playback issue on HDMI where HDMI
resolution is lower than primary resolution.

Change-Id: I4271471cda87e1e3d3805ace8b8723a91979a160
hwc: set mModeOn flag for fbupdate properly

Set mModeOn flag for fbupdate to false if validateAndSet function
fails, so that queueBuffer can be avoided for prepare failure.

Change-Id: Ifcc7a16caf8779f13411ae2a9eeeec6e6c846f4c
libqdutils: Update panel capabilities from sys node

This change adds support to read more panel related informations
from sys node.

Change-Id: I64f37a35945ac700388335059cbb1cfbc9d4b4d7
h/q/d: Invoke padding when DMA is not availble for ext rotator

This change invokes padding round when DMA is used in line mode
and rotator is needed for external display.

Change-Id: I1fef1a988d96695748d79d23b7927844eea237fe
CRs-Fixed: 632069
hwc: Color layer always has zero transform.

Color layer always has zero transform because framework uses the
transform member of hwc layer to pass the color value to HAL.

Change-Id: I79fe204c558d1b6e1dd69ba635ba0bd87140b1b1