hwc: Backport patches from cm-10.1 branch

Change-Id: I532b336a6c0b85ea03145a266d838ee938d031f4
Merge "hwc: Backport patches from cm-10.1 branch" into jellybean