diff --git a/graphics/composer/2.1/default/ComposerBase.h b/graphics/composer/2.1/default/ComposerBase.h
index 85b1a4d..e1c9d33 100644
--- a/graphics/composer/2.1/default/ComposerBase.h
+++ b/graphics/composer/2.1/default/ComposerBase.h
@@ -38,6 +38,8 @@
 public:
     virtual ~ComposerBase() {};
 
+    virtual bool hasCapability(hwc2_capability_t capability) = 0;
+
     virtual void removeClient() = 0;
     virtual void enableCallback(bool enable) = 0;
     virtual uint32_t getMaxVirtualDisplayCount() = 0;
diff --git a/graphics/composer/2.1/default/ComposerClient.cpp b/graphics/composer/2.1/default/ComposerClient.cpp
index e792034..4e6dd4f 100644
--- a/graphics/composer/2.1/default/ComposerClient.cpp
+++ b/graphics/composer/2.1/default/ComposerClient.cpp
@@ -748,15 +748,17 @@
     }
 
     // First try to Present as is.
-    int presentFence = -1;
-    std::vector<Layer> layers;
-    std::vector<int> fences;
-    auto err = mHal.presentDisplay(mDisplay, &presentFence, &layers, &fences);
-    if (err == Error::NONE) {
-        mWriter.setPresentOrValidateResult(1);
-        mWriter.setPresentFence(presentFence);
-        mWriter.setReleaseFences(layers, fences);
-        return true;
+    if (mHal.hasCapability(HWC2_CAPABILITY_SKIP_VALIDATE)) {
+        int presentFence = -1;
+        std::vector<Layer> layers;
+        std::vector<int> fences;
+        auto err = mHal.presentDisplay(mDisplay, &presentFence, &layers, &fences);
+        if (err == Error::NONE) {
+            mWriter.setPresentOrValidateResult(1);
+            mWriter.setPresentFence(presentFence);
+            mWriter.setReleaseFences(layers, fences);
+            return true;
+        }
     }
 
     // Present has failed. We need to fallback to validate
@@ -766,9 +768,8 @@
     std::vector<Layer> requestedLayers;
     std::vector<uint32_t> requestMasks;
 
-    err = mHal.validateDisplay(mDisplay, &changedLayers,
-                               &compositionTypes, &displayRequestMask,
-                               &requestedLayers, &requestMasks);
+    auto err = mHal.validateDisplay(mDisplay, &changedLayers, &compositionTypes,
+                                    &displayRequestMask, &requestedLayers, &requestMasks);
     if (err == Error::NONE) {
         mWriter.setPresentOrValidateResult(0);
         mWriter.setChangedCompositionTypes(changedLayers,
diff --git a/graphics/composer/2.1/default/Hwc.cpp b/graphics/composer/2.1/default/Hwc.cpp
index 80ec1cd..d431a6c 100644
--- a/graphics/composer/2.1/default/Hwc.cpp
+++ b/graphics/composer/2.1/default/Hwc.cpp
@@ -49,8 +49,7 @@
     }
 
     initCapabilities();
-    if (majorVersion >= 2 &&
-        hasCapability(Capability::PRESENT_FENCE_IS_NOT_RELIABLE)) {
+    if (majorVersion >= 2 && hasCapability(HWC2_CAPABILITY_PRESENT_FENCE_IS_NOT_RELIABLE)) {
         ALOGE("Present fence must be reliable from HWC2 on.");
         abort();
     }
@@ -116,12 +115,14 @@
     uint32_t count = 0;
     mDevice->getCapabilities(mDevice, &count, nullptr);
 
-    std::vector<Capability> caps(count);
-    mDevice->getCapabilities(mDevice, &count, reinterpret_cast<
-              std::underlying_type<Capability>::type*>(caps.data()));
+    std::vector<int32_t> caps(count);
+    mDevice->getCapabilities(mDevice, &count, caps.data());
     caps.resize(count);
 
-    mCapabilities.insert(caps.cbegin(), caps.cend());
+    mCapabilities.reserve(count);
+    for (auto cap : caps) {
+        mCapabilities.insert(static_cast<hwc2_capability_t>(cap));
+    }
 }
 
 template<typename T>
@@ -190,7 +191,7 @@
     initDispatch(HWC2_FUNCTION_SET_LAYER_PLANE_ALPHA,
             &mDispatch.setLayerPlaneAlpha);
 
-    if (hasCapability(Capability::SIDEBAND_STREAM)) {
+    if (hasCapability(HWC2_CAPABILITY_SIDEBAND_STREAM)) {
         initDispatch(HWC2_FUNCTION_SET_LAYER_SIDEBAND_STREAM,
                 &mDispatch.setLayerSidebandStream);
     }
@@ -210,15 +211,26 @@
     initDispatch(HWC2_FUNCTION_VALIDATE_DISPLAY, &mDispatch.validateDisplay);
 }
 
-bool HwcHal::hasCapability(Capability capability) const
-{
+bool HwcHal::hasCapability(hwc2_capability_t capability) {
     return (mCapabilities.count(capability) > 0);
 }
 
 Return<void> HwcHal::getCapabilities(getCapabilities_cb hidl_cb)
 {
-    std::vector<Capability> caps(
-            mCapabilities.cbegin(), mCapabilities.cend());
+    std::vector<Capability> caps;
+    caps.reserve(mCapabilities.size());
+    for (auto cap : mCapabilities) {
+        switch (cap) {
+            case HWC2_CAPABILITY_SIDEBAND_STREAM:
+            case HWC2_CAPABILITY_SKIP_CLIENT_COLOR_TRANSFORM:
+            case HWC2_CAPABILITY_PRESENT_FENCE_IS_NOT_RELIABLE:
+                caps.push_back(static_cast<Capability>(cap));
+                break;
+            default:
+                // not all HWC2 caps are defined in HIDL
+                break;
+        }
+    }
 
     hidl_vec<Capability> caps_reply;
     caps_reply.setToExternal(caps.data(), caps.size());
diff --git a/graphics/composer/2.1/default/Hwc.h b/graphics/composer/2.1/default/Hwc.h
index 32c6b0b..e3f5ce6 100644
--- a/graphics/composer/2.1/default/Hwc.h
+++ b/graphics/composer/2.1/default/Hwc.h
@@ -58,14 +58,13 @@
     HwcHal(const hw_module_t* module);
     virtual ~HwcHal();
 
-    bool hasCapability(Capability capability) const;
-
     // IComposer interface
     Return<void> getCapabilities(getCapabilities_cb hidl_cb) override;
     Return<void> dumpDebugInfo(dumpDebugInfo_cb hidl_cb) override;
     Return<void> createClient(createClient_cb hidl_cb) override;
 
     // ComposerBase interface
+    bool hasCapability(hwc2_capability_t capability) override;
     void removeClient() override;
     void enableCallback(bool enable) override;
     uint32_t getMaxVirtualDisplayCount() override;
@@ -168,7 +167,7 @@
 
     hwc2_device_t* mDevice;
 
-    std::unordered_set<Capability> mCapabilities;
+    std::unordered_set<hwc2_capability_t> mCapabilities;
 
     struct {
         HWC2_PFN_ACCEPT_DISPLAY_CHANGES acceptDisplayChanges;
