WIP: add support for HWC < 1.0

Cherry-picked from https://github.com/CyanogenMod/android_frameworks_native/commit/8e8f98e26a756bc3a64d2443c3ce68660f78f175