Only modify pending_flips for flips

The following commit is copied from chromeos xf86-video-armsoc
https://chromium.googlesource.com/chromiumos/third_party/xf86-video-armsoc/+/c04f8b8%5E%21/

Change-Id: Iaa29210066c835ce30826a6ca34073aca72e0825
Fix leak in OMAPProbe if xf86AllocateScreen() fails

Fixes the leak of devSections and fd.

Note: The previous version of OMAPProbe returned FALSE if *any*
xf86AllocateScreen() fails. This version returns TRUE if at least one
instance is successfully claimed.  It should be ok to only allocate
and claim some of the screens that were specified by xorg.conf "Device"
sections.

TODO: Opening fd with OMAPOpenDRM() and closing it with drmClose() is a
mismatch.  Better would be to:
 * open with one of drmOpen*()
 * open with open() and close with close()
 * introduce a new OMAPCloseDRM()
But, any of these would require a separate patch.

BUG=none
TEST=builds clean; sanity check ui

(cherry picked from commit e4f165c9551f883f2dddec7165e557662786f526)
From: https://chromium.googlesource.com/chromiumos/third_party/xf86-video-armsoc

Change-Id: I2d41d79eb4e7573f146b585afc9ba7a86508a4b5
[picked] Fix malloc/calloc/free usage
[picked] Report damage for drawable in ARMSOCDRI2ScheduleSwap
Added HWCURSOR_API_NONE to the platform specific hwcursor api.

New option allows a software-only cursor to be specified

Change-Id: Ice4bd122ab6b24146d50dcd497a9a70831fc1274
Version change to 0.7.0

Change-Id: Ib7e9c3632f6a2766a810a93eef8bb6ee3a0e9f5a
Fallback to 24 bit depth if 32 bit depth is not supported.

If the DRM does not support 32 bit depth at 32 bpp we fallback
to 24 bit depth at 32 bpp. The display controller will effectively
ignore the alpha channel.

Change-Id: Ia142aa50a1d22f6ff3d99e3b45f87273d9f6f953
Removed 24 bit visual - we use 32 bit visuals for RGB888.

Change-Id: Ie9464b9dd9bbe4c1f13bbb2e6a327f2424d4b937
Clarify assumptions on window front buffer pixmaps

We assume that a window's front buffer pixmap won't be reallocated
from beneath us. This commit updates a comment to reflect this
assumption.

Change-Id: Ic1ddc508dee8b1696643dd418ddb466fbce9d8fb
[picked] build fixes
[picked] Enabling n-buffering support when using page flip events.

http://cgit.freedesktop.org/xorg/driver/xf86-video-armsoc/commit/?id=1d13da045ced12a123db184fff677b0de41d80e6

memeka's comments: with these changes, xfwm now works well but metacity wm for opengl es applications has the wrong color.
Fixed a memory corruption issue.

Commit 36c7ca0 "Fix malloc/calloc/free usage" introduced
a wrongly sized allocation which could cause memory
corruption.

Change-Id: I5693e7cd952fbb811a09caf251dbeb8bd23b490a
[picked] Minor tidy ups.
Version updated to 1.0.0

Change-Id: I50807f9a1d6d46a10b9efc69809be8a562db261a
Implemented crtc dpms handling via drmmode_crtc_dpms()

Change-Id: I8fd0ab095aec0599368ecb3a26832fdc3b2568f9
[picked] Reviewed and revised bo reference counting.

http://cgit.freedesktop.org/xorg/driver/xf86-video-armsoc/commit/?id=bbb82b80b47b52763fa8a58b68e2d9689d68cd71
Removed bad assert

In ModifyPixmapHeader we were asserting that a scratch pixmap's bo
does not have a dmabuf. We neglected to check whether the scratch
pixmap has a bo. If it doesn't this assert caused a segfault.

Change-Id: I9f2eee88f69e9d7c20a3506e618b3eadce716c2a
[picked] XServer crash with multiple applications running at the same time
Fix performance issue when enlightenment started.

Change some logic in ARMSOCDRI2ScheduleSwap(). If src and dst has
same size and they are both no-framebuffer with compositor enabled,
we only need to exchange buffers between src and dst pixmap.

Change-Id: Iba0b3e248589bc8d05f5b52cfb12865790d812a3
fix small initialisation