Add support for HWC < 1.0

Squashed commit from CM and updated for lollipop

Change-Id: I41a3ace5f8bf7322dcc836ae83cd7754e0895692