surfaceflinger: Set max acquired buffer count

If triple framebuffers are enabled, the number of acquired
buffers isn't increased by default. Set the count to one less
than the max buffers to make sure all three buffers come into
play.

Change-Id: I65054ed4004607f5be68c893f6f621e821cfbf1c
frameworks/native: Fix toroplus radio with CFLAGS

This is a commit to fix the LTE radio on toroplus,
since the binaries contain a broken reference to
an old no longer existent object. This fixes that
with a CFLAGS to be enabled in the .mk files of the
toroplus device files (like BoardConfig.mk).

Credit for the original fix goes to
Sean McClenaghan (cyberkitsune09@gmail.com)
http://review.cyanogenmod.org/#/c/47134/

PS 2-3: forgot some stuff in the commit message

Change-Id: I2c0f05d1f70b96ad801971f23f6f9cf4e0fa7167

Conflicts:
	libs/gui/Android.mk
libs/ui: Fix crash issue because of null pointer access

- handle NULL check is required while flatten GraphicsBuffer

CRs-fixed: 579102

Change-Id: I292b4b25dc1f5320378cc9e4affbad326e1fdaed
SurfaceFlinger: Add NULL check for buffer handling

Add buffer handling NULL check in dequeueBuffer and
verify whether the output data from binder is not NULL
in queueBuffer and connect api's to avoid SF crash

CRs-Fixed: 573088
CRs-Fixed: 572315

Change-Id: I41cebbc0cbcbbb0fd5ecb38db7ec7b0c91cdffe9
SurfaceFlinger: Enable Vsync trace for SF Composition

Enable traces to show s/w vsync which is used for composition
by surfaceflinger, this helps in identifying the start of
composition cycle in systrace

Change-Id: Id892ca03bacd9f0cfe5ca2c3f8bb5aa892b37231
SurfaceFlinger: Change to support framebuffer flip for 2D blitters

- Surfaceflinger does not flip framebuffers when there are
  no layers marked for HWC_FRAMEBUFFER
- This change checks for the HWC_BLIT flag and will request a flip
  to a new FB_TARGET buffer even if there are no FRAMEBUFFER layers

Change-Id: I1cb44389a05c9ec049d7f0d39c288feccb11a91c
Revert "SurfaceFlinger: Change to support framebuffer flip for 2D blitters"

This reverts commit 3c5b9b5c75bc4813b170bf85178b6c8420fac0d3.
C++11 Fixes.