hwc: Close release fence fd on buf sync ioctl failure

This change closes the release fence fd in the event that
a failure occurs during the buf sync ioctl. This is additional
sanity to ensure that we are not leaking any fd's in userspace.

Change-Id: Ic303aa2a2ed20244605b0f0bd91145e8f3fc8f1b
(cherry picked from commit 982501357f00d07bb48ba476550a433154bbea11)
copybit: Export c2d header

On open source builds, adreno libs don't get built, due to which
c2d headers aren't exported. Export it from the display HAL.

Change-Id: I6ed1d1fcf3f99ba83d5f194e40d0b42bd7b4d566
(cherry picked from commit 12c08f5dc11a039a0c5b51acc2825b02f1487f88)
copybit: Minor fix in opening copybit device

Proper handing of opening copybit device.

Change-Id: Id54ca463fe34764a1a3ffe90a71d8eec7cfefeb3
(cherry picked from commit 40070f988edfaacd185dbcc0660a844bee6ecdc5)
overlay: Trace all MDP ioctls

Add trace points for all MDP ioctls so that they show up in
systrace.

Change-Id: I4425176c31934963a39b8f59a91f16535927d99d
(cherry picked from commit d34af09cf2b7f17cbfd9754458dddf67f69fd7cc)
overlay: Remove usage of scale header

Remove usage of scale header and do not create or destroy objects.
the programScale() function exported out of libscale.so will
internally manage objects.

This frees up overlay from relying on scale.h which may not be
exported by libscale.so to a known location if only binaries are
shipped.

Change-Id: If6970541e2eb0ee2bdb907c73ed3534fc22e9dd1
(cherry picked from commit 28c5f4065c326027f562be245e90cb20a5d41564)