SF: Support to determine if the non-virtual displays are secure

- Non virtual displays can be secure/non-secure
- Add a hook to query this info from the HWC.
- This info will be used by the clients/apps which want to present
  content only to physical displays that are secure
- HDMI is considered secure if it supports HDCP

Change-Id: I632e2fa2c8d9a75258a92043c1680fa4e05a354c
sf: Block SIGPIPE signal to avoid crash

Block SIGPIPE signal in surfaceflinger process during initialization.
This is required to avoid SIGPIPE crash when client closes the read
pipe fd in the other end.

Change-Id: I329d63ae9630c3dd76000d3b64d425a463c742e4
libgui: Handle createGraphicBuffer binder transcation failure

Return proper error value if remote binder transaction of
createGraphicBuffer fails.

Change-Id: Ia77f8379121b109ff4bc023a95e058d6f5c60208
SF: Add support for inverse mounted panels

Add 180 rotation in SF to account for inverse mounted panels.
The framework will be unaffected and use policies for a 0 mounted
panel. SF changes the global transform and silently induces the H,V
flips. Similar flips are added to screenshots as well.

Change-Id: I6e9576ee734ee85097491eaa1e8e94cfb3731e0f
InputDispatcher: Optimize count()

Count items as they are added and removed rather than iterating over the
entire list to count them.

Increases performance slightly, particularly when tracing is turned on,
which causes count to be queried more often, and when the number of
items in the queues grow large.  This can happen due to applications not
responding, for example.

Change-Id: I0f11f7edd46089612af910cdfabfeb3ee685d7d9
Add missing glFlush call

According to EGL_ANDROID_native_fence_sync specification,
glFlush should be called to make a new native fence object created
after eglCreateSyncKHR is called.

Change-Id: Ifea69d3c3bca27aef246e1b7baaae6e962257f1e
libgui: fix test after compatibility patches

Change-Id: Iae7333f025bb0271f008e4cc0356cf704800f1b7
surfaceflinger: Add ifdefs for secure display query

 * The HWC_SECURE feature is only implemented for devices using
   QC-CAF hwcomposers.

Change-Id: I1aa72864ba6a0e62fd7cee74631b57200db3db4f
Merge branch 'cm-12.0' of https://github.com/CyanogenMod/android_frameworks_native into cm-12.0