copybit: Enable HAL_PIXEL_FORMAT_RGB_888 support in c2d

Enable HAL_PIXEL_FORMAT_RGB_888 pixel format support in c2d library.

Change-Id: I2316357adb3fef8007bdab4791c94e53d12fa00f
copybit: Enable RB Swap for RGB_888

Enable swapping of R & B color components
for RGB_888 format, otherwise C2D renders
wrong output.

Change-Id: Ib1670418a588e09e8168a04c9f8b8022a84e65e8
CRs-fixed: 672033
hwc: Full MDP Composition mode with overlap region removal

MDP bandwidth limitations can be avoided, if the overlapping region
covered by the smallest layer at a higher z-order, can be composed
on a render buffer using Copybit, and then it can be queued to MDP
along with other layers. It helps to improve performace by avoiding
GPU Composition in use cases like Home Screen pan. To enable this
feature, set system prop "persist.hwc.ptor.enable" to "true" or '1'
and enable Copybit HAL compilation.

Change-Id: I7a241d04316ce24999669a80cd382a7df643c2fb
hwc: Map dirtyRect to layer destination before using.

DirtyRect for a layer is generated w.r.t to its buffer
coordinates. It needs to be mapped for layer destination
(display) coordinates before using it to calculate the frame's
ROI.

Change-Id: Id86f495b2016da2cfd5aed4d86bff6d3035abf10
hwc: source split: Enable BWC for video with width <= mixer width

Enable BWC for videos with crop and position widths <= mixer width.
Source split was earlier used on split panels only, and BWC was
never enabled (It should at least have been for eligible content).
When source split was enabled for all panels, automatically BWC got
disabled for rotated videos. This change fixes that.

Change-Id: I349e782fb6de515ff42fcb137f02cf27c425da56
libgralloc: Set Alignment to 1M only for Secured buffers.

Set Data alignment to 1M only for secureed buffers which
are allocated via MM heap. IOMMU heap allocated buffers
should have buffer alignment of 4k.

Change-Id: I501b35ab103b687f1081338e0c100c29e0b9c4bf
display: Fix binder parcel position

If we call binder APIs from within the same process, the parcels
read position will not be reset at the client end. Also there is
no interface token. Reset the parcel position to zero if the
calling process is the same as the current one.

Change-Id: I6c4499f453dba3ec89b203ce9c86150edaefdbec
gralloc: Fix NV12 and NV21 stride

NV12 spec says that the chroma stride is the same as the luma
stride. The camera hardware produces YUV data per this spec.
NV21 has the same behaviour with the chroma samples reversed.
Venus also conforms to this.

Change-Id: I6e107b2a3ba6f51e135348bd147a9c26be003bb2
gralloc: Align NV21 to 32 pixels

Graphics requires 32 pixel alignment and camera driver is being
updated to this.

Change-Id: I00fe659f7a16abeb8f65d9bbf41a24a7c8113bfb
CRs-fixed: 476475
overlay: Change max rotator sessions to 4 and log level

Change max rotator sessions to 4, since we could support upto
those many.

Change error log to warning log on reaching beyond max rotator
sessions, since its not really an error, but flagging it as one
raises false positives in testing filters.

Change-Id: Ib06a00bce57dfa9dbda3f2e6874a31ce1a155463
overlay: Request specific pipe type

Request driver for a specific pipe type instead of
notifying the type request using mdp flags.

Change-Id: I83fffc7c0e1f24d903b7dd6d52a58b87c70f3d4f
hwc: Avoid MDP draw if prepare is not successful.

If #AppLayers are 0 or exceed MAX_NUM_APP_LAYERS
return early from MDP draw.

Change-Id: I834c7b04a295fbd9b98374cade880992d995ad1f
hwc: Align left and top before aligning width and height

- Align left, top, width and height values based on
panel ROI alignment restrictions and in the same order
as the ROI values of left and top are used for right and
bottom calculations.
- Modify LeftAlign sysfs name to xalign instead of xstart
to align with driver.

Change-Id: I3b815ac5efffe243e7c2f66197d0fb19e6d963bd
hwc: Calculate DPI values according to changed resolution

If dynamic FB feature is enabled, calculate xdpi, ydpi
values based on new resolution.

Change-Id: Icbc8d2161082f60983532d1a57d9142653c65e9a
hwc: Rotate RGB layer using MDP Rotator

1. Use MDP rotator to rotate RGB layers which are rendered by software
2. Restrict total number of rotator sessions to 4 for all displays
3. Disable RGB layer rotation for all MDP versions < MDP5

Change-Id: Ie93111082dff9a16b614e9768df5d8ce83ff9e25
hwc: On downscale check swap on 90 transform

While checking for valid dimensions, take 90 transform into
account while calculating downscales.

b/14225977

Change-Id: Ie8b527c8263a5eb366ae2a4adaa2ffbbf270ba50
hwc/overlay: Fix decimation / bwc bugs

1) While setting BWC check for 90 transform and swap crop
2) Calculate decimation in the getDecimationFactor API itself.
   Currently, a residual downscale is calculated and the clients have
   to take logs and apply forcible decimation like in MdpCtrl
3) Fix bug where transform gets typecasted to bool

b/14225977

Change-Id: I3c99c571e02e2cf7822342516b6a87d97be553d1
hwc: Extend PTOR feature for two layers

- Consider two smallest layers for PTOR feature which uses MDP comp.
- These two layers are rendered on a buffer and are queued to MDP
  to acheive full MDP Composition
- This helps to acheive performance enhancement

Change-Id: I43d9306ff19cd2d7a410c885316523965a44cbd4
libmemtrack: Use kgsl memory flag to determine usermapped buffers

Instead of using useraddr from kgsl memory allocations to be
matched against proc/<pid>/smaps file to be used to determine
usermapping of a buffer, use the newly added flag which directly
indicates whether a given gpubuffer entry is usermapped or
not. The flag is the last character in the "flags" field.

CRs-fixed: 634962
Change-Id: I1f82f7a2ff207eb780f1938a3b1347451b1e3d77
libmemtrack: Use correct format specifier

Remove warnings by using the correct format specifier

Change-Id: I93a1f0a38355d4b501376ed7da2fed41893ac371