diff --git a/display-commonsys-intf/.clang-format b/display-commonsys-intf/.clang-format
new file mode 100644
index 0000000..26ce4fe
--- /dev/null
+++ b/display-commonsys-intf/.clang-format
@@ -0,0 +1,14 @@
+---
+Language:        Cpp
+BasedOnStyle:  Google
+Standard : C++11
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: Inline
+AllowShortBlocksOnASingleLine: false
+ColumnLimit:     100
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 4
+DerivePointerAlignment: false
+PointerAlignment: Right
+#ReflowComments: false
diff --git a/display-commonsys-intf/.gitignore b/display-commonsys-intf/.gitignore
new file mode 100644
index 0000000..ad71dd6
--- /dev/null
+++ b/display-commonsys-intf/.gitignore
@@ -0,0 +1,4 @@
+CMakeLists.txt
+.idea/
+.editorconfig
+.clang-complete
diff --git a/display-commonsys-intf/Android.bp b/display-commonsys-intf/Android.bp
new file mode 100644
index 0000000..408e904
--- /dev/null
+++ b/display-commonsys-intf/Android.bp
@@ -0,0 +1,10 @@
+cc_library_headers {
+    name: "display_intf_headers",
+    vendor_available: true,
+    export_include_dirs: [
+        "gralloc",
+        "include",
+        "libqdmetadata",
+        "services",
+    ],
+}
diff --git a/display-commonsys-intf/Makefile.am b/display-commonsys-intf/Makefile.am
new file mode 100644
index 0000000..8009b42
--- /dev/null
+++ b/display-commonsys-intf/Makefile.am
@@ -0,0 +1,2 @@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = libqdmetadata
diff --git a/display-commonsys-intf/config/display-interfaces-product.mk b/display-commonsys-intf/config/display-interfaces-product.mk
new file mode 100644
index 0000000..8f2edc4
--- /dev/null
+++ b/display-commonsys-intf/config/display-interfaces-product.mk
@@ -0,0 +1,24 @@
+PRODUCT_PACKAGES += vendor.qti.hardware.display.allocator@1.0.vendor \
+                    vendor.qti.hardware.display.allocator@3.0.vendor \
+                    vendor.qti.hardware.display.composer@1.0.vendor \
+                    vendor.qti.hardware.display.composer@2.0.vendor \
+                    vendor.display.config@1.0.vendor \
+                    vendor.display.config@1.1.vendor \
+                    vendor.display.config@1.2.vendor \
+                    vendor.display.config@1.3.vendor \
+                    vendor.display.config@1.4.vendor \
+                    vendor.display.config@1.5.vendor \
+                    vendor.display.config@1.6.vendor \
+                    vendor.display.config@1.7.vendor \
+                    vendor.display.config@1.8.vendor \
+                    vendor.display.config@1.9.vendor \
+                    vendor.display.config@1.10.vendor \
+                    vendor.display.config@1.11.vendor \
+                    vendor.display.config@2.0.vendor \
+                    vendor.qti.hardware.display.mapper@1.0.vendor \
+                    vendor.qti.hardware.display.mapper@1.1.vendor \
+                    vendor.qti.hardware.display.mapper@2.0.vendor \
+                    vendor.qti.hardware.display.mapper@3.0.vendor \
+                    vendor.qti.hardware.display.mapper@4.0.vendor \
+                    vendor.qti.hardware.display.mapperextensions@1.0.vendor \
+                    vendor.qti.hardware.display.mapperextensions@1.1.vendor
diff --git a/display-commonsys-intf/config/display-product-system.mk b/display-commonsys-intf/config/display-product-system.mk
new file mode 100644
index 0000000..6509648
--- /dev/null
+++ b/display-commonsys-intf/config/display-product-system.mk
@@ -0,0 +1,26 @@
+PRODUCT_PACKAGES += libdisplayconfig \
+                    libqdMetaData \
+                    libqdMetaData.system \
+                    libgralloc.qti \
+                    libdrm \
+                    vendor.display.config@1.0 \
+                    vendor.display.config@1.1 \
+                    vendor.display.config@1.2 \
+                    vendor.display.config@1.3 \
+                    vendor.display.config@1.4 \
+                    vendor.display.config@1.5 \
+                    libsmomo.qti \
+                    liblayerext.qti \
+                    libsmomoconfig.qti \
+                    libcomposerextn.qti \
+                    libdisplayconfig.qti
+
+SOONG_CONFIG_NAMESPACES += qtidisplaycommonsys
+# Soong Keys
+SOONG_CONFIG_qtidisplaycommonsys := displayconfig_enabled
+# Soong Values
+SOONG_CONFIG_qtidisplaycommonsys_displayconfig_enabled := false
+
+ifeq ($(call is-vendor-board-platform,QCOM),true)
+    SOONG_CONFIG_qtidisplaycommonsys_displayconfig_enabled := true
+endif
diff --git a/display-commonsys-intf/configure.ac b/display-commonsys-intf/configure.ac
new file mode 100644
index 0000000..8950b21
--- /dev/null
+++ b/display-commonsys-intf/configure.ac
@@ -0,0 +1,52 @@
+#                                               -*- Autoconf -*-
+# configure.ac -- Autoconf script for display commonsys intf
+#
+
+# Process this file with autoconf to produce a configure script
+
+# Requires autoconf tool later than 2.61
+AC_PREREQ(2.61)
+# Initialize the display commonsys intf package version 1.0.0
+AC_INIT([disp-commonsys-intf],1.0.0)
+# Does not strictly follow GNU Coding standards
+AM_INIT_AUTOMAKE([foreign])
+# Disables auto rebuilding of configure, Makefile.ins
+AM_MAINTAINER_MODE
+# defines some macros variable to be included by source
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+AC_SUBST([AM_CPPFLAGS], [--std=c++11])
+
+AC_ARG_WITH([core_includes],
+    AC_HELP_STRING([--with-core-includes=@<:@dir@:>@],
+       [Specify the location of the core headers]),
+    [core_incdir=$withval],
+    with_core_includes=no)
+
+if test "x$with_core_includes" != "xno"; then
+   CFLAGS="${CFLAGS} -I${core_incdir}"
+fi
+
+AC_ARG_WITH(sanitized-headers,
+   AS_HELP_STRING([--with-sanitized-headers=DIR],
+       [Specify the location of the sanitized Linux headers]),
+   [CPPFLAGS="$CPPFLAGS -I$withval"])
+
+# Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_LIBTOOL
+AC_PROG_AWK
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+AC_SUBST([CFLAGS])
+AC_SUBST([CC])
+AC_CONFIG_FILES([ \
+        Makefile \
+        libqdmetadata/Makefile
+        ])
+AC_OUTPUT
diff --git a/display-commonsys-intf/gralloc/Android.bp b/display-commonsys-intf/gralloc/Android.bp
new file mode 100644
index 0000000..c7339c2
--- /dev/null
+++ b/display-commonsys-intf/gralloc/Android.bp
@@ -0,0 +1,23 @@
+cc_library_shared {
+    name: "libgralloc.qti",
+    vendor_available: true,
+    system_ext_specific: true,
+    cflags: [
+        "-Wno-sign-conversion",
+        "-DLOG_TAG=\"qtigralloc\"",
+    ],
+    shared_libs: [
+         "liblog",
+         "libcutils",
+         "libutils",
+         "libgralloctypes",
+         "libhidlbase",
+         "libhardware",
+         "android.hardware.graphics.mapper@4.0",
+    ],
+
+    srcs: ["QtiGralloc.cpp"],
+
+    header_libs: ["display_intf_headers"],
+}
+
diff --git a/display-commonsys-intf/gralloc/QtiGralloc.cpp b/display-commonsys-intf/gralloc/QtiGralloc.cpp
new file mode 100644
index 0000000..5172ad5
--- /dev/null
+++ b/display-commonsys-intf/gralloc/QtiGralloc.cpp
@@ -0,0 +1,397 @@
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "QtiGralloc.h"
+
+#include <log/log.h>
+namespace qtigralloc {
+
+using android::hardware::graphics::mapper::V4_0::IMapper;
+
+static sp<IMapper> getInstance() {
+  static sp<IMapper> mapper = IMapper::getService();
+  return mapper;
+}
+
+Error decodeMetadataState(hidl_vec<uint8_t> &in, bool *out) {
+  if (!in.size() || !out) {
+    return Error::BAD_VALUE;
+  }
+  memcpy(out, in.data(), METADATA_SET_SIZE);
+  return Error::NONE;
+}
+
+Error encodeMetadataState(bool *in, hidl_vec<uint8_t> *out) {
+  if (!in || !out) {
+    return Error::BAD_VALUE;
+  }
+  out->resize(sizeof(bool) * METADATA_SET_SIZE);
+  memcpy(out->data(), in, sizeof(bool) * METADATA_SET_SIZE);
+  return Error::NONE;
+}
+
+Error decodeColorMetadata(hidl_vec<uint8_t> &in, ColorMetaData *out) {
+  if (!in.size() || !out) {
+    return Error::BAD_VALUE;
+  }
+  memcpy(out, in.data(), sizeof(ColorMetaData));
+  return Error::NONE;
+}
+
+Error encodeColorMetadata(ColorMetaData &in, hidl_vec<uint8_t> *out) {
+  if (!out) {
+    return Error::BAD_VALUE;
+  }
+  out->resize(sizeof(ColorMetaData));
+  memcpy(out->data(), &in, sizeof(ColorMetaData));
+  return Error::NONE;
+}
+
+// decode the raw graphics metadata from bytestream and store it in 'data' member of
+// GraphicsMetadata struct during mapper->set call, 'size' member is unused.
+Error decodeGraphicsMetadata(hidl_vec<uint8_t> &in, GraphicsMetadata *out) {
+  if (!in.size() || !out) {
+    return Error::BAD_VALUE;
+  }
+  memcpy(&(out->data), in.data(), GRAPHICS_METADATA_SIZE_IN_BYTES);
+  return Error::NONE;
+}
+
+// encode only 'data' member of GraphicsMetadata struct for retrieval of
+// graphics metadata during mapper->get call
+Error encodeGraphicsMetadata(GraphicsMetadata &in, hidl_vec<uint8_t> *out) {
+  if (!out) {
+    return Error::BAD_VALUE;
+  }
+  out->resize(GRAPHICS_METADATA_SIZE_IN_BYTES);
+  memcpy(out->data(), &(in.data), GRAPHICS_METADATA_SIZE_IN_BYTES);
+  return Error::NONE;
+}
+
+// decode the raw graphics metadata from bytestream before presenting it to caller
+Error decodeGraphicsMetadataRaw(hidl_vec<uint8_t> &in, void *out) {
+  if (!in.size() || !out) {
+    return Error::BAD_VALUE;
+  }
+  memcpy(out, in.data(), GRAPHICS_METADATA_SIZE_IN_BYTES);
+  return Error::NONE;
+}
+
+// encode the raw graphics metadata in bytestream before calling mapper->set
+Error encodeGraphicsMetadataRaw(void *in, hidl_vec<uint8_t> *out) {
+  if (!in || !out) {
+    return Error::BAD_VALUE;
+  }
+  out->resize(GRAPHICS_METADATA_SIZE_IN_BYTES);
+  memcpy(out->data(), in, GRAPHICS_METADATA_SIZE_IN_BYTES);
+  return Error::NONE;
+}
+
+Error decodeUBWCStats(hidl_vec<uint8_t> &in, UBWCStats *out) {
+  if (!in.size() || !out) {
+    return Error::BAD_VALUE;
+  }
+  memcpy(out, in.data(), UBWC_STATS_ARRAY_SIZE * sizeof(UBWCStats));
+  return Error::NONE;
+}
+
+Error encodeUBWCStats(UBWCStats *in, hidl_vec<uint8_t> *out) {
+  if (!in || !out) {
+    return Error::BAD_VALUE;
+  }
+  out->resize(UBWC_STATS_ARRAY_SIZE * sizeof(UBWCStats));
+  memcpy(out->data(), in, UBWC_STATS_ARRAY_SIZE * sizeof(UBWCStats));
+  return Error::NONE;
+}
+
+Error decodeCVPMetadata(hidl_vec<uint8_t> &in, CVPMetadata *out) {
+  if (!in.size() || !out) {
+    return Error::BAD_VALUE;
+  }
+  memcpy(out, in.data(), sizeof(CVPMetadata));
+  return Error::NONE;
+}
+
+Error encodeCVPMetadata(CVPMetadata &in, hidl_vec<uint8_t> *out) {
+  if (!out) {
+    return Error::BAD_VALUE;
+  }
+  out->resize(sizeof(CVPMetadata));
+  memcpy(out->data(), &in, sizeof(CVPMetadata));
+  return Error::NONE;
+}
+
+Error decodeVideoHistogramMetadata(hidl_vec<uint8_t> &in, VideoHistogramMetadata *out) {
+  if (!in.size() || !out) {
+    return Error::BAD_VALUE;
+  }
+  memcpy(out, in.data(), sizeof(VideoHistogramMetadata));
+  return Error::NONE;
+}
+
+Error encodeVideoHistogramMetadata(VideoHistogramMetadata &in, hidl_vec<uint8_t> *out) {
+  if (!out) {
+    return Error::BAD_VALUE;
+  }
+  out->resize(sizeof(VideoHistogramMetadata));
+  memcpy(out->data(), &in, sizeof(VideoHistogramMetadata));
+  return Error::NONE;
+}
+
+MetadataType getMetadataType(uint32_t in) {
+  switch (in) {
+    case QTI_VT_TIMESTAMP:
+      return MetadataType_VTTimestamp;
+    case QTI_VIDEO_PERF_MODE:
+      return MetadataType_VideoPerfMode;
+    case QTI_LINEAR_FORMAT:
+      return MetadataType_LinearFormat;
+    case QTI_SINGLE_BUFFER_MODE:
+      return MetadataType_SingleBufferMode;
+    case QTI_PP_PARAM_INTERLACED:
+      return MetadataType_PPParamInterlaced;
+    case QTI_MAP_SECURE_BUFFER:
+      return MetadataType_MapSecureBuffer;
+    case QTI_COLOR_METADATA:
+      return MetadataType_ColorMetadata;
+    case QTI_GRAPHICS_METADATA:
+      return MetadataType_GraphicsMetadata;
+    case QTI_UBWC_CR_STATS_INFO:
+      return MetadataType_UBWCCRStatsInfo;
+    case QTI_REFRESH_RATE:
+      return MetadataType_RefreshRate;
+    case QTI_CVP_METADATA:
+      return MetadataType_CVPMetadata;
+    case QTI_VIDEO_HISTOGRAM_STATS:
+      return MetadataType_VideoHistogramStats;
+    case QTI_FD:
+      return MetadataType_FD;
+    case QTI_PRIVATE_FLAGS:
+      return MetadataType_PrivateFlags;
+    case QTI_ALIGNED_WIDTH_IN_PIXELS:
+      return MetadataType_AlignedWidthInPixels;
+    case QTI_ALIGNED_HEIGHT_IN_PIXELS:
+      return MetadataType_AlignedHeightInPixels;
+    case QTI_STANDARD_METADATA_STATUS:
+      return MetadataType_StandardMetadataStatus;
+    case QTI_VENDOR_METADATA_STATUS:
+      return MetadataType_VendorMetadataStatus;
+    case QTI_BUFFER_TYPE:
+      return MetadataType_BufferType;
+    default:
+      return MetadataType_Invalid;
+  }
+}
+
+Error get(void *buffer, uint32_t type, void *param) {
+  hidl_vec<uint8_t> bytestream;
+  sp<IMapper> mapper = getInstance();
+
+  MetadataType metadata_type = getMetadataType(type);
+  if (metadata_type == MetadataType_Invalid) {
+    param = nullptr;
+    return Error::UNSUPPORTED;
+  }
+
+  auto err = Error::UNSUPPORTED;
+  mapper->get(buffer, metadata_type, [&](const auto &tmpError, const auto &tmpByteStream) {
+    err = tmpError;
+    bytestream = tmpByteStream;
+  });
+
+  if (err != Error::NONE) {
+    return err;
+  }
+
+  switch (type) {
+    case QTI_VT_TIMESTAMP:
+      err = static_cast<Error>(android::gralloc4::decodeUint64(qtigralloc::MetadataType_VTTimestamp,
+                                                               bytestream, (uint64_t *)param));
+      break;
+    case QTI_VIDEO_PERF_MODE:
+      err = static_cast<Error>(android::gralloc4::decodeUint32(
+          qtigralloc::MetadataType_VideoPerfMode, bytestream, (uint32_t *)param));
+      break;
+    case QTI_LINEAR_FORMAT:
+      err = static_cast<Error>(android::gralloc4::decodeUint32(
+          qtigralloc::MetadataType_LinearFormat, bytestream, (uint32_t *)param));
+      break;
+    case QTI_SINGLE_BUFFER_MODE:
+      err = static_cast<Error>(android::gralloc4::decodeUint32(
+          qtigralloc::MetadataType_SingleBufferMode, bytestream, (uint32_t *)param));
+      break;
+    case QTI_PP_PARAM_INTERLACED:
+      err = static_cast<Error>(android::gralloc4::decodeInt32(
+          qtigralloc::MetadataType_PPParamInterlaced, bytestream, (int32_t *)param));
+      break;
+    case QTI_MAP_SECURE_BUFFER:
+      err = static_cast<Error>(android::gralloc4::decodeInt32(
+          qtigralloc::MetadataType_MapSecureBuffer, bytestream, (int32_t *)param));
+      break;
+    case QTI_COLOR_METADATA:
+      err = decodeColorMetadata(bytestream, (ColorMetaData *)param);
+      break;
+    case QTI_GRAPHICS_METADATA:
+      err = decodeGraphicsMetadataRaw(bytestream, param);
+      break;
+    case QTI_UBWC_CR_STATS_INFO:
+      err = decodeUBWCStats(bytestream, (UBWCStats *)param);
+      break;
+    case QTI_REFRESH_RATE:
+      err = static_cast<Error>(android::gralloc4::decodeFloat(qtigralloc::MetadataType_RefreshRate,
+                                                              bytestream, (float *)param));
+      break;
+    case QTI_CVP_METADATA:
+      err = decodeCVPMetadata(bytestream, (CVPMetadata *)param);
+      break;
+    case QTI_VIDEO_HISTOGRAM_STATS:
+      err = decodeVideoHistogramMetadata(bytestream, (VideoHistogramMetadata *)param);
+      break;
+    case QTI_FD:
+      err = static_cast<Error>(android::gralloc4::decodeInt32(qtigralloc::MetadataType_FD,
+                                                              bytestream, (int32_t *)param));
+      break;
+    case QTI_PRIVATE_FLAGS:
+      err = static_cast<Error>(android::gralloc4::decodeInt32(qtigralloc::MetadataType_PrivateFlags,
+                                                              bytestream, (int32_t *)param));
+      break;
+    case QTI_ALIGNED_WIDTH_IN_PIXELS:
+      err = static_cast<Error>(android::gralloc4::decodeUint32(
+          qtigralloc::MetadataType_AlignedWidthInPixels, bytestream, (uint32_t *)param));
+      break;
+    case QTI_ALIGNED_HEIGHT_IN_PIXELS:
+      err = static_cast<Error>(android::gralloc4::decodeUint32(
+          qtigralloc::MetadataType_AlignedHeightInPixels, bytestream, (uint32_t *)param));
+      break;
+    case QTI_STANDARD_METADATA_STATUS:
+    case QTI_VENDOR_METADATA_STATUS:
+      err = decodeMetadataState(bytestream, (bool *)param);
+      break;
+    case QTI_BUFFER_TYPE:
+      err = static_cast<Error>(android::gralloc4::decodeUint32(
+          qtigralloc::MetadataType_BufferType, bytestream, (uint32_t *)param));
+      break;
+    default:
+      param = nullptr;
+      return Error::UNSUPPORTED;
+  }
+
+  return err;
+}
+
+Error set(void *buffer, uint32_t type, void *param) {
+  hidl_vec<uint8_t> bytestream;
+  sp<IMapper> mapper = getInstance();
+
+  Error err = Error::UNSUPPORTED;
+  MetadataType metadata_type = getMetadataType(type);
+  if (metadata_type == MetadataType_Invalid) {
+    return err;
+  }
+
+  switch (type) {
+    case QTI_VT_TIMESTAMP:
+      err = static_cast<Error>(android::gralloc4::encodeUint64(qtigralloc::MetadataType_VTTimestamp,
+                                                               *(uint64_t *)param, &bytestream));
+      break;
+    case QTI_VIDEO_PERF_MODE:
+      err = static_cast<Error>(android::gralloc4::encodeUint32(
+          qtigralloc::MetadataType_VideoPerfMode, *(uint32_t *)param, &bytestream));
+      break;
+    case QTI_LINEAR_FORMAT:
+      err = static_cast<Error>(android::gralloc4::encodeUint32(
+          qtigralloc::MetadataType_LinearFormat, *(uint32_t *)param, &bytestream));
+      break;
+    case QTI_SINGLE_BUFFER_MODE:
+      err = static_cast<Error>(android::gralloc4::encodeUint32(
+          qtigralloc::MetadataType_SingleBufferMode, *(uint32_t *)param, &bytestream));
+      break;
+    case QTI_PP_PARAM_INTERLACED:
+      err = static_cast<Error>(android::gralloc4::encodeInt32(
+          qtigralloc::MetadataType_PPParamInterlaced, *(int32_t *)param, &bytestream));
+      break;
+    case QTI_MAP_SECURE_BUFFER:
+      err = static_cast<Error>(android::gralloc4::encodeInt32(
+          qtigralloc::MetadataType_MapSecureBuffer, *(int32_t *)param, &bytestream));
+      break;
+    case QTI_COLOR_METADATA:
+      err = encodeColorMetadata(*(ColorMetaData *)param, &bytestream);
+      break;
+    case QTI_GRAPHICS_METADATA:
+      err = encodeGraphicsMetadataRaw(param, &bytestream);
+      break;
+    case QTI_UBWC_CR_STATS_INFO:
+      err = encodeUBWCStats((UBWCStats *)param, &bytestream);
+      break;
+    case QTI_REFRESH_RATE:
+      err = static_cast<Error>(android::gralloc4::encodeFloat(qtigralloc::MetadataType_RefreshRate,
+                                                              *(float *)param, &bytestream));
+      break;
+    case QTI_CVP_METADATA:
+      err = encodeCVPMetadata(*(CVPMetadata *)param, &bytestream);
+      break;
+    case QTI_VIDEO_HISTOGRAM_STATS:
+      err = encodeVideoHistogramMetadata(*(VideoHistogramMetadata *)param, &bytestream);
+      break;
+    default:
+      param = nullptr;
+      return Error::UNSUPPORTED;
+  }
+
+  if (err != Error::NONE) {
+    return err;
+  }
+
+  return mapper->set((void *)buffer, metadata_type, bytestream);
+}
+
+int getMetadataState(void *buffer, uint32_t type) {
+  bool metadata_set[METADATA_SET_SIZE];
+  Error err;
+  if (IS_VENDOR_METADATA_TYPE(type)) {
+    err = get(buffer, QTI_VENDOR_METADATA_STATUS, &metadata_set);
+  } else {
+    err = get(buffer, QTI_STANDARD_METADATA_STATUS, &metadata_set);
+  }
+
+  if (err != Error::NONE) {
+    ALOGE("Unable to get metadata state");
+    return -1;
+  }
+
+  if (IS_VENDOR_METADATA_TYPE(type)) {
+    return metadata_set[GET_VENDOR_METADATA_STATUS_INDEX(type)];
+  } else if (GET_STANDARD_METADATA_STATUS_INDEX(type) < METADATA_SET_SIZE) {
+    return metadata_set[GET_STANDARD_METADATA_STATUS_INDEX(type)];
+  } else {
+    return -1;
+  }
+}
+
+}  // namespace qtigralloc
diff --git a/display-commonsys-intf/gralloc/QtiGralloc.h b/display-commonsys-intf/gralloc/QtiGralloc.h
new file mode 100644
index 0000000..9ab8732
--- /dev/null
+++ b/display-commonsys-intf/gralloc/QtiGralloc.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *    * Neither the name of The Linux Foundation. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __QTIGRALLOC_H__
+#define __QTIGRALLOC_H__
+
+#include <android/hardware/graphics/mapper/4.0/IMapper.h>
+#include <gralloctypes/Gralloc4.h>
+#include <hidl/HidlSupport.h>
+#include <stdint.h>
+
+#include <string>
+
+#include "QtiGrallocDefs.h"
+#include "QtiGrallocMetadata.h"
+
+namespace qtigralloc {
+using android::sp;
+using android::hardware::hidl_vec;
+using MetadataType = android::hardware::graphics::mapper::V4_0::IMapper::MetadataType;
+using android::hardware::graphics::mapper::V4_0::Error;
+// from gr_priv_handle.h
+enum {
+  PRIV_FLAGS_USES_ION = 0x00000008,
+  PRIV_FLAGS_NEEDS_FLUSH = 0x00000020,
+  PRIV_FLAGS_NON_CPU_WRITER = 0x00000080,
+  PRIV_FLAGS_CACHED = 0x00000200,
+  PRIV_FLAGS_SECURE_BUFFER = 0x00000400,
+  PRIV_FLAGS_VIDEO_ENCODER = 0x00010000,
+  PRIV_FLAGS_CAMERA_WRITE = 0x00020000,
+  PRIV_FLAGS_CAMERA_READ = 0x00040000,
+  PRIV_FLAGS_HW_TEXTURE = 0x00100000,
+  PRIV_FLAGS_SECURE_DISPLAY = 0x01000000,
+  PRIV_FLAGS_UBWC_ALIGNED = 0x08000000,
+  PRIV_FLAGS_UBWC_ALIGNED_PI = 0x40000000,  // PI format
+};
+
+// Metadata
+static const std::string VENDOR_QTI = "QTI";
+
+Error get(void *buffer, uint32_t type, void *param);
+Error set(void *buffer, uint32_t type, void *param);
+MetadataType getMetadataType(uint32_t in);
+int getMetadataState(void *buffer, uint32_t type);
+
+static const MetadataType MetadataType_VTTimestamp = {VENDOR_QTI, QTI_VT_TIMESTAMP};
+
+static const MetadataType MetadataType_ColorMetadata = {VENDOR_QTI, QTI_COLOR_METADATA};
+
+static const MetadataType MetadataType_PPParamInterlaced = {VENDOR_QTI, QTI_PP_PARAM_INTERLACED};
+
+static const MetadataType MetadataType_VideoPerfMode = {VENDOR_QTI, QTI_VIDEO_PERF_MODE};
+
+static const MetadataType MetadataType_GraphicsMetadata = {VENDOR_QTI, QTI_GRAPHICS_METADATA};
+
+static const MetadataType MetadataType_UBWCCRStatsInfo = {VENDOR_QTI, QTI_UBWC_CR_STATS_INFO};
+
+static const MetadataType MetadataType_RefreshRate = {VENDOR_QTI, QTI_REFRESH_RATE};
+static const MetadataType MetadataType_MapSecureBuffer = {VENDOR_QTI, QTI_MAP_SECURE_BUFFER};
+
+static const MetadataType MetadataType_LinearFormat = {VENDOR_QTI, QTI_LINEAR_FORMAT};
+
+static const MetadataType MetadataType_SingleBufferMode = {VENDOR_QTI, QTI_SINGLE_BUFFER_MODE};
+
+static const MetadataType MetadataType_CVPMetadata = {VENDOR_QTI, QTI_CVP_METADATA};
+
+static const MetadataType MetadataType_VideoHistogramStats = {VENDOR_QTI,
+                                                              QTI_VIDEO_HISTOGRAM_STATS};
+
+static const MetadataType MetadataType_FD = {VENDOR_QTI, QTI_FD};
+
+static const MetadataType MetadataType_PrivateFlags = {VENDOR_QTI, QTI_PRIVATE_FLAGS};
+
+static const MetadataType MetadataType_AlignedWidthInPixels = {VENDOR_QTI,
+                                                               QTI_ALIGNED_WIDTH_IN_PIXELS};
+
+static const MetadataType MetadataType_AlignedHeightInPixels = {VENDOR_QTI,
+                                                                QTI_ALIGNED_HEIGHT_IN_PIXELS};
+
+static const MetadataType MetadataType_StandardMetadataStatus = {VENDOR_QTI,
+                                                                 QTI_STANDARD_METADATA_STATUS};
+
+static const MetadataType MetadataType_VendorMetadataStatus = {VENDOR_QTI,
+                                                               QTI_VENDOR_METADATA_STATUS};
+
+static const MetadataType MetadataType_BufferType = {VENDOR_QTI,
+                                                     QTI_BUFFER_TYPE};
+
+// 0 is also used as invalid value in standard metadata
+static const MetadataType MetadataType_Invalid = {VENDOR_QTI, 0};
+
+static const aidl::android::hardware::graphics::common::ExtendableType Compression_QtiUBWC = {
+    VENDOR_QTI, COMPRESSION_QTI_UBWC};
+static const aidl::android::hardware::graphics::common::ExtendableType Interlaced_Qti = {
+    VENDOR_QTI, INTERLACED_QTI};
+
+static const aidl::android::hardware::graphics::common::ExtendableType
+    PlaneLayoutComponentType_Raw = {VENDOR_QTI, PLANE_COMPONENT_TYPE_RAW};
+static const aidl::android::hardware::graphics::common::ExtendableType
+    PlaneLayoutComponentType_Meta = {VENDOR_QTI, PLANE_COMPONENT_TYPE_META};
+
+Error decodeMetadataState(hidl_vec<uint8_t> &in, bool *out);
+Error encodeMetadataState(bool *in, hidl_vec<uint8_t> *out);
+Error decodeColorMetadata(hidl_vec<uint8_t> &in, ColorMetaData *out);
+Error encodeColorMetadata(ColorMetaData &in, hidl_vec<uint8_t> *out);
+Error decodeGraphicsMetadata(hidl_vec<uint8_t> &in, GraphicsMetadata *out);
+Error encodeGraphicsMetadata(GraphicsMetadata &in, hidl_vec<uint8_t> *out);
+Error decodeGraphicsMetadataRaw(hidl_vec<uint8_t> &in, void *out);
+Error encodeGraphicsMetadataRaw(void *in, hidl_vec<uint8_t> *out);
+Error decodeUBWCStats(hidl_vec<uint8_t> &in, UBWCStats *out);
+Error encodeUBWCStats(UBWCStats *in, hidl_vec<uint8_t> *out);
+Error decodeCVPMetadata(hidl_vec<uint8_t> &in, CVPMetadata *out);
+Error encodeCVPMetadata(CVPMetadata &in, hidl_vec<uint8_t> *out);
+Error decodeVideoHistogramMetadata(hidl_vec<uint8_t> &in, VideoHistogramMetadata *out);
+Error encodeVideoHistogramMetadata(VideoHistogramMetadata &in, hidl_vec<uint8_t> *out);
+}  // namespace qtigralloc
+
+#endif  //__QTIGRALLOC_H__
diff --git a/display-commonsys-intf/gralloc/QtiGrallocDefs.h b/display-commonsys-intf/gralloc/QtiGrallocDefs.h
new file mode 100644
index 0000000..93272dd
--- /dev/null
+++ b/display-commonsys-intf/gralloc/QtiGrallocDefs.h
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *    * Neither the name of The Linux Foundation. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __QTIGRALLOCDEFS_H__
+#define __QTIGRALLOCDEFS_H__
+
+// From gralloc_priv.h
+
+/* Gralloc usage bits indicating the type of allocation that should be used */
+/* Refer to BufferUsage in hardware/interfaces/graphics/common/<ver>/types.hal */
+
+/* The bits below are in officially defined vendor space
+ * i.e bits 28-31 and 48-63*/
+/* Non linear, Universal Bandwidth Compression */
+#define GRALLOC_USAGE_PRIVATE_ALLOC_UBWC (UINT32_C(1) << 28)
+
+/* Set this for allocating uncached memory (using O_DSYNC),
+ * cannot be used with noncontiguous heaps */
+#define GRALLOC_USAGE_PRIVATE_UNCACHED (UINT32_C(1) << 29)
+
+/* This flag is used to indicate 10 bit format.
+ * When both GRALLOC_USAGE_PRIVATE_ALLOC_UBWC & GRALLOC_USAGE_PRIVATE_10BIT
+ * are set then it will indicate UBWC_TP10 format.
+ * When only GRALLOC_USAGE_PRIVATE_10BIT is set it will indicate linear P010 format.
+ */
+#define GRALLOC_USAGE_PRIVATE_10BIT (UINT32_C(1) << 30)
+
+/* This flag is used for SECURE display usecase */
+#define GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY (UINT32_C(1) << 31)
+
+/* This flag is used to indicate video NV21 format */
+#define GRALLOC_USAGE_PRIVATE_VIDEO_NV21_ENCODER 1ULL << 48
+
+/* unused legacy flags */
+#define GRALLOC_USAGE_PRIVATE_MM_HEAP 0
+#define GRALLOC_USAGE_PRIVATE_IOMMU_HEAP 0
+
+/* This flag is set for WFD usecase */
+#define GRALLOC_USAGE_PRIVATE_WFD 1ULL << 51
+
+/* This flag is set for HEIF usecase */
+#define GRALLOC_USAGE_PRIVATE_HEIF (UINT32_C(1) << 27)
+
+/* TODO(user): Remove when clients stop referencing this flag */
+#define GRALLOC_USAGE_PRIVATE_10BIT_TP 0
+
+/* This flag indicates PI format is being used */
+#define GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI 1ULL << 49
+
+/* This flag is set while CDSP accesses the buffer */
+#define GRALLOC_USAGE_PRIVATE_CDSP 1ULL << 50
+
+// OEM specific HAL formats
+#define HAL_PIXEL_FORMAT_RGBA_5551 6
+#define HAL_PIXEL_FORMAT_RGBA_4444 7
+#define HAL_PIXEL_FORMAT_NV12_ENCODEABLE 0x102
+#define HAL_PIXEL_FORMAT_NV21_ENCODEABLE 0x7FA30C00
+#define HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS 0x7FA30C04
+#define HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED 0x7FA30C03
+#define HAL_PIXEL_FORMAT_YCbCr_420_SP 0x109
+#define HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO 0x7FA30C01
+#define HAL_PIXEL_FORMAT_YCrCb_422_SP 0x10B
+#define HAL_PIXEL_FORMAT_R_8 0x10D
+#define HAL_PIXEL_FORMAT_RG_88 0x10E
+#define HAL_PIXEL_FORMAT_YCbCr_444_SP 0x10F
+#define HAL_PIXEL_FORMAT_YCrCb_444_SP 0x110
+#define HAL_PIXEL_FORMAT_YCrCb_422_I 0x111
+#define HAL_PIXEL_FORMAT_BGRX_8888 0x112
+#define HAL_PIXEL_FORMAT_NV21_ZSL 0x113
+#define HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS 0x114
+#define HAL_PIXEL_FORMAT_BGR_565 0x115
+#define HAL_PIXEL_FORMAT_RAW8 0x123
+#define HAL_PIXEL_FORMAT_NV12_HEIF 0x116
+
+// 10 bit
+#define HAL_PIXEL_FORMAT_ARGB_2101010 0x117
+#define HAL_PIXEL_FORMAT_RGBX_1010102 0x118
+#define HAL_PIXEL_FORMAT_XRGB_2101010 0x119
+#define HAL_PIXEL_FORMAT_BGRA_1010102 0x11A
+#define HAL_PIXEL_FORMAT_ABGR_2101010 0x11B
+#define HAL_PIXEL_FORMAT_BGRX_1010102 0x11C
+#define HAL_PIXEL_FORMAT_XBGR_2101010 0x11D
+#define HAL_PIXEL_FORMAT_YCbCr_420_P010 0x36  // HAL_PIXEL_FORMAT_YCBCR_P010
+#define HAL_PIXEL_FORMAT_YCbCr_420_P010_UBWC 0x124
+#define HAL_PIXEL_FORMAT_YCbCr_420_P010_VENUS 0x7FA30C0A
+
+#define HAL_PIXEL_FORMAT_CbYCrY_422_I 0x120
+#define HAL_PIXEL_FORMAT_BGR_888 0x121
+
+#define HAL_PIXEL_FORMAT_INTERLACE 0x180
+
+// Camera utils format
+#define HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX 0x125
+#define HAL_PIXEL_FORMAT_NV12_UBWC_FLEX 0x126
+#define HAL_PIXEL_FORMAT_MULTIPLANAR_FLEX 0x127
+#define HAL_PIXEL_FORMAT_NV12_UBWC_FLEX_2_BATCH 0x128
+#define HAL_PIXEL_FORMAT_NV12_UBWC_FLEX_4_BATCH 0x129
+#define HAL_PIXEL_FORMAT_NV12_UBWC_FLEX_8_BATCH 0x130
+
+// v4l2_fourcc('Y', 'U', 'Y', 'L'). 24 bpp YUYV 4:2:2 10 bit per component
+#define HAL_PIXEL_FORMAT_YCbCr_422_I_10BIT 0x4C595559
+
+// v4l2_fourcc('Y', 'B', 'W', 'C'). 10 bit per component. This compressed
+// format reduces the memory access bandwidth
+#define HAL_PIXEL_FORMAT_YCbCr_422_I_10BIT_COMPRESSED 0x43574259
+
+// UBWC aligned Venus format
+#define HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC 0x7FA30C06
+#define HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC 0x7FA30C09
+
+// Khronos ASTC formats
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
+#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
+#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
+
+enum { BUFFER_TYPE_UI = 0, BUFFER_TYPE_VIDEO };
+
+#endif  //__QTIGRALLOCDEFS_H__
diff --git a/display-commonsys-intf/gralloc/QtiGrallocMetadata.h b/display-commonsys-intf/gralloc/QtiGrallocMetadata.h
new file mode 100644
index 0000000..35bf4a0
--- /dev/null
+++ b/display-commonsys-intf/gralloc/QtiGrallocMetadata.h
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *    * Neither the name of The Linux Foundation. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __QTIGRALLOCMETADATA_H__
+#define __QTIGRALLOCMETADATA_H__
+
+#include <color_metadata.h>
+
+#define QTI_VT_TIMESTAMP 10000
+#define QTI_COLOR_METADATA 10001
+#define QTI_PP_PARAM_INTERLACED 10002
+#define QTI_VIDEO_PERF_MODE 10003
+#define QTI_GRAPHICS_METADATA 10004
+#define QTI_UBWC_CR_STATS_INFO 10005
+#define QTI_REFRESH_RATE 10006
+#define QTI_MAP_SECURE_BUFFER 10007
+#define QTI_LINEAR_FORMAT 10008
+#define QTI_SINGLE_BUFFER_MODE 10009
+#define QTI_CVP_METADATA 10010
+#define QTI_VIDEO_HISTOGRAM_STATS 10011
+// File descriptor for allocated buffer
+#define QTI_FD 10012
+// Flags from the private handle of the allocated buffer
+#define QTI_PRIVATE_FLAGS 10013
+// Width of the allocated buffer in pixels
+#define QTI_ALIGNED_WIDTH_IN_PIXELS 10014
+// Height of the allocated buffer in pixels
+#define QTI_ALIGNED_HEIGHT_IN_PIXELS 10015
+// Indicates whether metadata is using default value or has been set
+#define QTI_STANDARD_METADATA_STATUS 10016
+#define QTI_VENDOR_METADATA_STATUS 10017
+#define QTI_BUFFER_TYPE 10018
+
+// Used to indicate to framework that internal definitions are used instead
+#define COMPRESSION_QTI_UBWC 20001
+#define INTERLACED_QTI 20002
+
+#define PLANE_COMPONENT_TYPE_RAW 20003
+#define PLANE_COMPONENT_TYPE_META 20004
+
+#define MAX_NAME_LEN 256
+
+// GRAPHICS_METADATA
+#define GRAPHICS_METADATA_SIZE 4096
+#define GRAPHICS_METADATA_SIZE_IN_BYTES (GRAPHICS_METADATA_SIZE * sizeof(uint32_t))
+typedef struct GraphicsMetadata {
+  uint32_t size;  //unused in Gralloc4, in Gralloc3 it was never returned on Get()
+  uint32_t data[GRAPHICS_METADATA_SIZE]; //Clients must set only raw data with Gralloc4
+} GraphicsMetadata;
+
+// UBWC_CR_STATS_INFO
+#define MAX_UBWC_STATS_LENGTH 32
+enum UBWC_Version {
+  UBWC_UNUSED = 0,
+  UBWC_1_0 = 0x1,
+  UBWC_2_0 = 0x2,
+  UBWC_3_0 = 0x3,
+  UBWC_4_0 = 0x4,
+  UBWC_MAX_VERSION = 0xFF,
+};
+
+struct UBWC_2_0_Stats {
+  uint32_t nCRStatsTile32;  /**< UBWC Stats info for  32 Byte Tile */
+  uint32_t nCRStatsTile64;  /**< UBWC Stats info for  64 Byte Tile */
+  uint32_t nCRStatsTile96;  /**< UBWC Stats info for  96 Byte Tile */
+  uint32_t nCRStatsTile128; /**< UBWC Stats info for 128 Byte Tile */
+  uint32_t nCRStatsTile160; /**< UBWC Stats info for 160 Byte Tile */
+  uint32_t nCRStatsTile192; /**< UBWC Stats info for 192 Byte Tile */
+  uint32_t nCRStatsTile256; /**< UBWC Stats info for 256 Byte Tile */
+};
+
+struct UBWCStats {
+  enum UBWC_Version version; /* Union depends on this version. */
+  uint8_t bDataValid;        /* If [non-zero], CR Stats data is valid.
+                              * Consumers may use stats data.
+                              * If [zero], CR Stats data is invalid.
+                              * Consumers *Shall* not use stats data */
+  union {
+    struct UBWC_2_0_Stats ubwc_stats;
+    uint32_t reserved[MAX_UBWC_STATS_LENGTH]; /* This is for future */
+  };
+};
+
+#define UBWC_STATS_ARRAY_SIZE 2
+struct CropRectangle_t {
+  int32_t left;
+  int32_t top;
+  int32_t right;
+  int32_t bottom;
+};
+
+// CVP_METADATA
+#define CVP_METADATA_SIZE 1024
+enum CVPMetadataFlags {
+  /* bit wise flags */
+  CVP_METADATA_FLAG_NONE = 0x00000000,
+  CVP_METADATA_FLAG_REPEAT = 0x00000001,
+};
+
+typedef struct CVPMetadata {
+  uint32_t size; /* payload size in bytes */
+  uint8_t payload[CVP_METADATA_SIZE];
+  uint32_t capture_frame_rate;
+  /* Frame rate in Q16 format.
+          Eg: fps = 7.5, then
+          capture_frame_rate = 7 << 16 --> Upper 16 bits to represent 7
+          capture_frame_rate |= 5 -------> Lower 16 bits to represent 5
+
+     If size > 0, framerate is valid
+     If size = 0, invalid data, so ignore all parameters */
+  uint32_t cvp_frame_rate;
+  enum CVPMetadataFlags flags;
+  uint32_t reserved[8];
+} CVPMetadata;
+
+// VIDEO_HISTOGRAM_STATS
+
+#define VIDEO_HISTOGRAM_STATS_SIZE (4 * 1024)
+struct VideoHistogramMetadata {
+  uint32_t stats_info[1024]; /* video stats payload */
+  uint32_t stat_len;         /* Payload size in bytes */
+  uint32_t frame_type;       /* bit mask to indicate frame type */
+  uint32_t display_width;
+  uint32_t display_height;
+  uint32_t decode_width;
+  uint32_t decode_height;
+  uint32_t reserved[12];
+};
+
+#define RESERVED_REGION_SIZE 4096
+typedef struct ReservedRegion {
+  uint32_t size;
+  uint8_t data[RESERVED_REGION_SIZE];
+} ReservedRegion;
+
+#define METADATA_SET_SIZE 512
+
+#define IS_VENDOR_METADATA_TYPE(x) (x >= QTI_VT_TIMESTAMP)
+
+#define GET_STANDARD_METADATA_STATUS_INDEX(x) x
+#define GET_VENDOR_METADATA_STATUS_INDEX(x) x - QTI_VT_TIMESTAMP
+
+#endif  //__QTIGRALLOCMETADATA_H__
diff --git a/display-commonsys-intf/gralloc/QtiGrallocPriv.h b/display-commonsys-intf/gralloc/QtiGrallocPriv.h
new file mode 100644
index 0000000..3874ecd
--- /dev/null
+++ b/display-commonsys-intf/gralloc/QtiGrallocPriv.h
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *    * Neither the name of The Linux Foundation. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __QTIGRALLOCPRIV_H__
+#define __QTIGRALLOCPRIV_H__
+
+#include <color_metadata.h>
+#include <cutils/native_handle.h>
+#include <log/log.h>
+
+#include <cinttypes>
+#include <string>
+
+#include "QtiGrallocMetadata.h"
+
+#ifndef __QTI_DISPLAY_GRALLOC__
+#pragma message "QtiGrallocPriv.h should not be included"
+#endif
+
+/*
+ *
+ * DISCLAIMER:
+ * INTERNAL GRALLOC USE ONLY - THIS FILE SHOULD NOT BE INCLUDED BY GRALLOC CLIENTS
+ * The location will be changed and this file will not be exposed
+ * once qdMetaData copy functions are deprecated
+ *
+ */
+
+#define METADATA_V2
+
+// TODO: MetaData_t should be in qtigralloc namespace
+struct MetaData_t {
+  int32_t operation;
+  int32_t interlaced;
+  float refreshrate;
+  int32_t mapSecureBuffer;
+  /* Deprecated */
+  uint32_t s3dFormat;
+  /* VENUS output buffer is linear for UBWC Interlaced video */
+  uint32_t linearFormat;
+  /* Set by graphics to indicate that this buffer will be written to but not
+   * swapped out */
+  uint32_t isSingleBufferMode;
+
+  /* Set by camera to program the VT Timestamp */
+  uint64_t vtTimeStamp;
+  /* Color Aspects + HDR info */
+  ColorMetaData color;
+  /* Consumer should read this data as follows based on
+   * Gralloc flag "interlaced" listed above.
+   * [0] : If it is progressive.
+   * [0] : Top field, if it is interlaced.
+   * [1] : Do not read, if it is progressive.
+   * [1] : Bottom field, if it is interlaced.
+   */
+  struct UBWCStats ubwcCRStats[UBWC_STATS_ARRAY_SIZE];
+  /* Set by camera to indicate that this buffer will be used for a High
+   * Performance Video Usecase */
+  uint32_t isVideoPerfMode;
+  /* Populated and used by adreno during buffer size calculation.
+   * Set only for RGB formats. */
+  GraphicsMetadata graphics_metadata;
+  /* Video hisogram stats populated by video decoder */
+  struct VideoHistogramMetadata video_histogram_stats;
+  /*
+   * Producer (camera) will set cvp metadata and consumer (video) will
+   * use it. The format of metadata is known to producer and consumer.
+   */
+  CVPMetadata cvpMetadata;
+  CropRectangle_t crop;
+  int32_t blendMode;
+  char name[MAX_NAME_LEN];
+  ReservedRegion reservedRegion;
+  bool isStandardMetadataSet[METADATA_SET_SIZE];
+  bool isVendorMetadataSet[METADATA_SET_SIZE];
+  uint64_t reservedSize;
+};
+
+namespace qtigralloc {
+#define QTI_HANDLE_CONST(exp) static_cast<const private_handle_t *>(exp)
+
+#pragma pack(push, 4)
+struct private_handle_t : public native_handle_t {
+  // file-descriptors dup'd over IPC
+  int fd;
+  int fd_metadata;
+
+  // values sent over IPC
+  int magic;
+  int flags;
+  int width;             // holds width of the actual buffer allocated
+  int height;            // holds height of the  actual buffer allocated
+  int unaligned_width;   // holds width client asked to allocate
+  int unaligned_height;  // holds height client asked to allocate
+  int format;
+  int buffer_type;
+  unsigned int layer_count;
+  uint64_t id;
+  uint64_t usage;
+
+  unsigned int size;
+  unsigned int offset;
+  unsigned int offset_metadata;
+  uint64_t base;
+  uint64_t base_metadata;
+  uint64_t gpuaddr;
+  static const int kNumFds = 2;
+  static const int kMagic = 'gmsm';
+
+  static inline int NumInts() {
+    return ((sizeof(private_handle_t) - sizeof(native_handle_t)) / sizeof(int)) - kNumFds;
+  }
+
+  private_handle_t(int fd, int meta_fd, int flags, int width, int height, int uw, int uh,
+                   int format, int buf_type, unsigned int size, uint64_t usage = 0)
+      : fd(fd),
+        fd_metadata(meta_fd),
+        magic(kMagic),
+        flags(flags),
+        width(width),
+        height(height),
+        unaligned_width(uw),
+        unaligned_height(uh),
+        format(format),
+        buffer_type(buf_type),
+        layer_count(1),
+        id(0),
+        usage(usage),
+        size(size),
+        offset(0),
+        offset_metadata(0),
+        base(0),
+        base_metadata(0),
+        gpuaddr(0) {
+    version = static_cast<int>(sizeof(native_handle));
+    numInts = NumInts();
+    numFds = kNumFds;
+  }
+
+  ~private_handle_t() { magic = 0; }
+
+  static int validate(const native_handle *h) {
+    auto *hnd = static_cast<const private_handle_t *>(h);
+    if (!h || h->version != sizeof(native_handle) || h->numInts != NumInts() ||
+        h->numFds != kNumFds) {
+      ALOGE("Invalid gralloc handle (at %p): ver(%d/%zu) ints(%d/%d) fds(%d/%d)", h,
+            h ? h->version : -1, sizeof(native_handle), h ? h->numInts : -1, NumInts(),
+            h ? h->numFds : -1, kNumFds);
+      return -1;
+    }
+    if (hnd->magic != kMagic) {
+      ALOGE("handle = %p  invalid  magic(%c%c%c%c/%c%c%c%c)", hnd,
+            hnd ? (((hnd->magic >> 24) & 0xFF) ? ((hnd->magic >> 24) & 0xFF) : '-') : '?',
+            hnd ? (((hnd->magic >> 16) & 0xFF) ? ((hnd->magic >> 16) & 0xFF) : '-') : '?',
+            hnd ? (((hnd->magic >> 8) & 0xFF) ? ((hnd->magic >> 8) & 0xFF) : '-') : '?',
+            hnd ? (((hnd->magic >> 0) & 0xFF) ? ((hnd->magic >> 0) & 0xFF) : '-') : '?',
+            (kMagic >> 24) & 0xFF, (kMagic >> 16) & 0xFF, (kMagic >> 8) & 0xFF,
+            (kMagic >> 0) & 0xFF);
+      return -1;
+    }
+
+    return 0;
+  }
+
+  static void Dump(const private_handle_t *hnd) {
+    ALOGD("handle id:%" PRIu64
+          " wxh:%dx%d uwxuh:%dx%d size: %d fd:%d fd_meta:%d flags:0x%x "
+          "usage:0x%" PRIx64 "  format:0x%x layer_count: %d",
+          hnd->id, hnd->width, hnd->height, hnd->unaligned_width, hnd->unaligned_height, hnd->size,
+          hnd->fd, hnd->fd_metadata, hnd->flags, hnd->usage, hnd->format, hnd->layer_count);
+  }
+};
+#pragma pack(pop)
+
+}  // namespace qtigralloc
+
+#endif  //__QTIGRALLOCPRIV_H__
diff --git a/display-commonsys-intf/gralloc/gr_priv_handle.h b/display-commonsys-intf/gralloc/gr_priv_handle.h
new file mode 100644
index 0000000..98f9f69
--- /dev/null
+++ b/display-commonsys-intf/gralloc/gr_priv_handle.h
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
+ * Not a Contribution
+ *
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __GR_PRIV_HANDLE_H__
+#define __GR_PRIV_HANDLE_H__
+
+#include <log/log.h>
+#include <hardware/gralloc.h>
+#include <hardware/gralloc1.h>
+#ifdef __cplusplus
+#include <cinttypes>
+#endif
+
+#define GRALLOC1_FUNCTION_PERFORM 0x00001000
+
+#define DBG_HANDLE false
+
+typedef gralloc1_error_t (*GRALLOC1_PFN_PERFORM)(gralloc1_device_t *device, int operation, ...);
+
+#define PRIV_HANDLE_CONST(exp) static_cast<const private_handle_t *>(exp)
+
+#pragma pack(push, 4)
+#ifdef __cplusplus
+struct private_handle_t : public native_handle_t {
+#else
+struct private_handle_t {
+        native_handle_t nativeHandle;
+#endif
+  enum {
+    PRIV_FLAGS_FRAMEBUFFER = 0x00000001,
+    PRIV_FLAGS_USES_ION = 0x00000008,
+    PRIV_FLAGS_NEEDS_FLUSH = 0x00000020,
+    PRIV_FLAGS_INTERNAL_ONLY = 0x00000040,
+    PRIV_FLAGS_NON_CPU_WRITER = 0x00000080,
+    PRIV_FLAGS_CACHED = 0x00000200,
+    PRIV_FLAGS_SECURE_BUFFER = 0x00000400,
+    PRIV_FLAGS_EXTERNAL_ONLY = 0x00002000,
+    PRIV_FLAGS_PROTECTED_BUFFER = 0x00004000,
+    PRIV_FLAGS_VIDEO_ENCODER = 0x00010000,
+    PRIV_FLAGS_CAMERA_WRITE = 0x00020000,
+    PRIV_FLAGS_CAMERA_READ = 0x00040000,
+    PRIV_FLAGS_HW_COMPOSER = 0x00080000,
+    PRIV_FLAGS_HW_TEXTURE = 0x00100000,
+    PRIV_FLAGS_ITU_R_601 = 0x00200000,     // Unused from display
+    PRIV_FLAGS_ITU_R_601_FR = 0x00400000,  // Unused from display
+    PRIV_FLAGS_ITU_R_709 = 0x00800000,     // Unused from display
+    PRIV_FLAGS_SECURE_DISPLAY = 0x01000000,
+    PRIV_FLAGS_TILE_RENDERED = 0x02000000,
+    PRIV_FLAGS_CPU_RENDERED = 0x04000000,
+    PRIV_FLAGS_UBWC_ALIGNED = 0x08000000,
+    PRIV_FLAGS_DISP_CONSUMER = 0x10000000,
+    PRIV_FLAGS_CLIENT_ALLOCATED = 0x20000000,  // Ion buffer allocated outside of gralloc
+    PRIV_FLAGS_UBWC_ALIGNED_PI = 0x40000000,  // PI format
+  };
+
+  // file-descriptors dup'd over IPC
+  int fd;
+  int fd_metadata;
+
+  // values sent over IPC
+  int magic;
+  int flags;
+  int width;             // holds width of the actual buffer allocated
+  int height;            // holds height of the  actual buffer allocated
+  int unaligned_width;   // holds width client asked to allocate
+  int unaligned_height;  // holds height client asked to allocate
+  int format;
+  int buffer_type;
+  unsigned int layer_count;
+  uint64_t id;
+  uint64_t usage;
+
+  unsigned int size;
+  unsigned int offset;
+  unsigned int offset_metadata;
+  uint64_t base;
+  uint64_t base_metadata;
+  uint64_t gpuaddr;
+#ifdef __cplusplus
+  static const int kNumFds = 2;
+  static const int kMagic = 'gmsm';
+
+  static inline int NumInts() {
+    return ((sizeof(private_handle_t) - sizeof(native_handle_t)) / sizeof(int)) - kNumFds;
+  }
+
+  private_handle_t(int fd, int meta_fd, int flags, int width, int height, int uw, int uh,
+                   int format, int buf_type, unsigned int size, uint64_t usage = 0)
+      : fd(fd),
+        fd_metadata(meta_fd),
+        magic(kMagic),
+        flags(flags),
+        width(width),
+        height(height),
+        unaligned_width(uw),
+        unaligned_height(uh),
+        format(format),
+        buffer_type(buf_type),
+        layer_count(1),
+        id(0),
+        usage(usage),
+        size(size),
+        offset(0),
+        offset_metadata(0),
+        base(0),
+        base_metadata(0),
+        gpuaddr(0) {
+    version = static_cast<int>(sizeof(native_handle));
+    numInts = NumInts();
+    numFds = kNumFds;
+  }
+
+  // Legacy constructor used by some clients
+  private_handle_t(int fd, unsigned int size, int usage, int buf_type, int format, int w, int h)
+      : private_handle_t(fd, -1, PRIV_FLAGS_CLIENT_ALLOCATED, w, h, 0, 0, format, buf_type, size,
+                         static_cast<uint64_t>(usage)) {}
+
+  ~private_handle_t() {
+    magic = 0;
+    ALOGE_IF(DBG_HANDLE, "Deleting buffer handle %p", this);
+  }
+
+  static int validate(const native_handle *h) {
+    auto *hnd = static_cast<const private_handle_t *>(h);
+    if (!h || h->version != sizeof(native_handle) || h->numInts != NumInts() ||
+        h->numFds != kNumFds) {
+      ALOGE("Invalid gralloc handle (at %p): ver(%d/%zu) ints(%d/%d) fds(%d/%d)",
+          h, h ? h->version : -1, sizeof(native_handle), h ? h->numInts : -1, NumInts(),
+          h ? h->numFds : -1, kNumFds);
+      return -EINVAL;
+    }
+    if (hnd->magic != kMagic) {
+      ALOGE("handle = %p  invalid  magic(%c%c%c%c/%c%c%c%c)",hnd,
+          hnd ? (((hnd->magic >> 24) & 0xFF) ? ((hnd->magic >> 24) & 0xFF) : '-') : '?',
+          hnd ? (((hnd->magic >> 16) & 0xFF) ? ((hnd->magic >> 16) & 0xFF) : '-') : '?',
+          hnd ? (((hnd->magic >> 8) & 0xFF) ? ((hnd->magic >> 8) & 0xFF) : '-') : '?',
+          hnd ? (((hnd->magic >> 0) & 0xFF) ? ((hnd->magic >> 0) & 0xFF) : '-') : '?',
+          (kMagic >> 24) & 0xFF, (kMagic >> 16) & 0xFF, (kMagic >> 8) & 0xFF, (kMagic >> 0) & 0xFF);
+      return -EINVAL;
+    }
+
+    return 0;
+  }
+
+  static void Dump(const private_handle_t *hnd) {
+    ALOGD("handle id:%" PRIu64
+          " wxh:%dx%d uwxuh:%dx%d size: %d fd:%d fd_meta:%d flags:0x%x "
+          "usage:0x%" PRIx64 "  format:0x%x layer_count: %d",
+          hnd->id, hnd->width, hnd->height, hnd->unaligned_width, hnd->unaligned_height, hnd->size,
+          hnd->fd, hnd->fd_metadata, hnd->flags, hnd->usage, hnd->format, hnd->layer_count);
+  }
+
+  int GetUnalignedWidth() const { return unaligned_width; }
+
+  int GetUnalignedHeight() const { return unaligned_height; }
+
+  int GetColorFormat() const { return format; }
+
+  unsigned int GetLayerCount() const { return layer_count; }
+
+  int GetStride() const {
+    // In handle we currently store aligned width after allocation.
+    return width;
+  }
+
+  uint64_t GetUsage() const { return usage; }
+
+  uint64_t GetBackingstore() const { return id; }
+#endif
+};
+#pragma pack(pop)
+
+#endif  // __GR_PRIV_HANDLE_H__
diff --git a/display-commonsys-intf/gralloc/gralloc_priv.h b/display-commonsys-intf/gralloc/gralloc_priv.h
new file mode 100644
index 0000000..77c8787
--- /dev/null
+++ b/display-commonsys-intf/gralloc/gralloc_priv.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
+ * Not a Contribution
+ *
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __GRALLOC_PRIV_H__
+#define __GRALLOC_PRIV_H__
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "QtiGrallocDefs.h"
+#include "gr_priv_handle.h"
+
+#pragma message "Warning: gralloc_priv.h is deprecated"
+
+#define GRALLOC_PROP_PREFIX  "vendor.gralloc."
+#define GRALLOC_PROP(prop_name) GRALLOC_PROP_PREFIX prop_name
+
+#define DISABLE_UBWC_PROP                    GRALLOC_PROP("disable_ubwc")
+#define DISABLE_AHARDWAREBUFFER_PROP         GRALLOC_PROP("disable_ahardware_buffer")
+#define ENABLE_FB_UBWC_PROP                  GRALLOC_PROP("enable_fb_ubwc")
+#define MAP_FB_MEMORY_PROP                   GRALLOC_PROP("map_fb_memory")
+#define USE_SYSTEM_HEAP_FOR_SENSORS          GRALLOC_PROP("use_system_heap_for_sensors")
+
+#define ROUND_UP_PAGESIZE(x) roundUpToPageSize(x)
+inline int roundUpToPageSize(int x) {
+  return (x + (getpagesize() - 1)) & ~(getpagesize() - 1);
+}
+
+/* Legacy gralloc1 definitions */
+/* Some clients may still be using the old flags */
+#define GRALLOC1_PRODUCER_USAGE_PRIVATE_ADSP_HEAP GRALLOC_USAGE_PRIVATE_ADSP_HEAP
+#define GRALLOC1_PRODUCER_USAGE_PRIVATE_ALLOC_UBWC GRALLOC_USAGE_PRIVATE_ALLOC_UBWC
+#define GRALLOC1_PRODUCER_USAGE_PRIVATE_UNCACHED GRALLOC_USAGE_PRIVATE_UNCACHED
+#define GRALLOC1_CONSUMER_USAGE_PRIVATE_SECURE_DISPLAY GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY
+#define GRALLOC1_PRODUCER_USAGE_PRIVATE_MM_HEAP GRALLOC_USAGE_PRIVATE_MM_HEAP
+#define GRALLOC1_PRODUCER_USAGE_PRIVATE_10BIT GRALLOC_USAGE_PRIVATE_10BIT
+#define GRALLOC1_PRODUCER_USAGE_PRIVATE_10BIT_TP GRALLOC_USAGE_PRIVATE_10BIT_TP
+#define GRALLOC1_CONSUMER_USAGE_PRIVATE_10BIT_TP GRALLOC_USAGE_PRIVATE_10BIT_TP
+#define GRALLOC1_PRODUCER_USAGE_PRIVATE_VIDEO_NV21_ENCODER GRALLOC_USAGE_PRIVATE_VIDEO_NV21_ENCODER
+
+// for PERFORM API :
+#define GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER 1
+#define GRALLOC_MODULE_PERFORM_GET_STRIDE 2
+#define GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_FROM_HANDLE 3
+#define GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_AND_HEIGHT_FROM_HANDLE 4
+#define GRALLOC_MODULE_PERFORM_GET_ATTRIBUTES 5
+#define GRALLOC_MODULE_PERFORM_GET_COLOR_SPACE_FROM_HANDLE 6
+#define GRALLOC_MODULE_PERFORM_GET_YUV_PLANE_INFO 7
+#define GRALLOC_MODULE_PERFORM_GET_MAP_SECURE_BUFFER_INFO 8
+#define GRALLOC_MODULE_PERFORM_GET_UBWC_FLAG 9
+#define GRALLOC_MODULE_PERFORM_GET_RGB_DATA_ADDRESS 10
+#define GRALLOC_MODULE_PERFORM_GET_IGC 11
+#define GRALLOC_MODULE_PERFORM_SET_IGC 12
+#define GRALLOC_MODULE_PERFORM_SET_SINGLE_BUFFER_MODE 13
+#define GRALLOC1_MODULE_PERFORM_GET_BUFFER_SIZE_AND_DIMENSIONS 14
+#define GRALLOC1_MODULE_PERFORM_GET_INTERLACE_FLAG 15
+#define GRALLOC_MODULE_PERFORM_GET_GRAPHICS_METADATA 16
+
+/* possible values for inverse gamma correction */
+#define HAL_IGC_NOT_SPECIFIED 0
+#define HAL_IGC_s_RGB 1
+
+/* Color Space: Values maps to ColorSpace_t in qdMetadata.h */
+#define HAL_CSC_ITU_R_601 0
+#define HAL_CSC_ITU_R_601_FR 1
+#define HAL_CSC_ITU_R_709 2
+#define HAL_CSC_ITU_R_2020 3
+#define HAL_CSC_ITU_R_2020_FR 4
+
+/* possible formats for 3D content*/
+enum {
+  HAL_NO_3D = 0x0,
+  HAL_3D_SIDE_BY_SIDE_L_R = 0x1,
+  HAL_3D_SIDE_BY_SIDE_R_L = 0x2,
+  HAL_3D_TOP_BOTTOM = 0x4,
+  HAL_3D_IN_SIDE_BY_SIDE_L_R = 0x10000,  // unused legacy format
+};
+
+/* Flag to determine interlaced content
+ * Value maps to Flags presents in types.hal of QtiMapperextensions
+ */
+enum {
+  LAYOUT_INTERLACED_FLAG = 1 << 0,
+};
+
+#endif  // __GRALLOC_PRIV_H__
diff --git a/display-commonsys-intf/include/color_metadata.h b/display-commonsys-intf/include/color_metadata.h
new file mode 100644
index 0000000..c8a5890
--- /dev/null
+++ b/display-commonsys-intf/include/color_metadata.h
@@ -0,0 +1,198 @@
+/*
+* Copyright (c) 2016-2018, 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification, are permitted
+* provided that the following conditions are met:
+*    * Redistributions of source code must retain the above copyright notice, this list of
+*      conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above copyright notice, this list of
+*      conditions and the following disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation nor the names of its contributors may be used to
+*      endorse or promote products derived from this software without specific prior written
+*      permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __COLOR_METADATA_H__
+#define __COLOR_METADATA_H__
+
+#ifdef __cplusplus
+extern "C" {
+#else
+#include <stdbool.h>
+#endif
+#include <stdint.h>
+
+typedef enum ColorRange {
+  Range_Limited   = 0,
+  Range_Full      = 1,
+  Range_Extended  = 2,
+  Range_Max     = 0xff,
+} ColorRange;
+
+// The following values matches the HEVC spec
+typedef enum ColorPrimaries {
+  // Unused = 0;
+  ColorPrimaries_BT709_5     = 1,  // ITU-R BT.709-5 or equivalent
+  /* Unspecified = 2, Reserved = 3*/
+  ColorPrimaries_BT470_6M    = 4,  // ITU-R BT.470-6 System M or equivalent
+  ColorPrimaries_BT601_6_625 = 5,  // ITU-R BT.601-6 625 or equivalent
+  ColorPrimaries_BT601_6_525 = 6,  // ITU-R BT.601-6 525 or equivalent
+  ColorPrimaries_SMPTE_240M  = 7,  // SMPTE_240M
+  ColorPrimaries_GenericFilm = 8,  // Generic Film
+  ColorPrimaries_BT2020      = 9,  // ITU-R BT.2020 or equivalent
+  ColorPrimaries_SMPTE_ST428 = 10,  // SMPTE_240M
+  ColorPrimaries_AdobeRGB    = 11,
+  ColorPrimaries_DCIP3       = 12,
+  ColorPrimaries_EBU3213     = 22,
+  ColorPrimaries_Max         = 0xff,
+} ColorPrimaries;
+
+typedef enum GammaTransfer {
+  // Unused = 0;
+  Transfer_sRGB            = 1,  // ITR-BT.709-5
+  /* Unspecified = 2, Reserved = 3 */
+  Transfer_Gamma2_2        = 4,
+  Transfer_Gamma2_8        = 5,
+  Transfer_SMPTE_170M      = 6,  // BT.601-6 525 or 625
+  Transfer_SMPTE_240M      = 7,  // SMPTE_240M
+  Transfer_Linear          = 8,
+  Transfer_Log             = 9,
+  Transfer_Log_Sqrt        = 10,
+  Transfer_XvYCC           = 11,  // IEC 61966-2-4
+  Transfer_BT1361          = 12,  // Rec.ITU-R BT.1361 extended gamut
+  Transfer_sYCC            = 13,  // IEC 61966-2-1 sRGB or sYCC
+  Transfer_BT2020_2_1      = 14,  // Rec. ITU-R BT.2020-2 (same as the values 1, 6, and 15)
+  Transfer_BT2020_2_2      = 15,  // Rec. ITU-R BT.2020-2 (same as the values 1, 6, and 14)
+  Transfer_SMPTE_ST2084    = 16,  // 2084
+  // transfers unlikely to be required by Android
+  Transfer_ST_428          = 17,  // SMPTE ST 428-1
+  Transfer_HLG             = 18,  // ARIB STD-B67
+  Transfer_Max             = 0xff,
+} GammaTransfer;
+
+typedef enum MatrixCoEfficients {
+  MatrixCoEff_Identity           = 0,
+  MatrixCoEff_BT709_5            = 1,
+  /* Unspecified = 2, Reserved = 3 */
+  MatrixCoeff_FCC_73_682         = 4,
+  MatrixCoEff_BT601_6_625        = 5,
+  MatrixCoEff_BT601_6_525        = 6,
+  MatrixCoEff_SMPTE240M          = 7,  // used with 601_525_Unadjusted
+  MatrixCoEff_YCgCo              = 8,
+  MatrixCoEff_BT2020             = 9,
+  MatrixCoEff_BT2020Constant     = 10,
+  MatrixCoEff_BT601_6_Unadjusted = 11,  // Used with BT601_625(KR=0.222, KB=0.071)
+  MatrixCoEff_DCIP3              = 12,
+  MatrixCoEff_Chroma_NonConstant = 13,
+  MatrixCoEff_Max                = 0xff,
+} MatrixCoEfficients;
+
+typedef struct Primaries {
+  uint32_t rgbPrimaries[3][2];  // unit 1/50000;
+  uint32_t whitePoint[2];  // unit 1/50000;
+} Primaries;
+
+typedef struct MasteringDisplay {
+  bool      colorVolumeSEIEnabled;
+  Primaries primaries;
+  uint32_t  maxDisplayLuminance;  // unit: cd/m^2.
+  uint32_t  minDisplayLuminance;  // unit: 1/10000 cd/m^2.
+} MasteringDisplay;
+
+typedef struct ContentLightLevel {
+  bool     lightLevelSEIEnabled;
+  uint32_t maxContentLightLevel;  // unit: cd/m^2.
+  uint32_t minPicAverageLightLevel;  // unit: cd/m^2, will be DEPRECATED, use below
+  uint32_t maxPicAverageLightLevel;  // unit: cd/m^2, its same as maxFrameAvgLightLevel(CTA-861-G)
+} ContentLightLevel;
+
+typedef struct ColorRemappingInfo {
+  bool               criEnabled;
+  uint32_t           crId;
+  uint32_t           crCancelFlag;
+  uint32_t           crPersistenceFlag;
+  uint32_t           crVideoSignalInfoPresentFlag;
+  uint32_t           crRange;
+  ColorPrimaries     crPrimaries;
+  GammaTransfer      crTransferFunction;
+  MatrixCoEfficients crMatrixCoefficients;
+  uint32_t           crInputBitDepth;
+  uint32_t           crOutputBitDepth;
+  uint32_t           crPreLutNumValMinusOne[3];
+  uint32_t           crPreLutCodedValue[3*33];
+  uint32_t           crPreLutTargetValue[3*33];
+  uint32_t           crMatrixPresentFlag;
+  uint32_t           crLog2MatrixDenom;
+  int32_t            crCoefficients[3*3];
+  uint32_t           crPostLutNumValMinusOne[3];
+  uint32_t           crPostLutCodedValue[3*33];
+  uint32_t           crPostLutTargetValue[3*33];
+} ColorRemappingInfo;
+
+#define HDR_DYNAMIC_META_DATA_SZ 1024
+typedef struct ColorMetaData {
+  // Default values based on sRGB, needs to be overridden in gralloc
+  // based on the format and size.
+  ColorPrimaries     colorPrimaries;
+  ColorRange         range;
+  GammaTransfer      transfer;
+  MatrixCoEfficients matrixCoefficients;
+
+  MasteringDisplay   masteringDisplayInfo;
+  ContentLightLevel  contentLightLevel;
+  ColorRemappingInfo cRI;
+
+  // Dynamic meta data elements
+  bool dynamicMetaDataValid;
+  uint32_t dynamicMetaDataLen;
+  uint8_t dynamicMetaDataPayload[HDR_DYNAMIC_META_DATA_SZ];
+} ColorMetaData;
+
+typedef struct Color10Bit {
+  uint32_t R: 10;
+  uint32_t G: 10;
+  uint32_t B: 10;
+  uint32_t A: 2;
+} Color10Bit;
+
+typedef struct Lut3d {
+  uint16_t dim;  // dimension of each side of LUT cube (ex: 13, 17)in lutEntries
+  uint16_t gridSize;  // number of elements in the gridEntries
+  /* Matrix ordering convension
+  for (b = 0; b < dim; b++) {
+    for (g = 0; g < dim; g++) {
+      for (r = 0; r < dim; r++) {
+        read/write [mR mG mB] associated w/ 3DLUT[r][g][b] to/from file
+      }
+    }
+  } */
+  Color10Bit *lutEntries;
+  bool validLutEntries;  // Indicates if entries are valid and can be used.
+  /*
+   The grid is a 1D LUT for each of the R,G,B channels that can be
+   used to apply an independent nonlinear transformation to each
+   channel before it is used as a coordinate for addressing
+   the uniform 3D LUT.  This effectively creates a non-uniformly
+   sampled 3D LUT.  This is useful for having independent control
+   of the sampling grid density along each dimension for greater
+   precision in spite of having a relatively small number of samples.i
+  */
+  Color10Bit *gridEntries;
+  bool validGridEntries;  // Indicates if entries are valid and can be used.
+} Lut3d;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // __COLOR_METADATA_H__
diff --git a/display-commonsys-intf/include/composer_extn_intf.h b/display-commonsys-intf/include/composer_extn_intf.h
new file mode 100644
index 0000000..9bc3f0d
--- /dev/null
+++ b/display-commonsys-intf/include/composer_extn_intf.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __COMPOSER_EXTN_INTF_H__
+#define __COMPOSER_EXTN_INTF_H__
+
+#include <dlfcn.h>
+#include "frame_scheduler_intf.h"
+#include "display_extn_intf.h"
+
+#define COMPOSER_EXTN_REV_MAJOR (1)
+#define COMPOSER_EXTN_REV_MINOR (0)
+#define COMPOSER_EXTN_VERSION_TAG ((uint16_t) ((COMPOSER_EXTN_REV_MAJOR << 8) \
+                                              | COMPOSER_EXTN_REV_MINOR))
+
+namespace composer {
+
+class ComposerExtnIntf {
+ public:
+  virtual int CreateFrameScheduler(FrameSchedulerIntf **intf) = 0;
+  virtual void DestroyFrameScheduler(FrameSchedulerIntf *intf) = 0;
+  virtual int CreateDisplayExtn(DisplayExtnIntf **intf) = 0;
+  virtual void DestroyDisplayExtn(DisplayExtnIntf *intf) = 0;
+ protected:
+  virtual ~ComposerExtnIntf() { }
+};
+
+class ComposerExtnLib {
+ public:
+  static ComposerExtnIntf * GetInstance() {
+    return g_composer_ext_lib_.composer_ext_intf_;
+  }
+
+ private:
+  const char *lib_name = "libcomposerextn.qti.so";
+
+  typedef int (*CreateComposerExtn)(uint16_t version, ComposerExtnIntf **intf);
+  typedef void (*DestroyComposerExtn)(ComposerExtnIntf *intf);
+
+  ComposerExtnLib() {
+    lib_obj_ = ::dlopen(lib_name, RTLD_NOW);
+    if (!lib_obj_) {
+      return;
+    }
+
+    create_composer_ext_fn_ = reinterpret_cast<CreateComposerExtn>(
+                                    ::dlsym(lib_obj_, "CreateComposerExtn"));
+    destroy_composer_ext_fn_ = reinterpret_cast<DestroyComposerExtn>(
+                                    ::dlsym(lib_obj_, "DestroyComposerExtn"));
+    if (create_composer_ext_fn_ && destroy_composer_ext_fn_) {
+      create_composer_ext_fn_(COMPOSER_EXTN_VERSION_TAG, &composer_ext_intf_);
+    }
+  }
+
+  ~ComposerExtnLib() {
+    if (composer_ext_intf_) {
+      destroy_composer_ext_fn_(composer_ext_intf_);
+    }
+
+    if (lib_obj_) {
+      ::dlclose(lib_obj_);
+    }
+  }
+
+  static ComposerExtnLib g_composer_ext_lib_;
+  void *lib_obj_ = nullptr;
+  CreateComposerExtn create_composer_ext_fn_ = nullptr;
+  DestroyComposerExtn destroy_composer_ext_fn_ = nullptr;
+  ComposerExtnIntf *composer_ext_intf_ = nullptr;
+};
+
+}  // namespace composer
+
+#endif  // __COMPOSER_EXTN_INTF_H__
diff --git a/display-commonsys-intf/include/display_color_processing.h b/display-commonsys-intf/include/display_color_processing.h
new file mode 100644
index 0000000..49cb5d7
--- /dev/null
+++ b/display-commonsys-intf/include/display_color_processing.h
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __DISP_COLOR_PROCESSING_H__
+#define __DISP_COLOR_PROCESSING_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LUT3D_ENTRIES_SIZE (17 * 17 * 17)
+#define LUT3D_GC_ENTRIES_SIZE 1024
+
+struct rgb {
+  uint32_t r;
+  uint32_t g;
+  uint32_t b;
+};
+
+struct rgb_entry {
+  struct rgb in;
+  struct rgb out;
+};
+
+/*
+struct lut3d_info
+  flags     -- Reserved
+  lut3d_id  -- Unique ID used to distinguish individual 3D Lut tables
+  uniform   -- Identifies if coefficients are uniform (1) or non-uniform (0)
+  num_entries-- Identifies the number of lut values in the table
+  entries   -- Table buffer holding the lut values.
+
+               All coefficients are expected to be tightly packed in the
+               structure, any unused buffer space shall exist at the end
+               of the buffer.
+*/
+struct lut3d_info {
+  uint32_t flags;
+  uint32_t lut3d_id;
+  uint32_t uniform;
+  uint32_t num_entries;
+  struct rgb_entry entries[LUT3D_ENTRIES_SIZE];
+};
+
+/*
+struct lut1d_info
+  flags       -- Reserved
+  bit_width   -- Bit width of each entry
+  num_entries -- Identifies the number of lut values in the table
+  entries     -- Table buffer holding the lut values
+*/
+#define LUT1D_ENTRIES_SIZE (256)
+struct lut1d_info {
+  uint32_t flags;
+  uint32_t bit_width;
+  uint32_t strength;
+  uint32_t num_entries;
+  struct rgb entries[LUT1D_ENTRIES_SIZE];
+};
+
+static const uint32_t kDeTuningFlagSharpFactor = 0x01;
+static const uint32_t kDeTuningFlagClip = 0x02;
+static const uint32_t kDeTuningFlagThrQuiet = 0x04;
+static const uint32_t kDeTuningFlagThrDieout = 0x08;
+static const uint32_t kDeTuningFlagThrLow = 0x10;
+static const uint32_t kDeTuningFlagThrHigh = 0x20;
+static const uint32_t kDeTuningFlagContentQualLevel = 0x40;
+static const uint32_t kDeTuningFlagDeBlend = 0x80;
+
+typedef enum {
+  kDeContentQualUnknown,
+  kDeContentQualLow,
+  kDeContentQualMedium,
+  kDeContentQualHigh,
+  kDeContentQualMax,
+} PPDEContentQualLevel;
+
+typedef enum {
+  kDeContentTypeUnknown,
+  kDeContentTypeVideo,
+  kDeContentTypeGraphics,
+  kDeContentTypeMax,
+} PPDEContentType;
+
+/*
+struct PPDETuningCfg
+*/
+struct PPDETuningCfg {
+  uint32_t flags;
+  int32_t sharp_factor;
+  uint16_t thr_quiet;
+  uint16_t thr_dieout;
+  uint16_t thr_low;
+  uint16_t thr_high;
+  uint16_t clip;
+  PPDEContentQualLevel quality;
+  PPDEContentType content_type;
+  uint32_t de_blend;
+};
+
+struct PPDETuningCfgData {
+  uint32_t cfg_en;
+  struct PPDETuningCfg params;
+  bool cfg_pending;
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif  // __DISP_COLOR_PROCESSING_H__
diff --git a/display-commonsys-intf/include/display_extn_intf.h b/display-commonsys-intf/include/display_extn_intf.h
new file mode 100644
index 0000000..c3e0c83
--- /dev/null
+++ b/display-commonsys-intf/include/display_extn_intf.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __DISP_EXTN_INTF_H__
+#define __DISP_EXTN_INTF_H__
+
+#define EARLY_WAKEUP_FEATURE 1
+
+namespace composer {
+
+class DisplayExtnIntf {
+ public:
+  virtual int SetContentFps(uint32_t fps) = 0;
+  virtual void RegisterDisplay(uint32_t display_id) = 0;
+  virtual void UnregisterDisplay(uint32_t display_id) = 0;
+  virtual int SetActiveConfig(uint32_t display_id, uint32_t config_id) = 0;
+  virtual int NotifyEarlyWakeUp(bool gpu, bool display) = 0;
+  virtual int NotifyDisplayEarlyWakeUp(uint32_t display_id) = 0;
+
+ protected:
+  virtual ~DisplayExtnIntf() { }
+};
+
+}  // namespace composer
+
+#endif  // __DISP_EXTN_INTF_H__
diff --git a/display-commonsys-intf/include/frame_extn_intf.h b/display-commonsys-intf/include/frame_extn_intf.h
new file mode 100644
index 0000000..b6bfe41
--- /dev/null
+++ b/display-commonsys-intf/include/frame_extn_intf.h
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2019, The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification, are permitted
+* provided that the following conditions are met:
+*    * Redistributions of source code must retain the above copyright notice, this list of
+*      conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above copyright notice, this list of
+*      conditions and the following disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation nor the names of its contributors may be used to
+*      endorse or promote products derived from this software without specific prior written
+*      permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __FRAME_EXTN_INTF_H__
+#define __FRAME_EXTN_INTF_H__
+
+#include <utils/Timers.h>
+#include <sys/types.h>
+#include <string>
+
+#define EXTENSION_LIBRARY_NAME "libframeextension.so"
+#define CREATE_FRAME_EXTN_INTERFACE "CreateFrameExtnInterface"
+#define DESTROY_FRAME_EXTN_INTERFACE "DestroyFrameExtnInterface"
+
+namespace composer {
+
+class FrameExtnIntf;
+
+// Function addresses queried at runtime using ::dlsym()
+typedef bool (*CreateFrameExtnInterface)(FrameExtnIntf **interface);
+typedef bool (*DestroyFrameExtnInterface)(FrameExtnIntf *interface);
+
+/*! @brief This structure defines extension version.
+
+    @details It is used to avoid any mismatch of versions between frameextension library
+    implementation and its clients usage (like SurfaceFlinger).
+
+  @sa FrameInfo
+*/
+struct Version {
+  uint8_t minor;
+  uint8_t major;
+};
+
+/*! @brief This structure defines the Frame info required by FrameExtnIntf.
+
+  @sa FrameExtnIntf::SetFrameInfo
+*/
+struct FrameInfo {
+  Version version;
+  bool transparent_region;
+  int width;
+  int height;
+  int max_queued_frames;
+  int num_idle;
+  std::string max_queued_layer_name;
+  std::string layer_name;
+  nsecs_t current_timestamp;
+  nsecs_t previous_timestamp;
+  nsecs_t vsync_timestamp;
+  nsecs_t refresh_timestamp;
+  nsecs_t ref_latency;
+  nsecs_t vsync_period;
+};
+
+
+/*! @brief This interface shall be implemented by frameextension library.
+
+  @details This class declares prototype for frameextension public interfaces which must be
+  implemented by frameextension library.
+*/
+class FrameExtnIntf {
+ public:
+  /*! @brief Set the FrameInfo used by frameextension.
+
+    @details This function is called once per refresh cycle so that required frame info are
+    feed to frameextension.
+
+    @param[in] frameInfo \link FrameInfo \endlink
+
+    @return \link int \endlink
+  */
+  virtual int SetFrameInfo(FrameInfo &frameInfo) = 0;
+
+ protected:
+  virtual ~FrameExtnIntf() { };
+};
+
+}  // namespace composer
+
+#endif  // __FRAME_EXTN_INTF_H__
diff --git a/display-commonsys-intf/include/frame_scheduler_intf.h b/display-commonsys-intf/include/frame_scheduler_intf.h
new file mode 100644
index 0000000..2d706e1
--- /dev/null
+++ b/display-commonsys-intf/include/frame_scheduler_intf.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __FRAME_SCHEDULER_INTF_H__
+#define __FRAME_SCHEDULER_INTF_H__
+
+#include <utils/Timers.h>
+
+namespace composer {
+
+class FrameSchedulerIntf {
+ public:
+  virtual int UpdateFrameScheduling(int fenceFd, nsecs_t *timeStamp) = 0;
+ protected:
+  virtual ~FrameSchedulerIntf() { }
+};
+
+}  // namespace composer
+
+#endif  // __FRAME_SCHEDULER_INTF_H__
diff --git a/display-commonsys-intf/include/layer_extn_intf.h b/display-commonsys-intf/include/layer_extn_intf.h
new file mode 100644
index 0000000..adf36bb
--- /dev/null
+++ b/display-commonsys-intf/include/layer_extn_intf.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __LAYER_EXTN_INTF_H__
+#define __LAYER_EXTN_INTF_H__
+
+#include <sys/types.h>
+
+#include <vector>
+#include <string>
+
+namespace composer {
+
+#define LAYER_EXTN_LIBRARY_NAME "liblayerext.qti.so"
+#define CREATE_LAYER_EXTN_INTERFACE "CreateLayerExtnInterface"
+#define DESTROY_LAYER_EXTN_INTERFACE "DestroyLayerExtnInterface"
+
+#define LAYER_EXTN_REVISION_MAJOR (1)
+#define LAYER_EXTN_REVISION_MINOR (0)
+#define LAYER_EXTN_VERSION_TAG ((uint16_t) ((LAYER_EXTN_REVISION_MAJOR << 8) \
+                                          | LAYER_EXTN_REVISION_MINOR))
+
+class LayerExtnIntf {
+ public:
+  virtual ~LayerExtnIntf() = default;
+  virtual int GetLayerClass(const std::string &name) = 0;
+  virtual void UpdateLayerState(const std::vector<std::string> &layers, int num_layers) = 0;
+};
+
+typedef bool (*CreateLayerExtnInterface)(uint16_t version, LayerExtnIntf **interface);
+typedef void (*DestroyLayerExtnInterface)(LayerExtnIntf *interface);
+
+}  // namespace composer
+
+#endif  // __LAYER_EXTN_INTF_H__
diff --git a/display-commonsys-intf/include/smomo_config.h b/display-commonsys-intf/include/smomo_config.h
new file mode 100644
index 0000000..ff409d6
--- /dev/null
+++ b/display-commonsys-intf/include/smomo_config.h
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2019, The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification, are permitted
+* provided that the following conditions are met:
+*    * Redistributions of source code must retain the above copyright notice, this list of
+*      conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above copyright notice, this list of
+*      conditions and the following disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation nor the names of its contributors may be used to
+*      endorse or promote products derived from this software without specific prior written
+*      permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*! @file smomo_config.h
+  @brief Interface file for the client of Smomo service, which provides tuning parameters of Smomo
+
+  @details Smomo clients use these interfaces to enable or disable Smomo, tune parameters to
+  optimize the display performance.
+*/
+
+#ifndef __SMOMO_CONFIG_H__
+#define __SMOMO_CONFIG_H__
+
+#include <cstdint>
+
+namespace smomoconfig {
+
+int EnableSmomo(bool enable);
+
+int GetSmomoMode(uint32_t *mode_idx);
+
+int SetSmomoMode(uint32_t mode_idx);
+
+}  // namespace smomoconfig
+
+#endif  // __SMOMO_CONFIG_H__
+
diff --git a/display-commonsys-intf/include/smomo_interface.h b/display-commonsys-intf/include/smomo_interface.h
new file mode 100644
index 0000000..c16111e
--- /dev/null
+++ b/display-commonsys-intf/include/smomo_interface.h
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2019, The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification, are permitted
+* provided that the following conditions are met:
+*    * Redistributions of source code must retain the above copyright notice, this list of
+*      conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above copyright notice, this list of
+*      conditions and the following disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation nor the names of its contributors may be used to
+*      endorse or promote products derived from this software without specific prior written
+*      permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*! @file smomo.h
+  @brief Interface file for SmoMo which defines the public interface exposed to SmoMo clients.
+
+  @details SmoMo clients use these interfaces to feed SmoMo required info like frame rate, refresh
+  rate, these info are used to update SmoMo internal state.
+*/
+
+#ifndef __SMOMO_INTERFACE_H__
+#define __SMOMO_INTERFACE_H__
+
+#include <sys/types.h>
+
+#include <vector>
+#include <string>
+
+namespace smomo {
+
+#define SMOMO_LIBRARY_NAME "libsmomo.qti.so"
+#define CREATE_SMOMO_INTERFACE_NAME "CreateSmomoInterface"
+#define DESTROY_SMOMO_INTERFACE_NAME "DestroySmomoInterface"
+
+#define SMOMO_REVISION_MAJOR (1)
+#define SMOMO_REVISION_MINOR (0)
+#define SMOMO_VERSION_TAG ((uint16_t) ((SMOMO_REVISION_MAJOR << 8) \
+                                          | SMOMO_REVISION_MINOR))
+
+typedef int64_t nsecs_t;
+
+/*! @brief This structure defines the layer stats required by SmoMo.
+
+  @sa SmomoIntf::updateSmomoState
+*/
+struct SmomoLayerStats {
+  std::string name;  // layer full name
+  int32_t id;  // layer ID
+};
+
+/*! @brief This structure defines the buffer stats required by SmoMo.
+
+  @sa SmomoIntf::CollectLayerStats
+  @sa SmomoIntf::ShouldPresentNow
+*/
+struct SmomoBufferStats {
+  int32_t id;  // layer ID
+  int32_t queued_frames;  // queued frame count of this layer
+  bool auto_timestamp;  // whether timestamp was generated automatically
+  nsecs_t timestamp;  // layer buffer's timestamp
+  nsecs_t dequeue_latency;  // last dequeue duration
+};
+
+/*! @brief SmoMo interface implemented by SmoMo library.
+
+  @details This class declares prototype for SmoMo public interfaces which must be
+  implemented by SmoMo library. SmoMo clients will use these methods to feed required
+  info to SmoMo implementation.
+*/
+class SmomoIntf {
+ public:
+  virtual ~SmomoIntf() = default;
+
+  /*! @brief Update SmoMo internal state.
+
+    @details This function is called once per each composition so that required layer info are feed
+    to SmoMo, the SmoMo uses these info to update its internal state.
+
+    @param[in] layers \link SmomoLayerStats \endlink
+    @param[in] refresh_rate current display refresh rate
+
+    @return \link void \endlink
+  */
+  virtual void UpdateSmomoState(const std::vector<SmomoLayerStats> &layers,
+      float refresh_rate) = 0;
+
+  /*! @brief Collect layer buffer stats.
+
+    @details This function is called once new buffer is ready for this layer. It's used to collect
+    layer's buffer stats for SmoMo.
+
+    @param[in] \link SmomoBufferStats \endlink
+
+    @return \link void \endlink
+  */
+  virtual void CollectLayerStats(const SmomoBufferStats &buffer_stats) = 0;
+
+  /*! @brief Is this layer buffer ready to present.
+
+    @details This function is called by SmoMo clients used to check whether this layer buffer is
+    due to present.
+
+    @param[in] \link SmomoBufferStats \endlink
+    @param[in] next_vsync_time When next VSYNC arrives
+
+    @return \link bool \endlink
+  */
+  virtual bool ShouldPresentNow(const SmomoBufferStats &buffer_stats,
+      const nsecs_t next_vsync_time) = 0;
+
+  /*! @brief Change refresh rate callback type definition.
+  */
+  using ChangeRefreshRateCallback = std::function<void(int32_t)>;
+
+  /*! @brief Set the callback used by SmoMo to change display refresh rate.
+
+    @details This function is called by SmoMo clients used to set the refresh rate callback.
+
+    @param[in] callback \link ChangeRefreshRateCallback \endlink
+
+    @return \link void \endlink
+  */
+  virtual void SetChangeRefreshRateCallback(
+      const ChangeRefreshRateCallback& callback) = 0;
+
+  /*! @brief Set the refersh rates supported by display.
+
+    @details This function is called to tell SmoMo what refresh rates this display can suport.
+
+    @param[in] refresh_rates The refresh rates supported by the display
+
+    @return \link void \endlink
+  */
+  virtual void SetDisplayRefreshRates(const std::vector<float> &refresh_rates) = 0;
+
+  /*! @brief Get the current frame rate from SmoMo.
+
+    @details This function is called by SmoMo client to query the current frame rate, which is
+    based on the internal state of SmoMo. Client needs to call the UpdateSmomoState API before
+    calling this function. SmoMo only returns a valid frame rate when it's settled to a state.
+
+    @return > 0 if valid, -1 if invalid.
+
+    @return \link int \endlink
+  */
+  virtual int GetFrameRate() = 0;
+};
+
+typedef bool (*CreateSmomoInterface)(uint16_t version, SmomoIntf **interface);
+typedef void (*DestroySmomoInterface)(SmomoIntf *interface);
+
+}  // namespace smomo
+
+#endif  // __SMOMO_INTERFACE_H__
diff --git a/display-commonsys-intf/libqdmetadata/Android.bp b/display-commonsys-intf/libqdmetadata/Android.bp
new file mode 100644
index 0000000..3cd036b
--- /dev/null
+++ b/display-commonsys-intf/libqdmetadata/Android.bp
@@ -0,0 +1,22 @@
+cc_library_shared {
+    name: "libqdMetaData",
+    vendor_available: true,
+    system_ext_specific: true,
+    cflags: [
+        "-Wno-sign-conversion",
+        "-DLOG_TAG=\"qdmetadata\"",
+        "-D__QTI_DISPLAY_GRALLOC__",
+    ],
+    shared_libs: [
+        "liblog",
+        "libcutils",
+        "libutils",
+        "libhidlbase",
+        "libgralloc.qti",
+        "libgralloctypes",
+    ],
+    header_libs: ["libhardware_headers", "display_intf_headers"],
+    srcs: ["qdMetaData.cpp", "qd_utils.cpp"],
+    export_header_lib_headers: ["display_intf_headers"],
+}
+
diff --git a/display-commonsys-intf/libqdmetadata/Makefile.am b/display-commonsys-intf/libqdmetadata/Makefile.am
new file mode 100644
index 0000000..24b1c4a
--- /dev/null
+++ b/display-commonsys-intf/libqdmetadata/Makefile.am
@@ -0,0 +1,14 @@
+h_sources = qdMetaData.h
+
+cpp_sources = qdMetaData.cpp
+
+qdMetaData_includedir = $(pkgincludedir)/display
+qdMetaData_include_HEADERS = $(h_sources)
+
+lib_LTLIBRARIES = libqdMetaData.la
+libqdMetaData_la_CC = @CC@
+libqdMetaData_la_SOURCES = $(cpp_sources)
+libqdMetaData_la_CFLAGS = $(AM_CFLAGS) -DLOG_TAG=\"DisplayMetaData\"
+libqdMetaData_la_CPPFLAGS = $(AM_CPPFLAGS)
+libqdMetaData_LDADD = -lcutils -llog
+libqdMetaData_la_LDFLAGS = -shared -avoid-version
diff --git a/display-commonsys-intf/libqdmetadata/qdMetaData.cpp b/display-commonsys-intf/libqdmetadata/qdMetaData.cpp
new file mode 100644
index 0000000..0fa24ca
--- /dev/null
+++ b/display-commonsys-intf/libqdmetadata/qdMetaData.cpp
@@ -0,0 +1,604 @@
+/*
+ * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "qdMetaData.h"
+
+#include <QtiGrallocPriv.h>
+#include <errno.h>
+#include <gralloc_priv.h>
+#include <gralloctypes/Gralloc4.h>
+#include <log/log.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#include <cinttypes>
+
+static int colorMetaDataToColorSpace(ColorMetaData in, ColorSpace_t *out) {
+  if (in.colorPrimaries == ColorPrimaries_BT601_6_525 ||
+      in.colorPrimaries == ColorPrimaries_BT601_6_625) {
+    if (in.range == Range_Full) {
+      *out = ITU_R_601_FR;
+    } else {
+      *out = ITU_R_601;
+    }
+  } else if (in.colorPrimaries == ColorPrimaries_BT2020) {
+    if (in.range == Range_Full) {
+      *out = ITU_R_2020_FR;
+    } else {
+      *out = ITU_R_2020;
+    }
+  } else if (in.colorPrimaries == ColorPrimaries_BT709_5) {
+    *out = ITU_R_709;
+  } else {
+    ALOGE(
+        "Cannot convert ColorMetaData to ColorSpace_t. "
+        "Primaries = %d, Range = %d",
+        in.colorPrimaries, in.range);
+    return -1;
+  }
+
+  return 0;
+}
+
+static int colorSpaceToColorMetadata(ColorSpace_t in, ColorMetaData *out) {
+  out->transfer = Transfer_sRGB;
+  switch (in) {
+    case ITU_R_601:
+      out->colorPrimaries = ColorPrimaries_BT601_6_525;
+      out->range = Range_Limited;
+      break;
+    case ITU_R_601_FR:
+      out->colorPrimaries = ColorPrimaries_BT601_6_525;
+      out->range = Range_Full;
+      break;
+    case ITU_R_709:
+      out->colorPrimaries = ColorPrimaries_BT709_5;
+      out->range = Range_Limited;
+      break;
+    case ITU_R_2020:
+      out->colorPrimaries = ColorPrimaries_BT2020;
+      out->range = Range_Limited;
+      break;
+    case ITU_R_2020_FR:
+      out->colorPrimaries = ColorPrimaries_BT2020;
+      out->range = Range_Full;
+      break;
+    default:
+      ALOGE("Cannot convert ColorSpace_t %d to ColorMetaData", in);
+      return -1;
+      break;
+  }
+
+  return 0;
+}
+
+static bool getGralloc4Array(MetaData_t *metadata, int32_t paramType) {
+  switch (paramType) {
+    case SET_VT_TIMESTAMP:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_VT_TIMESTAMP)];
+    case COLOR_METADATA:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_COLOR_METADATA)];
+    case PP_PARAM_INTERLACED:
+      return metadata
+          ->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_PP_PARAM_INTERLACED)];
+    case SET_VIDEO_PERF_MODE:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_VIDEO_PERF_MODE)];
+    case SET_GRAPHICS_METADATA:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_GRAPHICS_METADATA)];
+    case SET_UBWC_CR_STATS_INFO:
+      return metadata
+          ->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_UBWC_CR_STATS_INFO)];
+    case UPDATE_BUFFER_GEOMETRY:
+      return metadata->isStandardMetadataSet[GET_STANDARD_METADATA_STATUS_INDEX(
+          ::android::gralloc4::MetadataType_Crop.value)];
+    case UPDATE_REFRESH_RATE:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_REFRESH_RATE)];
+    case UPDATE_COLOR_SPACE:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_COLOR_METADATA)];
+    case MAP_SECURE_BUFFER:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_MAP_SECURE_BUFFER)];
+    case LINEAR_FORMAT:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_LINEAR_FORMAT)];
+    case SET_SINGLE_BUFFER_MODE:
+      return metadata
+          ->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_SINGLE_BUFFER_MODE)];
+    case SET_CVP_METADATA:
+      return metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_CVP_METADATA)];
+    case SET_VIDEO_HISTOGRAM_STATS:
+      return metadata
+          ->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_VIDEO_HISTOGRAM_STATS)];
+    default:
+      ALOGE("paramType %d not supported", paramType);
+      return false;
+  }
+}
+
+static void setGralloc4Array(MetaData_t *metadata, int32_t paramType, bool isSet) {
+  switch (paramType) {
+    case SET_VT_TIMESTAMP:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_VT_TIMESTAMP)] = isSet;
+      break;
+    case COLOR_METADATA:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_COLOR_METADATA)] = isSet;
+      break;
+    case PP_PARAM_INTERLACED:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_PP_PARAM_INTERLACED)] =
+          isSet;
+      break;
+    case SET_VIDEO_PERF_MODE:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_VIDEO_PERF_MODE)] = isSet;
+      break;
+    case SET_GRAPHICS_METADATA:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_GRAPHICS_METADATA)] =
+          isSet;
+      break;
+    case SET_UBWC_CR_STATS_INFO:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_UBWC_CR_STATS_INFO)] =
+          isSet;
+      break;
+    case UPDATE_BUFFER_GEOMETRY:
+      metadata->isStandardMetadataSet[GET_STANDARD_METADATA_STATUS_INDEX(
+          ::android::gralloc4::MetadataType_Crop.value)] = isSet;
+      break;
+    case UPDATE_REFRESH_RATE:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_REFRESH_RATE)] = isSet;
+      break;
+    case UPDATE_COLOR_SPACE:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_COLOR_METADATA)] = isSet;
+      break;
+    case MAP_SECURE_BUFFER:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_MAP_SECURE_BUFFER)] =
+          isSet;
+      break;
+    case LINEAR_FORMAT:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_LINEAR_FORMAT)] = isSet;
+      break;
+    case SET_SINGLE_BUFFER_MODE:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_SINGLE_BUFFER_MODE)] =
+          isSet;
+      break;
+    case SET_CVP_METADATA:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_CVP_METADATA)] = isSet;
+      break;
+    case SET_VIDEO_HISTOGRAM_STATS:
+      metadata->isVendorMetadataSet[GET_VENDOR_METADATA_STATUS_INDEX(QTI_VIDEO_HISTOGRAM_STATS)] =
+          isSet;
+      break;
+    default:
+      ALOGE("paramType %d not supported in Gralloc4", paramType);
+  }
+}
+
+unsigned long getMetaDataSize() {
+    return static_cast<unsigned long>(ROUND_UP_PAGESIZE(sizeof(MetaData_t)));
+}
+
+// Cannot add default argument to existing function
+unsigned long getMetaDataSizeWithReservedRegion(uint64_t reserved_size) {
+  return static_cast<unsigned long>(ROUND_UP_PAGESIZE(sizeof(MetaData_t) + reserved_size));
+}
+
+static int validateAndMap(private_handle_t* handle) {
+    if (private_handle_t::validate(handle)) {
+        ALOGE("%s: Private handle is invalid - handle:%p", __func__, handle);
+        return -1;
+    }
+    if (handle->fd_metadata < 0) {
+      // Metadata cannot be used
+      return -1;
+    }
+
+    if (!handle->base_metadata) {
+        auto size = getMetaDataSize();
+        void *base = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED,
+                handle->fd_metadata, 0);
+        if (base == reinterpret_cast<void*>(MAP_FAILED)) {
+            ALOGE("%s: metadata mmap failed - handle:%p fd: %d err: %s",
+                __func__, handle, handle->fd_metadata, strerror(errno));
+            return -1;
+        }
+        handle->base_metadata = (uintptr_t) base;
+        auto metadata = reinterpret_cast<MetaData_t *>(handle->base_metadata);
+        if (metadata->reservedSize) {
+          auto reserved_size = metadata->reservedSize;
+          munmap(reinterpret_cast<void *>(handle->base_metadata), getMetaDataSize());
+          handle->base_metadata = 0;
+          size = getMetaDataSizeWithReservedRegion(reserved_size);
+          void *new_base =
+              mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, handle->fd_metadata, 0);
+          if (new_base == reinterpret_cast<void *>(MAP_FAILED)) {
+            ALOGE("%s: metadata mmap failed - handle:%p fd: %d err: %s", __func__, handle,
+                  handle->fd_metadata, strerror(errno));
+            return -1;
+          }
+          handle->base_metadata = (uintptr_t)new_base;
+        }
+    }
+    return 0;
+}
+
+static void unmapAndReset(private_handle_t *handle) {
+    if (private_handle_t::validate(handle) == 0 && handle->base_metadata) {
+      // If reservedSize is 0, the return value will be the same as getMetaDataSize
+      auto metadata = reinterpret_cast<MetaData_t *>(handle->base_metadata);
+      auto size = getMetaDataSizeWithReservedRegion(metadata->reservedSize);
+      munmap(reinterpret_cast<void *>(handle->base_metadata), size);
+      handle->base_metadata = 0;
+    }
+}
+
+int setMetaData(private_handle_t *handle, DispParamType paramType,
+                void *param) {
+    auto err = validateAndMap(handle);
+    if (err != 0)
+        return err;
+    return setMetaDataVa(reinterpret_cast<MetaData_t*>(handle->base_metadata),
+                         paramType, param);
+}
+
+int setMetaDataVa(MetaData_t *data, DispParamType paramType,
+                  void *param) {
+    if (data == nullptr)
+        return -EINVAL;
+    // If parameter is NULL reset the specific MetaData Key
+    if (!param) {
+      setGralloc4Array(data, paramType, false);
+      switch (paramType) {
+        case SET_VIDEO_PERF_MODE:
+          data->isVideoPerfMode = 0;
+          break;
+        case SET_CVP_METADATA:
+          data->cvpMetadata.size = 0;
+          break;
+        case SET_VIDEO_HISTOGRAM_STATS:
+          data->video_histogram_stats.stat_len = 0;
+          break;
+        default:
+          ALOGE("Unknown paramType %d", paramType);
+          break;
+      }
+       // param unset
+       return 0;
+    }
+
+    setGralloc4Array(data, paramType, true);
+    switch (paramType) {
+        case PP_PARAM_INTERLACED:
+            data->interlaced = *((int32_t *)param);
+            break;
+        case UPDATE_BUFFER_GEOMETRY: {
+          BufferDim_t in = *((BufferDim_t *)param);
+          data->crop = {0, 0, in.sliceWidth, in.sliceHeight};
+          break;
+        }
+        case UPDATE_REFRESH_RATE:
+            data->refreshrate = *((float *)param);
+            break;
+        case UPDATE_COLOR_SPACE: {
+          ColorMetaData color = {};
+          if (!colorSpaceToColorMetadata(*((ColorSpace_t *)param), &color)) {
+            data->color = color;
+            break;
+          }
+          return -EINVAL;
+        }
+        case MAP_SECURE_BUFFER:
+            data->mapSecureBuffer = *((int32_t *)param);
+            break;
+        case S3D_FORMAT:
+            data->s3dFormat = *((uint32_t *)param);
+            break;
+        case LINEAR_FORMAT:
+            data->linearFormat = *((uint32_t *)param);
+            break;
+        case SET_SINGLE_BUFFER_MODE:
+            data->isSingleBufferMode = *((uint32_t *)param);
+            break;
+        case SET_VT_TIMESTAMP:
+            data->vtTimeStamp = *((uint64_t *)param);
+            break;
+        case COLOR_METADATA:
+            data->color = *((ColorMetaData *)param);
+            break;
+        case SET_UBWC_CR_STATS_INFO: {
+          struct UBWCStats *stats = (struct UBWCStats *)param;
+          int numelems = sizeof(data->ubwcCRStats) / sizeof(struct UBWCStats);
+          for (int i = 0; i < numelems; i++) {
+            data->ubwcCRStats[i] = stats[i];
+          }
+          break;
+          }
+        case SET_VIDEO_PERF_MODE:
+            data->isVideoPerfMode = *((uint32_t *)param);
+            break;
+        case SET_GRAPHICS_METADATA: {
+             GraphicsMetadata payload = *((GraphicsMetadata*)(param));
+             data->graphics_metadata.size = payload.size;
+             memcpy(data->graphics_metadata.data, payload.data,
+                    sizeof(data->graphics_metadata.data));
+             break;
+        }
+        case SET_CVP_METADATA: {
+             struct CVPMetadata *cvpMetadata = (struct CVPMetadata *)param;
+             if (cvpMetadata->size <= CVP_METADATA_SIZE) {
+                 data->cvpMetadata.size = cvpMetadata->size;
+                 memcpy(data->cvpMetadata.payload, cvpMetadata->payload,
+                        cvpMetadata->size);
+                 data->cvpMetadata.capture_frame_rate = cvpMetadata->capture_frame_rate;
+                 data->cvpMetadata.cvp_frame_rate = cvpMetadata->cvp_frame_rate;
+                 data->cvpMetadata.flags = cvpMetadata->flags;
+                 memcpy(data->cvpMetadata.reserved, cvpMetadata->reserved,
+                        (8 * sizeof(uint32_t)));
+             } else {
+               setGralloc4Array(data, paramType, false);
+               ALOGE("%s: cvp metadata length %d is more than max size %d", __func__,
+                     cvpMetadata->size, CVP_METADATA_SIZE);
+               return -EINVAL;
+             }
+             break;
+        }
+        case SET_VIDEO_HISTOGRAM_STATS: {
+            struct VideoHistogramMetadata *vidstats = (struct VideoHistogramMetadata *)param;
+            if (vidstats->stat_len <= VIDEO_HISTOGRAM_STATS_SIZE) {
+                memcpy(data->video_histogram_stats.stats_info,
+                    vidstats->stats_info, VIDEO_HISTOGRAM_STATS_SIZE);
+                data->video_histogram_stats.stat_len = vidstats->stat_len;
+                data->video_histogram_stats.frame_type = vidstats->frame_type;
+                data->video_histogram_stats.display_width = vidstats->display_width;
+                data->video_histogram_stats.display_height = vidstats->display_height;
+                data->video_histogram_stats.decode_width = vidstats->decode_width;
+                data->video_histogram_stats.decode_height = vidstats->decode_height;
+            } else {
+              setGralloc4Array(data, paramType, false);
+              ALOGE("%s: video stats length %u is more than max size %u", __func__,
+                    vidstats->stat_len, VIDEO_HISTOGRAM_STATS_SIZE);
+              return -EINVAL;
+            }
+            break;
+         }
+         default:
+            ALOGE("Unknown paramType %d", paramType);
+            break;
+    }
+    return 0;
+}
+
+int clearMetaData(private_handle_t *handle, DispParamType paramType) {
+    auto err = validateAndMap(handle);
+    if (err != 0)
+        return err;
+    return clearMetaDataVa(reinterpret_cast<MetaData_t *>(handle->base_metadata),
+            paramType);
+}
+
+int clearMetaDataVa(MetaData_t *data, DispParamType paramType) {
+    if (data == nullptr)
+        return -EINVAL;
+    data->operation &= ~paramType;
+    switch (paramType) {
+        case SET_VIDEO_PERF_MODE:
+            data->isVideoPerfMode = 0;
+            break;
+        case SET_CVP_METADATA:
+            data->cvpMetadata.size = 0;
+            break;
+        case SET_VIDEO_HISTOGRAM_STATS:
+            data->video_histogram_stats.stat_len = 0;
+            break;
+        default:
+            ALOGE("Unknown paramType %d", paramType);
+            break;
+    }
+    return 0;
+}
+
+int getMetaData(private_handle_t *handle, DispFetchParamType paramType,
+                                                    void *param) {
+    int ret = validateAndMap(handle);
+    if (ret != 0)
+        return ret;
+    return getMetaDataVa(reinterpret_cast<MetaData_t *>(handle->base_metadata),
+                         paramType, param);
+}
+
+int getMetaDataVa(MetaData_t *data, DispFetchParamType paramType,
+                  void *param) {
+    // Make sure we send 0 only if the operation queried is present
+    int ret = -EINVAL;
+    if (data == nullptr)
+        return ret;
+    if (param == nullptr)
+        return ret;
+
+    if (!getGralloc4Array(data, paramType)) {
+      return ret;
+    }
+
+    ret = 0;
+
+    switch (paramType) {
+        case GET_PP_PARAM_INTERLACED:
+          *((int32_t *)param) = data->interlaced;
+          break;
+        case GET_BUFFER_GEOMETRY:
+          *((BufferDim_t *)param) = {data->crop.right, data->crop.bottom};
+          break;
+        case GET_REFRESH_RATE:
+          *((float *)param) = data->refreshrate;
+          break;
+        case GET_COLOR_SPACE: {
+          ColorSpace_t color_space;
+          if (!colorMetaDataToColorSpace(data->color, &color_space)) {
+            *((ColorSpace_t *)param) = color_space;
+          } else {
+            ret = -EINVAL;
+          }
+          break;
+        }
+        case GET_MAP_SECURE_BUFFER:
+          *((int32_t *)param) = data->mapSecureBuffer;
+          break;
+        case GET_S3D_FORMAT:
+          *((uint32_t *)param) = data->s3dFormat;
+          break;
+        case GET_LINEAR_FORMAT:
+          *((uint32_t *)param) = data->linearFormat;
+          break;
+        case GET_SINGLE_BUFFER_MODE:
+          *((uint32_t *)param) = data->isSingleBufferMode;
+          break;
+        case GET_VT_TIMESTAMP:
+          *((uint64_t *)param) = data->vtTimeStamp;
+          break;
+        case GET_COLOR_METADATA:
+          *((ColorMetaData *)param) = data->color;
+          break;
+        case GET_UBWC_CR_STATS_INFO: {
+          struct UBWCStats *stats = (struct UBWCStats *)param;
+          int numelems = sizeof(data->ubwcCRStats) / sizeof(struct UBWCStats);
+          for (int i = 0; i < numelems; i++) {
+            stats[i] = data->ubwcCRStats[i];
+          }
+          break;
+        }
+        case GET_VIDEO_PERF_MODE:
+          *((uint32_t *)param) = data->isVideoPerfMode;
+          break;
+        case GET_GRAPHICS_METADATA:
+          memcpy(param, data->graphics_metadata.data, sizeof(data->graphics_metadata.data));
+          break;
+        case GET_CVP_METADATA: {
+          struct CVPMetadata *cvpMetadata = (struct CVPMetadata *)param;
+          cvpMetadata->size = 0;
+          if (data->cvpMetadata.size <= CVP_METADATA_SIZE) {
+            cvpMetadata->size = data->cvpMetadata.size;
+            memcpy(cvpMetadata->payload, data->cvpMetadata.payload, data->cvpMetadata.size);
+            cvpMetadata->capture_frame_rate = data->cvpMetadata.capture_frame_rate;
+            cvpMetadata->cvp_frame_rate = data->cvpMetadata.cvp_frame_rate;
+            cvpMetadata->flags = data->cvpMetadata.flags;
+            memcpy(cvpMetadata->reserved, data->cvpMetadata.reserved, (8 * sizeof(uint32_t)));
+          } else {
+            ret = -EINVAL;
+          }
+          break;
+        }
+        case GET_VIDEO_HISTOGRAM_STATS: {
+          struct VideoHistogramMetadata *vidstats = (struct VideoHistogramMetadata *)param;
+          vidstats->stat_len = 0;
+          if (data->video_histogram_stats.stat_len <= VIDEO_HISTOGRAM_STATS_SIZE) {
+            memcpy(vidstats->stats_info, data->video_histogram_stats.stats_info,
+                   VIDEO_HISTOGRAM_STATS_SIZE);
+            vidstats->stat_len = data->video_histogram_stats.stat_len;
+            vidstats->frame_type = data->video_histogram_stats.frame_type;
+            vidstats->display_width = data->video_histogram_stats.display_width;
+            vidstats->display_height = data->video_histogram_stats.display_height;
+            vidstats->decode_width = data->video_histogram_stats.decode_width;
+            vidstats->decode_height = data->video_histogram_stats.decode_height;
+          } else {
+            ret = -EINVAL;
+          }
+          break;
+        }
+        default:
+            ALOGE("Unknown paramType %d", paramType);
+            ret = -EINVAL;
+            break;
+    }
+    return ret;
+}
+
+int copyMetaData(struct private_handle_t *src, struct private_handle_t *dst) {
+    auto err = validateAndMap(src);
+    if (err != 0)
+        return err;
+
+    err = validateAndMap(dst);
+    if (err != 0)
+        return err;
+
+    MetaData_t *src_data = reinterpret_cast <MetaData_t *>(src->base_metadata);
+    MetaData_t *dst_data = reinterpret_cast <MetaData_t *>(dst->base_metadata);
+    *dst_data = *src_data;
+    return 0;
+}
+
+int copyMetaDataVaToHandle(MetaData_t *src_data, struct private_handle_t *dst) {
+    int err = -EINVAL;
+    if (src_data == nullptr)
+        return err;
+
+    err = validateAndMap(dst);
+    if (err != 0)
+        return err;
+
+    MetaData_t *dst_data = reinterpret_cast <MetaData_t *>(dst->base_metadata);
+    *dst_data = *src_data;
+    return 0;
+}
+
+int copyMetaDataHandleToVa(struct private_handle_t *src, MetaData_t *dst_data) {
+    int err = -EINVAL;
+    if (dst_data == nullptr)
+        return err;
+
+    err = validateAndMap(src);
+    if (err != 0)
+        return err;
+
+    MetaData_t *src_data = reinterpret_cast <MetaData_t *>(src->base_metadata);
+    *dst_data = *src_data;
+    return 0;
+}
+
+int copyMetaDataVaToVa(MetaData_t *src_data, MetaData_t *dst_data) {
+    int err = -EINVAL;
+    if (src_data == nullptr)
+        return err;
+
+    if (dst_data == nullptr)
+        return err;
+
+    *dst_data = *src_data;
+    return 0;
+}
+
+int setMetaDataAndUnmap(struct private_handle_t *handle, enum DispParamType paramType,
+                        void *param) {
+    auto ret = setMetaData(handle, paramType, param);
+    unmapAndReset(handle);
+    return ret;
+}
+
+int getMetaDataAndUnmap(struct private_handle_t *handle,
+                        enum DispFetchParamType paramType,
+                        void *param) {
+    auto ret = getMetaData(handle, paramType, param);
+    unmapAndReset(handle);
+    return ret;
+}
diff --git a/display-commonsys-intf/libqdmetadata/qdMetaData.h b/display-commonsys-intf/libqdmetadata/qdMetaData.h
new file mode 100644
index 0000000..a36d6e7
--- /dev/null
+++ b/display-commonsys-intf/libqdmetadata/qdMetaData.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _QDMETADATA_H
+#define _QDMETADATA_H
+
+#include <QtiGrallocMetadata.h>
+#include <color_metadata.h>
+
+/* TODO: This conditional include is to prevent breaking video and camera test cases using
+ * MetaData_t - camxchinodedewarp.cpp, vtest_EncoderFileSource.cpp
+ */
+
+#ifdef __cplusplus
+#include <QtiGrallocPriv.h>
+#endif
+
+#ifndef __QTI_DISPLAY_GRALLOC__
+#pragma message "qdMetaData.h is being deprecated"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct MetaData_t;
+
+enum ColorSpace_t {
+  ITU_R_601,
+  ITU_R_601_FR,
+  ITU_R_709,
+  ITU_R_2020,
+  ITU_R_2020_FR,
+};
+
+struct BufferDim_t {
+  int32_t sliceWidth;
+  int32_t sliceHeight;
+};
+
+enum DispParamType {
+    SET_VT_TIMESTAMP           = 0x0001,
+    COLOR_METADATA             = 0x0002,
+    PP_PARAM_INTERLACED        = 0x0004,
+    SET_VIDEO_PERF_MODE        = 0x0008,
+    SET_GRAPHICS_METADATA      = 0x0010,
+    SET_UNUSED                 = 0x0020,
+    SET_UBWC_CR_STATS_INFO     = 0x0040,
+    UPDATE_BUFFER_GEOMETRY     = 0x0080,
+    UPDATE_REFRESH_RATE        = 0x0100,
+    UPDATE_COLOR_SPACE         = 0x0200,
+    MAP_SECURE_BUFFER          = 0x0400,
+    S3D_FORMAT                 = 0x0800,
+    LINEAR_FORMAT              = 0x1000,
+    SET_IGC                    = 0x2000,
+    SET_SINGLE_BUFFER_MODE     = 0x4000,
+    SET_S3D_COMP               = 0x8000,
+    SET_CVP_METADATA           = 0x00010000,
+    SET_VIDEO_HISTOGRAM_STATS  = 0x00020000
+};
+
+enum DispFetchParamType {
+    GET_VT_TIMESTAMP          = 0x0001,
+    GET_COLOR_METADATA        = 0x0002,
+    GET_PP_PARAM_INTERLACED   = 0x0004,
+    GET_VIDEO_PERF_MODE       = 0x0008,
+    GET_GRAPHICS_METADATA     = 0x0010,
+    GET_UNUSED                = 0X0020,
+    GET_UBWC_CR_STATS_INFO    = 0x0040,
+    GET_BUFFER_GEOMETRY       = 0x0080,
+    GET_REFRESH_RATE          = 0x0100,
+    GET_COLOR_SPACE           = 0x0200,
+    GET_MAP_SECURE_BUFFER     = 0x0400,
+    GET_S3D_FORMAT            = 0x0800,
+    GET_LINEAR_FORMAT         = 0x1000,
+    GET_IGC                   = 0x2000,
+    GET_SINGLE_BUFFER_MODE    = 0x4000,
+    GET_S3D_COMP              = 0x8000,
+    GET_CVP_METADATA          = 0x00010000,
+    GET_VIDEO_HISTOGRAM_STATS = 0x00020000
+};
+
+/* Frame type bit mask */
+#define QD_SYNC_FRAME (0x1 << 0)
+
+struct private_handle_t;
+int setMetaData(struct private_handle_t *handle, enum DispParamType paramType,
+                void *param);
+int setMetaDataVa(struct MetaData_t* data, enum DispParamType paramType,
+                  void *param);
+
+int getMetaData(struct private_handle_t *handle,
+                enum DispFetchParamType paramType,
+                void *param);
+int getMetaDataVa(struct MetaData_t* data, enum DispFetchParamType paramType,
+                  void *param);
+
+int copyMetaData(struct private_handle_t *src, struct private_handle_t *dst);
+int copyMetaDataVaToHandle(struct MetaData_t *src, struct private_handle_t *dst);
+int copyMetaDataHandleToVa(struct private_handle_t* src, struct MetaData_t *dst);
+int copyMetaDataVaToVa(struct MetaData_t *src, struct MetaData_t *dst);
+
+int clearMetaData(struct private_handle_t *handle, enum DispParamType paramType);
+int clearMetaDataVa(struct MetaData_t *data, enum DispParamType paramType);
+
+unsigned long getMetaDataSize();
+
+// Map, access metadata and unmap. Used by clients that do not import/free but
+//  clone and delete native_handle
+int setMetaDataAndUnmap(struct private_handle_t *handle, enum DispParamType paramType,
+                        void *param);
+int getMetaDataAndUnmap(struct private_handle_t *handle,
+                        enum DispFetchParamType paramType,
+                        void *param);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _QDMETADATA_H */
+
diff --git a/display-commonsys-intf/libqdmetadata/qd_utils.cpp b/display-commonsys-intf/libqdmetadata/qd_utils.cpp
new file mode 100644
index 0000000..ac5d094
--- /dev/null
+++ b/display-commonsys-intf/libqdmetadata/qd_utils.cpp
@@ -0,0 +1,279 @@
+/*
+ * Copyright (c) 2013, 2018, 2020 The Linux Foundation. All rights reserved.
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+#include <gralloc_priv.h>
+#include "qd_utils.h"
+
+static const int kFBNodeMax = 4;
+namespace qdutils {
+
+static int parseLine(char *input, char *tokens[], const uint32_t maxToken, uint32_t *count) {
+    char *tmpToken = NULL;
+    char *tmpPtr;
+    uint32_t index = 0;
+    const char *delim = ", =\n";
+    if (!input) {
+      return -1;
+    }
+    tmpToken = strtok_r(input, delim, &tmpPtr);
+    while (tmpToken && index < maxToken) {
+      tokens[index++] = tmpToken;
+      tmpToken = strtok_r(NULL, delim, &tmpPtr);
+    }
+    *count = index;
+
+    return 0;
+}
+
+static int getExternalNode(const char *type) {
+    FILE *displayDeviceFP = NULL;
+    char fbType[MAX_FRAME_BUFFER_NAME_SIZE];
+    char msmFbTypePath[MAX_FRAME_BUFFER_NAME_SIZE];
+    int j = 0;
+
+    for(j = 0; j < kFBNodeMax; j++) {
+        snprintf (msmFbTypePath, sizeof(msmFbTypePath),
+                  "/sys/devices/virtual/graphics/fb%d/msm_fb_type", j);
+        displayDeviceFP = fopen(msmFbTypePath, "r");
+        if(displayDeviceFP) {
+            fread(fbType, sizeof(char), MAX_FRAME_BUFFER_NAME_SIZE,
+                    displayDeviceFP);
+            if(strncmp(fbType, type, strlen(type)) == 0) {
+                ALOGD("%s: %s is at fb%d", __func__, type, j);
+                fclose(displayDeviceFP);
+                break;
+            }
+            fclose(displayDeviceFP);
+        } else {
+            ALOGE("%s: Failed to open fb node %s", __func__, msmFbTypePath);
+        }
+    }
+
+    if (j < kFBNodeMax)
+        return j;
+    else
+        ALOGE("%s: Failed to find %s node", __func__, type);
+
+    return -1;
+}
+
+int getHDMINode(void) {
+    return getExternalNode("dtv panel");
+}
+
+int getEdidRawData(char *buffer)
+{
+    int size;
+    int edidFile;
+    char msmFbTypePath[MAX_FRAME_BUFFER_NAME_SIZE];
+    int node_id = getHDMINode();
+
+    if (node_id < 0) {
+        ALOGE("%s no HDMI node found", __func__);
+        return 0;
+    }
+
+    snprintf(msmFbTypePath, sizeof(msmFbTypePath),
+                 "/sys/devices/virtual/graphics/fb%d/edid_raw_data", node_id);
+
+    edidFile = open(msmFbTypePath, O_RDONLY, 0);
+
+    if (edidFile < 0) {
+        ALOGE("%s no edid raw data found %s", __func__,msmFbTypePath);
+        return 0;
+    }
+
+    size = (int)read(edidFile, (char*)buffer, EDID_RAW_DATA_SIZE);
+    close(edidFile);
+    return size;
+}
+
+bool isDPConnected() {
+    char connectPath[MAX_FRAME_BUFFER_NAME_SIZE];
+    FILE *connectFile = NULL;
+    size_t len = MAX_STRING_LENGTH;
+    char stringBuffer[MAX_STRING_LENGTH];
+    char *line = stringBuffer;
+
+    int nodeId = getExternalNode("dp panel");
+    if (nodeId < 0) {
+        ALOGE("%s no DP node found", __func__);
+        return false;
+    }
+
+    snprintf(connectPath, sizeof(connectPath),
+             "/sys/devices/virtual/graphics/fb%d/connected", nodeId);
+
+    connectFile = fopen(connectPath, "rb");
+    if (!connectFile) {
+        ALOGW("Failed to open connect node for device node %s", connectPath);
+        return false;
+    }
+
+    if (getline(&line, &len, connectFile) < 0) {
+        fclose(connectFile);
+        return false;
+    }
+
+    fclose(connectFile);
+
+    return atoi(line);
+}
+
+int getDPTestConfig(uint32_t *panelBpp, uint32_t *patternType) {
+    if (!panelBpp || !patternType) {
+        return -1;
+    }
+
+    char configPath[MAX_FRAME_BUFFER_NAME_SIZE];
+    FILE *configFile = NULL;
+    uint32_t tokenCount = 0;
+    const uint32_t maxCount = 10;
+    char *tokens[maxCount] = { NULL };
+    size_t len = MAX_STRING_LENGTH;
+    char stringBuffer[MAX_STRING_LENGTH];
+    char *line = stringBuffer;
+
+    int nodeId = getExternalNode("dp panel");
+    if (nodeId < 0) {
+        ALOGE("%s no DP node found", __func__);
+        return -EINVAL;
+    }
+
+    snprintf(configPath, sizeof(configPath),
+             "/sys/devices/virtual/graphics/fb%d/config", nodeId);
+
+    configFile = fopen(configPath, "rb");
+    if (!configFile) {
+        ALOGW("Failed to open config node for device node %s", configPath);
+        return -EINVAL;
+    }
+
+    while (getline(&line, &len, configFile) != -1) {
+        if (!parseLine(line, tokens, maxCount, &tokenCount)) {
+            if (tokens[0] != NULL) {
+              if (!strncmp(tokens[0], "bpp", strlen("bpp"))) {
+                *panelBpp = static_cast<uint32_t>(atoi(tokens[1]));
+              } else  if (!strncmp(tokens[0], "pattern", strlen("pattern"))) {
+                *patternType = static_cast<uint32_t>(atoi(tokens[1]));
+              }
+            }
+        }
+    }
+
+    fclose(configFile);
+
+    return 0;
+}
+
+DriverType getDriverType() {
+    const char *fb_caps = "/sys/devices/virtual/graphics/fb0/mdp/caps";
+    // 0 - File exists
+    return access(fb_caps, F_OK) ? DriverType::DRM : DriverType::FB;
+}
+
+const char *GetHALPixelFormatString(int format) {
+  switch (format) {
+  case HAL_PIXEL_FORMAT_RGBA_8888:
+    return "RGBA_8888";
+  case HAL_PIXEL_FORMAT_RGBX_8888:
+    return "RGBX_8888";
+  case HAL_PIXEL_FORMAT_RGB_888:
+    return "RGB_888";
+  case HAL_PIXEL_FORMAT_RGB_565:
+    return "RGB_565";
+  case HAL_PIXEL_FORMAT_BGR_565:
+    return "BGR_565";
+  case HAL_PIXEL_FORMAT_BGRA_8888:
+    return "BGRA_8888";
+  case HAL_PIXEL_FORMAT_RGBA_5551:
+    return "RGBA_5551";
+  case HAL_PIXEL_FORMAT_RGBA_4444:
+    return "RGBA_4444";
+  case HAL_PIXEL_FORMAT_YV12:
+    return "YV12";
+  case HAL_PIXEL_FORMAT_YCbCr_422_SP:
+    return "YCbCr_422_SP_NV16";
+  case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+    return "YCrCb_420_SP_NV21";
+  case HAL_PIXEL_FORMAT_YCbCr_422_I:
+    return "YCbCr_422_I_YUY2";
+  case HAL_PIXEL_FORMAT_YCrCb_422_I:
+    return "YCrCb_422_I_YVYU";
+  case HAL_PIXEL_FORMAT_NV12_ENCODEABLE:
+    return "NV12_ENCODEABLE";
+  case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
+    return "YCbCr_420_SP_TILED_TILE_4x2";
+  case HAL_PIXEL_FORMAT_YCbCr_420_SP:
+    return "YCbCr_420_SP";
+  case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO:
+    return "YCrCb_420_SP_ADRENO";
+  case HAL_PIXEL_FORMAT_YCrCb_422_SP:
+    return "YCrCb_422_SP";
+  case HAL_PIXEL_FORMAT_R_8:
+    return "R_8";
+  case HAL_PIXEL_FORMAT_RG_88:
+    return "RG_88";
+  case HAL_PIXEL_FORMAT_INTERLACE:
+    return "INTERLACE";
+  case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
+    return "YCbCr_420_SP_VENUS";
+  case HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS:
+    return "YCrCb_420_SP_VENUS";
+  case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC:
+    return "YCbCr_420_SP_VENUS_UBWC";
+  case HAL_PIXEL_FORMAT_RGBA_1010102:
+    return "RGBA_1010102";
+  case HAL_PIXEL_FORMAT_ARGB_2101010:
+    return "ARGB_2101010";
+  case HAL_PIXEL_FORMAT_RGBX_1010102:
+    return "RGBX_1010102";
+  case HAL_PIXEL_FORMAT_XRGB_2101010:
+    return "XRGB_2101010";
+  case HAL_PIXEL_FORMAT_BGRA_1010102:
+    return "BGRA_1010102";
+  case HAL_PIXEL_FORMAT_ABGR_2101010:
+    return "ABGR_2101010";
+  case HAL_PIXEL_FORMAT_BGRX_1010102:
+    return "BGRX_1010102";
+  case HAL_PIXEL_FORMAT_XBGR_2101010:
+    return "XBGR_2101010";
+  case HAL_PIXEL_FORMAT_YCbCr_420_P010:
+    return "YCbCr_420_P010";
+  case HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC:
+    return "YCbCr_420_TP10_UBWC";
+  case HAL_PIXEL_FORMAT_YCbCr_420_P010_VENUS:
+    return "YCbCr_420_P010_VENUS";
+  default:
+    return "Unknown_format";
+  }
+}
+
+}; //namespace qdutils
diff --git a/display-commonsys-intf/libqdmetadata/qd_utils.h b/display-commonsys-intf/libqdmetadata/qd_utils.h
new file mode 100644
index 0000000..0b0816a
--- /dev/null
+++ b/display-commonsys-intf/libqdmetadata/qd_utils.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2013, 2017, 2020 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of The Linux Foundation or the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _QD_UTIL_MISC_H
+#define _QD_UTIL_MISC_H
+
+#include <utils/threads.h>
+#include <linux/fb.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <utils/Errors.h>
+#include <log/log.h>
+
+#include <linux/fb.h>
+#include <sys/ioctl.h>
+#include <sys/poll.h>
+#include <sys/resource.h>
+#include <cutils/properties.h>
+#include <hardware/hwcomposer.h>
+
+namespace qdutils {
+
+enum HWQueryType {
+    HAS_UBWC = 1,
+    HAS_WB_UBWC = 2
+};
+
+enum {
+    EDID_RAW_DATA_SIZE = 640,
+    MAX_FRAME_BUFFER_NAME_SIZE = 128,
+    MAX_SYSFS_FILE_PATH = 255,
+    MAX_STRING_LENGTH = 1024,
+};
+
+int getEdidRawData(char *buffer);
+int getHDMINode(void);
+bool isDPConnected();
+int getDPTestConfig(uint32_t *panelBpp, uint32_t *patternType);
+
+enum class DriverType {
+    FB = 0,
+    DRM,
+};
+DriverType getDriverType();
+const char *GetHALPixelFormatString(int format);
+
+}; //namespace qdutils
+#endif
diff --git a/display-commonsys-intf/services/config/client_interface.h b/display-commonsys-intf/services/config/client_interface.h
new file mode 100644
index 0000000..faf772a
--- /dev/null
+++ b/display-commonsys-intf/services/config/client_interface.h
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __CLIENT_INTERFACE_H__
+#define __CLIENT_INTERFACE_H__
+
+#include "config_defs.h"
+
+namespace DisplayConfig {
+
+class ClientInterface : public ConfigInterface  {
+ public:
+  static int Create(std::string client_name, ConfigCallback *callback,
+                    ClientInterface **intf);
+  static void Destroy(ClientInterface *intf);
+
+ protected:
+  virtual ~ClientInterface() { }
+};
+
+}  // namespace DisplayConfig
+
+#endif  // __CLIENT_INTERFACE_H__
diff --git a/display-commonsys-intf/services/config/config_defs.h b/display-commonsys-intf/services/config/config_defs.h
new file mode 100644
index 0000000..0009ac8
--- /dev/null
+++ b/display-commonsys-intf/services/config/config_defs.h
@@ -0,0 +1,312 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __CONFIG_DEFS_H__
+#define __CONFIG_DEFS_H__
+
+#include <vector>
+#include <string>
+
+// #defines specifying the API level supported
+// Client can use these API level #ifdefs in their implementation to call the
+// corresponding DisplayConfig API independent of the underlying DisplayConfig
+// implementation being present. When this ifdef gets enabled in this header, the
+// client code will automatically get compiled.
+#define DISPLAY_CONFIG_API_LEVEL_0
+
+namespace DisplayConfig {
+
+// enum definitions
+enum class DisplayType : int {
+  kInvalid,
+  kPrimary,
+  kExternal,
+  kVirtual,
+  kBuiltIn2,
+};
+
+enum class ExternalStatus : int {
+  kInvalid,
+  kOffline,
+  kOnline,
+  kPause,
+  kResume,
+};
+
+enum class DynRefreshRateOp : int {
+  kInvalid,
+  kDisableMetadata,
+  kEnableMetadata,
+  kSetBinder,
+};
+
+enum class DisplayPortType : int {
+  kInvalid,
+  kDefault,
+  kDsi,
+  kDtv,
+  kWriteback,
+  kLvds,
+  kEdp,
+  kDp,
+};
+
+enum class PowerMode : int {
+  kOff,
+  kDoze,
+  kOn,
+  kDozeSuspend,
+};
+
+enum class QsyncMode : int {
+  kNone,
+  kWaitForFencesOneFrame,
+  kWaitForFencesEachFrame,
+  kWaitForCommitEachFrame,
+};
+
+enum class TUIEventType : int {
+  kNone,
+  kPrepareTUITransition,
+  kStartTUITransition,
+  kEndTUITransition,
+};
+
+// Input and Output Params structures
+struct Attributes {
+  uint32_t vsync_period = 0;
+  uint32_t x_res = 0;
+  uint32_t y_res = 0;
+  float x_dpi = 0;
+  float y_dpi = 0;
+  DisplayPortType panel_type = DisplayPortType::kDefault;
+  bool is_yuv = 0;
+};
+
+struct HDRCapsParams {
+  std::vector<int> supported_hdr_types = {};
+  float max_luminance = 0;
+  float max_avg_luminance = 0;
+  float min_luminance = 0;
+};
+
+struct StatusParams {
+  DisplayType dpy = DisplayType::kInvalid;
+  ExternalStatus status = ExternalStatus::kInvalid;
+};
+
+struct DynRefreshRateParams {
+  DynRefreshRateOp op = DynRefreshRateOp::kInvalid;
+  uint32_t refresh_rate = 0;
+};
+
+struct ConfigParams {
+  DisplayType dpy = DisplayType::kInvalid;
+  uint32_t config = 0;
+};
+
+struct AttributesParams {
+  uint32_t config_index = 0;
+  DisplayType dpy = DisplayType::kInvalid;
+};
+
+struct MinHdcpEncLevelChangedParams {
+  DisplayType dpy = DisplayType::kInvalid;
+  uint32_t min_enc_level = 0;
+};
+
+struct PartialUpdateParams {
+  DisplayType dpy = DisplayType::kInvalid;
+  bool enable = 0;
+};
+
+struct AnimationParams {
+  uint64_t display_id = 0;
+  bool animating = 0;
+};
+
+struct IdlePcParams {
+  bool enable = 0;
+  bool synchronous = 0;
+};
+
+struct DppsAdRoiParams {
+  uint32_t display_id = 0;
+  uint32_t h_start = 0;
+  uint32_t h_end = 0;
+  uint32_t v_start = 0;
+  uint32_t v_end = 0;
+  uint32_t factor_in = 0;
+  uint32_t factor_out = 0;
+};
+
+struct PowerModeParams {
+  uint32_t disp_id = 0;
+  PowerMode power_mode = PowerMode::kOff;
+};
+
+struct LayerMaskParams {
+  uint32_t disp_id = 0;
+  uint64_t layer_id = 0;
+};
+
+struct PanelLumAttrParams {
+  uint32_t disp_id = 0;
+  float min_lum = 0;
+  float max_lum = 0;
+};
+
+struct Rect {
+  uint32_t left = 0;
+  uint32_t top = 0;
+  uint32_t right = 0;
+  uint32_t bottom = 0;
+};
+
+struct CwbBufferParams {
+  uint32_t disp_id = 0;
+  Rect rect;
+  bool post_processed = 0;
+};
+
+struct DsiClkParams {
+  uint32_t disp_id = 0;
+  uint64_t bit_clk = 0;
+};
+
+struct QsyncModeParams {
+  uint32_t disp_id = 0;
+  QsyncMode mode = QsyncMode::kNone;
+};
+
+struct SmartPanelCfgParams {
+  uint32_t disp_id = 0;
+  uint32_t config_id = 0;
+};
+
+struct VdsParams {
+  uint32_t width = 0;
+  uint32_t height = 0;
+  int format = 0;
+};
+
+struct RotatorFormatParams {
+  int hal_format = 0;
+  bool ubwc = 0;
+};
+
+struct QsyncCallbackParams {
+  bool qsync_enabled = 0;
+  int refresh_rate = 0;
+  int qsync_refresh_rate = 0;
+};
+
+struct TUIEventParams {
+  DisplayType dpy = DisplayType::kInvalid;
+  TUIEventType tui_event_type = TUIEventType::kNone;
+};
+
+/* Callback Interface */
+class ConfigCallback {
+ public:
+  virtual void NotifyCWBBufferDone(int error, const native_handle_t *buffer) { }
+  virtual void NotifyQsyncChange(bool qsync_enabled, int refresh_rate, int qsync_refresh_rate) { }
+
+ protected:
+  virtual ~ConfigCallback() { }
+};
+
+#define DEFAULT_RET { return -EINVAL; }
+
+/* Config Interface */
+class ConfigInterface {
+ public:
+  virtual int IsDisplayConnected(DisplayType dpy, bool *connected) DEFAULT_RET
+  virtual int SetDisplayStatus(DisplayType dpy, ExternalStatus status) DEFAULT_RET
+  virtual int ConfigureDynRefreshRate(DynRefreshRateOp op, uint32_t refresh_rate) DEFAULT_RET
+  virtual int GetConfigCount(DisplayType dpy, uint32_t *count) DEFAULT_RET
+  virtual int GetActiveConfig(DisplayType dpy, uint32_t *config) DEFAULT_RET
+  virtual int SetActiveConfig(DisplayType dpy, uint32_t config) DEFAULT_RET
+  virtual int GetDisplayAttributes(uint32_t config_index, DisplayType dpy,
+                                   Attributes *attributes) DEFAULT_RET
+  virtual int SetPanelBrightness(uint32_t level) DEFAULT_RET
+  virtual int GetPanelBrightness(uint32_t *level) DEFAULT_RET
+  virtual int MinHdcpEncryptionLevelChanged(DisplayType dpy, uint32_t min_enc_level) DEFAULT_RET
+  virtual int RefreshScreen() DEFAULT_RET
+  virtual int ControlPartialUpdate(DisplayType dpy, bool enable) DEFAULT_RET
+  virtual int ToggleScreenUpdate(bool on) DEFAULT_RET
+  virtual int SetIdleTimeout(uint32_t value) DEFAULT_RET
+  virtual int GetHDRCapabilities(DisplayType dpy, HDRCapsParams *caps) DEFAULT_RET
+  virtual int SetCameraLaunchStatus(uint32_t on) DEFAULT_RET
+  virtual int DisplayBWTransactionPending(bool *status) DEFAULT_RET
+  virtual int SetDisplayAnimating(uint64_t display_id, bool animating) DEFAULT_RET
+  virtual int ControlIdlePowerCollapse(bool enable, bool synchronous) DEFAULT_RET
+  virtual int GetWriteBackCapabilities(bool *is_wb_ubwc_supported) DEFAULT_RET
+  virtual int SetDisplayDppsAdROI(uint32_t display_id, uint32_t h_start, uint32_t h_end,
+                                  uint32_t v_start, uint32_t v_end, uint32_t factor_in,
+                                  uint32_t factor_out) DEFAULT_RET
+  virtual int UpdateVSyncSourceOnPowerModeOff() DEFAULT_RET
+  virtual int UpdateVSyncSourceOnPowerModeDoze() DEFAULT_RET
+  virtual int SetPowerMode(uint32_t disp_id, PowerMode power_mode) DEFAULT_RET
+  virtual int IsPowerModeOverrideSupported(uint32_t disp_id, bool *supported) DEFAULT_RET
+  virtual int IsHDRSupported(uint32_t disp_id, bool *supported) DEFAULT_RET
+  virtual int IsWCGSupported(uint32_t disp_id, bool *supported) DEFAULT_RET
+  virtual int SetLayerAsMask(uint32_t disp_id, uint64_t layer_id) DEFAULT_RET
+  virtual int GetDebugProperty(const std::string prop_name, std::string *value) DEFAULT_RET
+  virtual int GetActiveBuiltinDisplayAttributes(Attributes *attr) DEFAULT_RET
+  virtual int SetPanelLuminanceAttributes(uint32_t disp_id, float min_lum,
+                                          float max_lum) DEFAULT_RET
+  virtual int IsBuiltInDisplay(uint32_t disp_id, bool *is_builtin) DEFAULT_RET
+  virtual int IsAsyncVDSCreationSupported(bool *supported) DEFAULT_RET
+  virtual int CreateVirtualDisplay(uint32_t width, uint32_t height, int format) DEFAULT_RET
+  virtual int GetSupportedDSIBitClks(uint32_t disp_id, std::vector<uint64_t> *bit_clks) DEFAULT_RET
+  virtual int GetDSIClk(uint32_t disp_id, uint64_t *bit_clk) DEFAULT_RET
+  virtual int SetDSIClk(uint32_t disp_id, uint64_t bit_clk) DEFAULT_RET
+  virtual int SetCWBOutputBuffer(uint32_t disp_id, const Rect rect, bool post_processed,
+                                 const native_handle_t *buffer) DEFAULT_RET
+  virtual int SetQsyncMode(uint32_t disp_id, QsyncMode mode) DEFAULT_RET
+  virtual int IsSmartPanelConfig(uint32_t disp_id, uint32_t config_id, bool *is_smart) DEFAULT_RET
+  virtual int IsRotatorSupportedFormat(int hal_format, bool ubwc, bool *supported) DEFAULT_RET
+  virtual int ControlQsyncCallback(bool enable) DEFAULT_RET
+  virtual int SendTUIEvent(DisplayType dpy, TUIEventType event_type) DEFAULT_RET
+  virtual int GetDisplayHwId(uint32_t disp_id, uint32_t *display_hw_id) DEFAULT_RET
+  virtual int GetSupportedDisplayRefreshRates(
+      DisplayType dpy, std::vector<uint32_t> *supported_refresh_rates) DEFAULT_RET
+
+  // deprecated APIs
+  virtual int GetDebugProperty(const std::string prop_name, std::string value) DEFAULT_RET
+  virtual int GetSupportedDSIBitClks(uint32_t disp_id, std::vector<uint64_t> bit_clks) DEFAULT_RET
+
+ protected:
+  virtual ~ConfigInterface() { }
+};
+
+}  // namespace DisplayConfig
+
+#endif  // __CONFIG_DEFS_H__
diff --git a/display-commonsys-intf/services/config/device_interface.h b/display-commonsys-intf/services/config/device_interface.h
new file mode 100644
index 0000000..7d85910
--- /dev/null
+++ b/display-commonsys-intf/services/config/device_interface.h
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __DEVICE_INTERFACE_H__
+#define __DEVICE_INTERFACE_H__
+
+#include "config_defs.h"
+
+namespace DisplayConfig {
+
+class ClientContext {
+ public:
+  virtual int RegisterClientContext(std::shared_ptr<ConfigCallback> callback,
+                                    ConfigInterface **intf) { return -EINVAL; }
+  virtual void UnRegisterClientContext(ConfigInterface *intf) { }
+
+ protected:
+  virtual ~ClientContext() { }
+};
+
+class DeviceInterface {
+ public:
+  static int RegisterDevice(ClientContext *intf);
+
+ protected:
+  virtual ~DeviceInterface() { }
+};
+
+}  // namespace DisplayConfig
+
+#endif  // __DEVICE_INTERFACE_H__
diff --git a/display-commonsys-intf/services/config/src/Android.bp b/display-commonsys-intf/services/config/src/Android.bp
new file mode 100644
index 0000000..27df5b8
--- /dev/null
+++ b/display-commonsys-intf/services/config/src/Android.bp
@@ -0,0 +1,24 @@
+cc_library_shared {
+    name: "libdisplayconfig.qti",
+    vendor_available: true,
+    system_ext_specific: true,
+    cflags: [
+        "-Wno-sign-conversion",
+        "-Wno-unused-parameter",
+        "-DLOG_TAG=\"libdisplayconfigqti\"",
+    ],
+    shared_libs: [
+        "libhidlbase",
+        "libutils",
+        "vendor.display.config@2.0"
+    ],
+    header_libs: ["libhardware_headers", "display_intf_headers"],
+    srcs: [
+        "client_interface.cpp",
+        "client_impl.cpp",
+        "device_impl.cpp",
+        "device_interface.cpp",
+    ],
+    export_header_lib_headers: ["display_intf_headers"],
+}
+
diff --git a/display-commonsys-intf/services/config/src/client_impl.cpp b/display-commonsys-intf/services/config/src/client_impl.cpp
new file mode 100644
index 0000000..9790f21
--- /dev/null
+++ b/display-commonsys-intf/services/config/src/client_impl.cpp
@@ -0,0 +1,937 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <string>
+#include <vector>
+
+#include "client_impl.h"
+
+namespace DisplayConfig {
+
+int ClientImpl::Init(std::string client_name, ConfigCallback *callback) {
+  display_config_ = IDisplayConfig::getService();
+  // Unable to find Display Config 2.0 service. Fail Init.
+  if (!display_config_) {
+    return -1;
+  }
+  int32_t error = 0;
+  uint64_t handle = 0;
+  auto hidl_callback = [&error, &handle] (int32_t err, uint64_t client_handle) {
+    error = err;
+    handle = client_handle;
+  };
+  int pid = getpid();
+  android::sp<ClientCallback> client_cb(new ClientCallback(callback));
+  display_config_->registerClient(client_name + std::to_string(pid), client_cb,
+                                  hidl_callback);
+  client_handle_ = handle;
+
+  return 0;
+}
+
+void ClientImpl::DeInit() {
+  int32_t error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kDestroy, {}, {}, hidl_cb);
+  display_config_.clear();
+  display_config_ = nullptr;
+}
+
+int ClientImpl::IsDisplayConnected(DisplayType dpy, bool *connected) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&dpy), sizeof(DisplayType));
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kIsDisplayConnected, input_params, {}, hidl_cb);
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+
+  if (!error) {
+    *connected = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::SetDisplayStatus(DisplayType dpy, ExternalStatus status) {
+  struct StatusParams input = {dpy, status};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct StatusParams));
+  int error = 0;
+
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetDisplayStatus, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::ConfigureDynRefreshRate(DynRefreshRateOp op, uint32_t refresh_rate) {
+  struct DynRefreshRateParams input = {op, refresh_rate};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input),
+                             sizeof(struct DynRefreshRateParams));
+  int error = 0;
+
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kConfigureDynRefreshRate, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::GetConfigCount(DisplayType dpy, uint32_t *count) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&dpy), sizeof(DisplayType));
+  const uint32_t *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetConfigCount, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const uint32_t*>(data);
+  *count = *output;
+
+  return error;
+}
+
+int ClientImpl::GetActiveConfig(DisplayType dpy, uint32_t *config) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&dpy), sizeof(DisplayType));
+  const uint32_t *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetActiveConfig, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const uint32_t*>(data);
+  *config = *output;
+
+  return error;
+}
+
+int ClientImpl::SetActiveConfig(DisplayType dpy, uint32_t config) {
+  struct ConfigParams input = {dpy, config};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct ConfigParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetActiveConfig, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::GetDisplayAttributes(uint32_t config_index, DisplayType dpy,
+                                     Attributes *attributes) {
+  struct AttributesParams input = {config_index, dpy};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct AttributesParams));
+  const struct Attributes *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetDisplayAttributes, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const Attributes*>(data);
+  if (!error) {
+    *attributes = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::SetPanelBrightness(uint32_t level) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&level), sizeof(uint32_t));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetPanelBrightness, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::GetPanelBrightness(uint32_t *level) {
+  const uint32_t *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetPanelBrightness, {}, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const uint32_t*>(data);
+  if (!error) {
+    *level = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::MinHdcpEncryptionLevelChanged(DisplayType dpy, uint32_t min_enc_level) {
+  struct MinHdcpEncLevelChangedParams input = {dpy, min_enc_level};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input),
+                             sizeof(struct MinHdcpEncLevelChangedParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kMinHdcpEncryptionLevelChanged,
+                           input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::RefreshScreen() {
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kRefreshScreen, {}, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::ControlPartialUpdate(DisplayType dpy, bool enable) {
+  struct PartialUpdateParams input = {dpy, enable};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input),
+                             sizeof(struct PartialUpdateParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kControlPartialUpdate, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::ToggleScreenUpdate(bool on) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&on), sizeof(bool));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kToggleScreenUpdate, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::SetIdleTimeout(uint32_t value) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&value), sizeof(uint32_t));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetIdleTimeout, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::GetHDRCapabilities(DisplayType dpy, HDRCapsParams *caps) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&dpy), sizeof(DisplayType));
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetHdrCapabilities, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+
+  if (!error) {
+    const int32_t *hdr_caps;
+    const float *lum;
+    size_t size = output_params.size();
+    size_t hdr_caps_size = size - 3 * sizeof(float);
+    hdr_caps_size /= sizeof(int32_t);
+    hdr_caps = reinterpret_cast<const int32_t*>(data);
+    for (size_t i = 0; i < hdr_caps_size; i++) {
+      caps->supported_hdr_types.push_back(*hdr_caps);
+      hdr_caps++;
+    }
+    lum = reinterpret_cast<const float *>(hdr_caps);
+    caps->max_luminance = lum[0];
+    caps->max_avg_luminance = lum[1];
+    caps->min_luminance = lum[2];
+  }
+
+  return error;
+}
+
+int ClientImpl::SetCameraLaunchStatus(uint32_t on) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&on), sizeof(uint32_t));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetCameraLaunchStatus, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::DisplayBWTransactionPending(bool *status) {
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kDisplayBwTransactionPending, {}, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+  if (!error) {
+    *status = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::SetDisplayAnimating(uint64_t display_id, bool animating) {
+  struct AnimationParams input = {display_id, animating};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct AnimationParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetDisplayAnimating, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::ControlIdlePowerCollapse(bool enable, bool synchronous) {
+  struct IdlePcParams input = {enable, synchronous};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct IdlePcParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kControlIdlePowerCollapse, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::GetWriteBackCapabilities(bool *is_wb_ubwc_supported) {
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetWritebackCapabilities, {}, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+  if (!error) {
+    *is_wb_ubwc_supported = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::SetDisplayDppsAdROI(uint32_t display_id, uint32_t h_start,
+                                    uint32_t h_end, uint32_t v_start, uint32_t v_end,
+                                    uint32_t factor_in, uint32_t factor_out) {
+  struct DppsAdRoiParams input = {display_id, h_start, h_end, v_start, v_end,
+                                     factor_in, factor_out};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct DppsAdRoiParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetDisplayDppsAdRoi, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::UpdateVSyncSourceOnPowerModeOff() {
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kUpdateVsyncSourceOnPowerModeOff, {}, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::UpdateVSyncSourceOnPowerModeDoze() {
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kUpdateVsyncSourceOnPowerModeDoze, {}, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::SetPowerMode(uint32_t disp_id, PowerMode power_mode) {
+  struct PowerModeParams input = {disp_id, power_mode};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct PowerModeParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetPowerMode, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::IsPowerModeOverrideSupported(uint32_t disp_id, bool *supported) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&disp_id), sizeof(uint32_t));
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kIsPowerModeOverrideSupported,
+                           input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+
+  if (!error) {
+    *supported = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::IsHDRSupported(uint32_t disp_id, bool *supported) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&disp_id), sizeof(uint32_t));
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kIsHdrSupported, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+
+  if (!error) {
+    *supported = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::IsWCGSupported(uint32_t disp_id, bool *supported) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&disp_id), sizeof(int32_t));
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kIsWcgSupported, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+
+  if (!error) {
+    *supported = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::SetLayerAsMask(uint32_t disp_id, uint64_t layer_id) {
+  struct LayerMaskParams input = {disp_id, layer_id};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct LayerMaskParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetLayerAsMask, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::GetDebugProperty(const std::string prop_name, std::string *value) {
+  ByteStream input_params;
+  std::string prop(prop_name);
+  prop += '\0';
+  uint8_t *data_input = reinterpret_cast<uint8_t*>(const_cast<char*>(prop.data()));
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(data_input),
+                             prop.size() * sizeof(char));
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetDebugProperty, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  const char *name = reinterpret_cast<const char *>(data);
+  if (!error) {
+    std::string output(name);
+    *value = output;
+  }
+
+  return error;
+}
+
+int ClientImpl::GetActiveBuiltinDisplayAttributes(Attributes *attr) {
+  const struct Attributes *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetActiveBuiltinDisplayAttributes, {}, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const Attributes*>(data);
+  if (!error) {
+    *attr = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::SetPanelLuminanceAttributes(uint32_t disp_id, float min_lum, float max_lum) {
+  struct PanelLumAttrParams input = {disp_id, min_lum, max_lum};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct PanelLumAttrParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetPanelLuminanceAttributes, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::IsBuiltInDisplay(uint32_t disp_id, bool *is_builtin) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&disp_id), sizeof(uint32_t));
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kIsBuiltinDisplay, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+
+  if (!error) {
+    *is_builtin = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::SetCWBOutputBuffer(uint32_t disp_id, const Rect rect, bool post_processed,
+                                   const native_handle_t *buffer) {
+  struct CwbBufferParams input = {disp_id, rect, post_processed};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct CwbBufferParams));
+
+  hidl_handle handle = buffer;
+  std::vector<hidl_handle> handle_vector;
+  handle_vector.push_back(buffer);
+  HandleStream input_handles = handle_vector;
+
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetCwbOutputBuffer, input_params,
+                           input_handles, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::GetSupportedDSIBitClks(uint32_t disp_id, std::vector<uint64_t> *bit_clks) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&disp_id), sizeof(uint32_t));
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetSupportedDsiBitclks, input_params, {}, hidl_cb);
+
+  if (!error) {
+    const uint8_t *data = output_params.data();
+    const uint64_t *bit_clks_data = reinterpret_cast<const uint64_t *>(data);
+    int num_bit_clks = static_cast<int>(output_params.size() / sizeof(uint64_t));
+    for (int i = 0; i < num_bit_clks; i++) {
+      bit_clks->push_back(bit_clks_data[i]);
+    }
+  }
+
+  return error;
+}
+
+int ClientImpl::GetDSIClk(uint32_t disp_id, uint64_t *bit_clk) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&disp_id), sizeof(uint32_t));
+  const uint64_t *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetDsiClk, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const uint64_t*>(data);
+
+  if (!error) {
+    *bit_clk = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::SetDSIClk(uint32_t disp_id, uint64_t bit_clk) {
+  struct DsiClkParams input = {disp_id, bit_clk};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct DsiClkParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetDsiClk, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::SetQsyncMode(uint32_t disp_id, QsyncMode mode) {
+  struct QsyncModeParams input = {disp_id, mode};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct QsyncModeParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSetQsyncMode, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::IsSmartPanelConfig(uint32_t disp_id, uint32_t config_id, bool *is_smart) {
+  struct SmartPanelCfgParams input = {disp_id, config_id};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input),
+                             sizeof(struct SmartPanelCfgParams));
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kIsSmartPanelConfig, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+
+  if (!error) {
+    *is_smart = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::IsAsyncVDSCreationSupported(bool *supported) {
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kIsAsyncVdsSupported, {}, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+
+  if (!error) {
+    *supported = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::CreateVirtualDisplay(uint32_t width, uint32_t height, int32_t format) {
+  struct VdsParams input = {width, height, format};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct VdsParams));
+  int error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kCreateVirtualDisplay, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::IsRotatorSupportedFormat(int hal_format, bool ubwc, bool *supported) {
+  struct RotatorFormatParams input = {hal_format, ubwc};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input),
+                             sizeof(struct RotatorFormatParams));
+  const bool *output;
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kIsRotatorSupportedFormat, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  output = reinterpret_cast<const bool*>(data);
+
+  if (!error) {
+    *supported = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::ControlQsyncCallback(bool enable) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&enable), sizeof(bool));
+  int32_t error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kControlQsyncCallback, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::SendTUIEvent(DisplayType dpy, TUIEventType event_type) {
+  struct TUIEventParams input = {dpy, event_type};
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&input), sizeof(struct TUIEventParams));
+  int32_t error = 0;
+  auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+  };
+
+  display_config_->perform(client_handle_, kSendTUIEvent, input_params, {}, hidl_cb);
+
+  return error;
+}
+
+int ClientImpl::GetDisplayHwId(uint32_t disp_id, uint32_t *display_hw_id) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t*>(&disp_id), sizeof(uint32_t));
+  ByteStream output_params;
+
+  int error = 0;
+  auto hidl_cb = [&error, &output_params] (int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetDisplayHwId, input_params, {}, hidl_cb);
+
+  const uint8_t *data = output_params.data();
+  const uint32_t *output = reinterpret_cast<const uint32_t*>(data);
+
+  if (!error) {
+    *display_hw_id = *output;
+  }
+
+  return error;
+}
+
+int ClientImpl::GetSupportedDisplayRefreshRates(DisplayType dpy,
+                                                std::vector<uint32_t> *supported_refresh_rates) {
+  ByteStream input_params;
+  input_params.setToExternal(reinterpret_cast<uint8_t *>(&dpy), sizeof(DisplayType));
+  ByteStream output_params;
+  int error = 0;
+  auto hidl_cb = [&error, &output_params](int32_t err, ByteStream params, HandleStream handles) {
+    error = err;
+    output_params = params;
+  };
+
+  display_config_->perform(client_handle_, kGetSupportedDisplayRefreshRates, input_params, {},
+                           hidl_cb);
+
+  if (!error) {
+    const uint8_t *data = output_params.data();
+    const uint32_t *refresh_rates_data = reinterpret_cast<const uint32_t *>(data);
+    int num_refresh_rates = static_cast<int>(output_params.size() / sizeof(uint32_t));
+    for (int i = 0; i < num_refresh_rates; i++) {
+      supported_refresh_rates->push_back(refresh_rates_data[i]);
+    }
+  }
+
+  return error;
+}
+
+void ClientCallback::ParseNotifyCWBBufferDone(const ByteStream &input_params,
+                                              const HandleStream &input_handles) {
+  const int *error;
+
+  if (callback_ == nullptr || input_params.size() == 0 || input_handles.size() == 0) {
+    return;
+  }
+
+  const uint8_t *data = input_params.data();
+  error = reinterpret_cast<const int*>(data);
+  hidl_handle buffer = input_handles[0];
+  callback_->NotifyCWBBufferDone(*error, buffer.getNativeHandle());
+}
+
+void ClientCallback::ParseNotifyQsyncChange(const ByteStream &input_params) {
+  const struct QsyncCallbackParams *qsync_data;
+
+  if (callback_ == nullptr || input_params.size() == 0) {
+    return;
+  }
+
+  const uint8_t *data = input_params.data();
+  qsync_data = reinterpret_cast<const QsyncCallbackParams*>(data);
+  callback_->NotifyQsyncChange(qsync_data->qsync_enabled, qsync_data->refresh_rate,
+                               qsync_data->qsync_refresh_rate);
+}
+
+Return<void> ClientCallback::perform(uint32_t op_code, const ByteStream &input_params,
+                                     const HandleStream &input_handles) {
+  switch (op_code) {
+    case kSetCwbOutputBuffer:
+      ParseNotifyCWBBufferDone(input_params, input_handles);
+      break;
+    case kControlQsyncCallback:
+      ParseNotifyQsyncChange(input_params);
+      break;
+    default:
+      break;
+  }
+
+  return Void();
+}
+
+}  // namespace DisplayConfig
diff --git a/display-commonsys-intf/services/config/src/client_impl.h b/display-commonsys-intf/services/config/src/client_impl.h
new file mode 100644
index 0000000..737ea19
--- /dev/null
+++ b/display-commonsys-intf/services/config/src/client_impl.h
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __CLIENT_IMPL_H__
+#define __CLIENT_IMPL_H__
+
+#include <vendor/display/config/2.0/IDisplayConfig.h>
+#include <hidl/HidlSupport.h>
+#include <config/client_interface.h>
+#include <string>
+#include <vector>
+
+#include "opcode_types.h"
+
+namespace DisplayConfig {
+
+using vendor::display::config::V2_0::IDisplayConfig;
+using vendor::display::config::V2_0::IDisplayConfigCallback;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_handle;
+using ::android::hardware::hidl_vec;
+
+typedef hidl_vec<uint8_t> ByteStream;
+typedef hidl_vec<hidl_handle> HandleStream;
+
+class ClientCallback: public IDisplayConfigCallback {
+ public:
+  ClientCallback(ConfigCallback *cb) {
+    callback_ = cb;
+  }
+
+ private:
+  virtual Return<void> perform(uint32_t op_code, const ByteStream &input_params,
+                               const HandleStream &input_handles);
+  void ParseNotifyCWBBufferDone(const ByteStream &input_params, const HandleStream &input_handles);
+  void ParseNotifyQsyncChange(const ByteStream &input_params);
+  ConfigCallback *callback_ = nullptr;
+};
+
+class ClientImpl : public ClientInterface {
+ public:
+  int Init(std::string client_name, ConfigCallback *callback);
+  void DeInit();
+
+  virtual int IsDisplayConnected(DisplayType dpy, bool *connected);
+  virtual int SetDisplayStatus(DisplayType dpy, ExternalStatus status);
+  virtual int ConfigureDynRefreshRate(DynRefreshRateOp op, uint32_t refresh_rate);
+  virtual int GetConfigCount(DisplayType dpy, uint32_t *count);
+  virtual int GetActiveConfig(DisplayType dpy, uint32_t *config);
+  virtual int SetActiveConfig(DisplayType dpy, uint32_t config);
+  virtual int GetDisplayAttributes(uint32_t config_index, DisplayType dpy, Attributes *attributes);
+  virtual int SetPanelBrightness(uint32_t level);
+  virtual int GetPanelBrightness(uint32_t *level);
+  virtual int MinHdcpEncryptionLevelChanged(DisplayType dpy, uint32_t min_enc_level);
+  virtual int RefreshScreen();
+  virtual int ControlPartialUpdate(DisplayType dpy, bool enable);
+  virtual int ToggleScreenUpdate(bool on);
+  virtual int SetIdleTimeout(uint32_t value);
+  virtual int GetHDRCapabilities(DisplayType dpy, HDRCapsParams *caps);
+  virtual int SetCameraLaunchStatus(uint32_t on);
+  virtual int DisplayBWTransactionPending(bool *status);
+  virtual int SetDisplayAnimating(uint64_t display_id, bool animating);
+  virtual int ControlIdlePowerCollapse(bool enable, bool synchronous);
+  virtual int GetWriteBackCapabilities(bool *is_wb_ubwc_supported);
+  virtual int SetDisplayDppsAdROI(uint32_t display_id, uint32_t h_start, uint32_t h_end,
+                                  uint32_t v_start, uint32_t v_end, uint32_t factor_in,
+                                  uint32_t factor_out);
+  virtual int UpdateVSyncSourceOnPowerModeOff();
+  virtual int UpdateVSyncSourceOnPowerModeDoze();
+  virtual int SetPowerMode(uint32_t disp_id, PowerMode power_mode);
+  virtual int IsPowerModeOverrideSupported(uint32_t disp_id, bool *supported);
+  virtual int IsHDRSupported(uint32_t disp_id, bool *supported);
+  virtual int IsWCGSupported(uint32_t disp_id, bool *supported);
+  virtual int SetLayerAsMask(uint32_t disp_id, uint64_t layer_id);
+  virtual int GetDebugProperty(const std::string prop_name, std::string *value);
+  virtual int GetActiveBuiltinDisplayAttributes(Attributes *attr);
+  virtual int SetPanelLuminanceAttributes(uint32_t disp_id, float min_lum, float max_lum);
+  virtual int IsBuiltInDisplay(uint32_t disp_id, bool *is_builtin);
+  virtual int IsAsyncVDSCreationSupported(bool *supported);
+  virtual int CreateVirtualDisplay(uint32_t width, uint32_t height, int format);
+  virtual int GetSupportedDSIBitClks(uint32_t disp_id, std::vector<uint64_t> *bit_clks);
+  virtual int GetDSIClk(uint32_t disp_id, uint64_t *bit_clk);
+  virtual int SetDSIClk(uint32_t disp_id, uint64_t bit_clk);
+  virtual int SetCWBOutputBuffer(uint32_t disp_id, const Rect rect, bool post_processed,
+                                 const native_handle_t *buffer);
+  virtual int SetQsyncMode(uint32_t disp_id, QsyncMode mode);
+  virtual int IsSmartPanelConfig(uint32_t disp_id, uint32_t config_id, bool *is_smart);
+  virtual int IsRotatorSupportedFormat(int hal_format, bool ubwc, bool *supported);
+  virtual int ControlQsyncCallback(bool enable);
+  virtual int SendTUIEvent(DisplayType dpy, TUIEventType event_type);
+  virtual int GetDisplayHwId(uint32_t disp_id, uint32_t *display_hw_id);
+  virtual int GetSupportedDisplayRefreshRates(DisplayType dpy,
+                                              std::vector<uint32_t> *supported_refresh_rates);
+
+ private:
+  android::sp<IDisplayConfig> display_config_ = nullptr;
+  uint64_t client_handle_ = 0;
+};
+
+}  // namespace DisplayConfig
+
+#endif  // __CLIENT_IMPL_H__
diff --git a/display-commonsys-intf/services/config/src/client_interface.cpp b/display-commonsys-intf/services/config/src/client_interface.cpp
new file mode 100644
index 0000000..9c9ecd2
--- /dev/null
+++ b/display-commonsys-intf/services/config/src/client_interface.cpp
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <string>
+
+#include "client_impl.h"
+
+namespace DisplayConfig {
+
+int ClientInterface::Create(std::string client_name, ConfigCallback *callback,
+                            ClientInterface **intf) {
+  if (!intf) {
+    return -1;
+  }
+
+  ClientImpl *impl = new ClientImpl();
+  if (!impl) {
+    return -1;
+  }
+
+  int ret = impl->Init(client_name, callback);
+  if (ret) {
+    delete impl;
+    return -1;
+  }
+
+  *intf = impl;
+  return 0;
+}
+
+void ClientInterface::Destroy(ClientInterface *intf) {
+  if (intf) {
+    ClientImpl *impl = static_cast<ClientImpl *>(intf);
+    impl->DeInit();
+    delete impl;
+  }
+}
+
+}  // namespace DisplayConfig
diff --git a/display-commonsys-intf/services/config/src/device_impl.cpp b/display-commonsys-intf/services/config/src/device_impl.cpp
new file mode 100644
index 0000000..7480194
--- /dev/null
+++ b/display-commonsys-intf/services/config/src/device_impl.cpp
@@ -0,0 +1,920 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <string>
+#include <vector>
+
+#include "device_impl.h"
+
+namespace DisplayConfig {
+
+DeviceImpl *DeviceImpl::device_obj_ = nullptr;
+std::mutex DeviceImpl::device_lock_;
+
+int DeviceImpl::CreateInstance(ClientContext *intf) {
+  std::lock_guard<std::mutex> lock(device_lock_);
+  if (!device_obj_) {
+    device_obj_ = new DeviceImpl();
+    if (!device_obj_) {
+      return -1;
+    }
+
+    android::status_t status = device_obj_->IDisplayConfig::registerAsService();
+    // Unable to start Display Config 2.0 service. Fail Init.
+    if (status != android::OK) {
+      delete device_obj_;
+      device_obj_ = nullptr;
+      return -1;
+    }
+    device_obj_->intf_ = intf;
+  }
+
+  return 0;
+}
+
+Return<void> DeviceImpl::registerClient(const hidl_string &client_name,
+                                        const sp<IDisplayConfigCallback>& callback,
+                                        registerClient_cb _hidl_cb) {
+  int32_t error = 0;
+  std::string client_name_str = client_name.c_str();
+  if (client_name_str.empty()) {
+    error = -EINVAL;
+    _hidl_cb(error, 0);
+    return Void();
+  }
+
+  uint64_t client_handle = static_cast<uint64_t>(client_id_++);
+  std::shared_ptr<DeviceClientContext> device_client(new DeviceClientContext(callback));
+  if (callback) {
+    callback->linkToDeath(this, client_handle);
+  }
+  ConfigInterface *intf = nullptr;
+  intf_->RegisterClientContext(device_client, &intf);
+  device_client->SetDeviceConfigIntf(intf);
+
+  display_config_map_.emplace(std::make_pair(client_handle, device_client));
+  _hidl_cb(error, client_handle);
+  return Void();
+}
+
+void DeviceImpl::serviceDied(uint64_t client_handle,
+                             const android::wp<::android::hidl::base::V1_0::IBase>& callback) {
+  std::lock_guard<std::mutex> lock(death_service_mutex_);
+  auto itr = display_config_map_.find(client_handle);
+  std::shared_ptr<DeviceClientContext> client = itr->second;
+  if (client != NULL) {
+    ConfigInterface *intf = client->GetDeviceConfigIntf();
+    intf_->UnRegisterClientContext(intf);
+    client.reset();
+    display_config_map_.erase(itr);
+  }
+}
+
+DeviceImpl::DeviceClientContext::DeviceClientContext(
+            const sp<IDisplayConfigCallback> callback) : callback_(callback) { }
+
+sp<IDisplayConfigCallback> DeviceImpl::DeviceClientContext::GetDeviceConfigCallback() {
+  return callback_;
+}
+
+void DeviceImpl::DeviceClientContext::SetDeviceConfigIntf(ConfigInterface *intf) {
+  intf_ = intf;
+}
+
+ConfigInterface* DeviceImpl::DeviceClientContext::GetDeviceConfigIntf() {
+  return intf_;
+}
+
+void DeviceImpl::DeviceClientContext::NotifyCWBBufferDone(int32_t error,
+                                                          const native_handle_t *buffer) {
+  ByteStream output_params;
+  HandleStream output_handles;
+  std::vector<hidl_handle> handles;
+
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&error), sizeof(int));
+  handles.push_back(buffer);
+  output_handles = handles;
+
+  auto status = callback_->perform(kSetCwbOutputBuffer, output_params, output_handles);
+  if (status.isDeadObject()) {
+    return;
+  }
+}
+
+void DeviceImpl::DeviceClientContext::NotifyQsyncChange(bool qsync_enabled, int32_t refresh_rate,
+                                                        int32_t qsync_refresh_rate) {
+  struct QsyncCallbackParams data = {qsync_enabled, refresh_rate, qsync_refresh_rate};
+  ByteStream output_params;
+
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&data), sizeof(data));
+
+  auto status = callback_->perform(kControlQsyncCallback, output_params, {});
+  if (status.isDeadObject()) {
+    return;
+  }
+}
+
+void DeviceImpl::DeviceClientContext::ParseIsDisplayConnected(const ByteStream &input_params,
+                                                              perform_cb _hidl_cb) {
+  const DisplayType *dpy;
+  bool connected = false;
+  ByteStream output_params;
+
+  const uint8_t *data = input_params.data();
+  dpy = reinterpret_cast<const DisplayType*>(data);
+  int32_t error = intf_->IsDisplayConnected(*dpy, &connected);
+
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&connected),
+                              sizeof(connected));
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetDisplayStatus(const ByteStream &input_params,
+                                                            perform_cb _hidl_cb) {
+  const struct StatusParams *display_status;
+  const uint8_t *data = input_params.data();
+  display_status = reinterpret_cast<const StatusParams*>(data);
+  int32_t error = intf_->SetDisplayStatus(display_status->dpy,
+                                          display_status->status);
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseConfigureDynRefreshRate(const ByteStream &input_params,
+                                                                   perform_cb _hidl_cb) {
+  const struct DynRefreshRateParams *dyn_refresh_data;
+  const uint8_t *data = input_params.data();
+  dyn_refresh_data = reinterpret_cast<const DynRefreshRateParams*>(data);
+  int32_t error = intf_->ConfigureDynRefreshRate(dyn_refresh_data->op,
+                                                 dyn_refresh_data->refresh_rate);
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetConfigCount(const ByteStream &input_params,
+                                                          perform_cb _hidl_cb) {
+  const DisplayType *dpy;
+  uint32_t count = 0;
+  ByteStream output_params;
+
+  if (input_params.size() == 0) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
+
+  const uint8_t *data = input_params.data();
+  dpy = reinterpret_cast<const DisplayType*>(data);
+  int32_t error = intf_->GetConfigCount(*dpy, &count);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&count),
+                              sizeof(uint32_t));
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetActiveConfig(const ByteStream &input_params,
+                                                           perform_cb _hidl_cb) {
+  const DisplayType *dpy;
+  uint32_t config = 0;
+  ByteStream output_params;
+
+  const uint8_t *data = input_params.data();
+  dpy = reinterpret_cast<const DisplayType*>(data);
+  int32_t error = intf_->GetActiveConfig(*dpy, &config);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&config),
+                              sizeof(uint32_t));
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetActiveConfig(const ByteStream &input_params,
+                                                           perform_cb _hidl_cb) {
+  const struct ConfigParams *set_active_cfg_data;
+
+  const uint8_t *data = input_params.data();
+  set_active_cfg_data = reinterpret_cast<const ConfigParams*>(data);
+  int32_t error = intf_->SetActiveConfig(set_active_cfg_data->dpy,
+                                         set_active_cfg_data->config);
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetDisplayAttributes(const ByteStream &input_params,
+                                                                perform_cb _hidl_cb) {
+  const struct AttributesParams *get_disp_attr_data;
+  struct Attributes attributes = {};
+  ByteStream output_params;
+  int32_t error = -EINVAL;
+
+  const uint8_t *data = input_params.data();
+  get_disp_attr_data = reinterpret_cast<const AttributesParams*>(data);
+  error = intf_->GetDisplayAttributes(get_disp_attr_data->config_index, get_disp_attr_data->dpy,
+                                      &attributes);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&attributes),
+                              sizeof(struct Attributes));
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetPanelBrightness(const ByteStream &input_params,
+                                                              perform_cb _hidl_cb) {
+  const uint32_t *level;
+  int32_t error = 0;
+
+  const uint8_t *data = input_params.data();
+  level = reinterpret_cast<const uint32_t*>(data);
+  error = intf_->SetPanelBrightness(*level);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetPanelBrightness(perform_cb _hidl_cb) {
+  uint32_t level = 0;
+  ByteStream output_params;
+  int32_t error = -EINVAL;
+
+  error = intf_->GetPanelBrightness(&level);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&level),
+                              sizeof(uint32_t));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseMinHdcpEncryptionLevelChanged(
+                                      const ByteStream &input_params,
+                                      perform_cb _hidl_cb) {
+  const struct MinHdcpEncLevelChangedParams *min_hdcp_enc_level_data;
+  int32_t error = 0;
+
+  const uint8_t *data = input_params.data();
+  min_hdcp_enc_level_data = reinterpret_cast<const MinHdcpEncLevelChangedParams*>(data);
+  error = intf_->MinHdcpEncryptionLevelChanged(min_hdcp_enc_level_data->dpy,
+                                               min_hdcp_enc_level_data->min_enc_level);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseRefreshScreen(perform_cb _hidl_cb) {
+  int32_t error = intf_->RefreshScreen();
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseControlPartialUpdate(const ByteStream &input_params,
+                                                                perform_cb _hidl_cb) {
+  const struct PartialUpdateParams *partial_update_data;
+  int32_t error = 0;
+
+  const uint8_t *data = input_params.data();
+  partial_update_data = reinterpret_cast<const PartialUpdateParams*>(data);
+  error = intf_->ControlPartialUpdate(partial_update_data->dpy, partial_update_data->enable);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseToggleScreenUpdate(const ByteStream &input_params,
+                                                              perform_cb _hidl_cb) {
+  const bool *on;
+  int32_t error = 0;
+
+  const uint8_t *data = input_params.data();
+  on = reinterpret_cast<const bool*>(data);
+  error = intf_->ToggleScreenUpdate(on);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetIdleTimeout(const ByteStream &input_params,
+                                                          perform_cb _hidl_cb) {
+  const uint32_t *timeout_value;
+
+  const uint8_t *data = input_params.data();
+  timeout_value = reinterpret_cast<const uint32_t*>(data);
+  int32_t error = intf_->SetIdleTimeout(*timeout_value);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetHdrCapabilities(const ByteStream &input_params,
+                                                              perform_cb _hidl_cb) {
+  const DisplayType *dpy;
+  ByteStream output_params;
+  struct HDRCapsParams hdr_caps;
+  int32_t *data_output;
+  int32_t error = -EINVAL;
+
+  const uint8_t *data = input_params.data();
+  dpy = reinterpret_cast<const DisplayType*>(data);
+  error = intf_->GetHDRCapabilities(*dpy, &hdr_caps);
+
+  data_output = reinterpret_cast<int32_t *>(malloc(sizeof(int32_t) *
+                hdr_caps.supported_hdr_types.size() + 3 * sizeof(float)));
+  if (data_output != NULL) {
+    for (int i = 0; i < hdr_caps.supported_hdr_types.size(); i++) {
+      data_output[i] = hdr_caps.supported_hdr_types[i];
+    }
+    float *lum = reinterpret_cast<float *>(&data_output[hdr_caps.supported_hdr_types.size()]);
+    *lum = hdr_caps.max_luminance;
+    lum++;
+    *lum = hdr_caps.max_avg_luminance;
+    lum++;
+    *lum = hdr_caps.min_luminance;
+    output_params.setToExternal(reinterpret_cast<uint8_t*>(data_output), sizeof(int32_t) *
+                                hdr_caps.supported_hdr_types.size() + 3 * sizeof(float));
+    _hidl_cb(error, output_params, {});
+  }
+  else {
+    _hidl_cb(-EINVAL, {}, {});
+  }
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetCameraLaunchStatus(const ByteStream &input_params,
+                                                                 perform_cb _hidl_cb) {
+  const uint32_t *launch_status_data;
+
+  const uint8_t *data = input_params.data();
+  launch_status_data = reinterpret_cast<const uint32_t*>(data);
+
+  int32_t error = intf_->SetCameraLaunchStatus(*launch_status_data);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseDisplayBwTransactionPending(perform_cb _hidl_cb) {
+  bool status = true;
+  ByteStream output_params;
+
+  int32_t error = intf_->DisplayBWTransactionPending(&status);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&status),
+                              sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetDisplayAnimating(const ByteStream &input_params,
+                                                               perform_cb _hidl_cb) {
+  const struct AnimationParams *display_animating_data;
+
+  const uint8_t *data = input_params.data();
+  display_animating_data = reinterpret_cast<const AnimationParams*>(data);
+  int32_t error = intf_->SetDisplayAnimating(display_animating_data->display_id,
+                                             display_animating_data->animating);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseControlIdlePowerCollapse(const ByteStream &input_params,
+                                                                    perform_cb _hidl_cb) {
+  const struct IdlePcParams *idle_pc_data;
+
+  const uint8_t *data = input_params.data();
+  idle_pc_data = reinterpret_cast<const IdlePcParams*>(data);
+  int32_t error = intf_->ControlIdlePowerCollapse(idle_pc_data->enable, idle_pc_data->synchronous);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetWritebackCapabilities(perform_cb _hidl_cb) {
+  bool is_wb_ubwc_supported = false;
+  int32_t error = intf_->GetWriteBackCapabilities(&is_wb_ubwc_supported);
+  ByteStream output_params;
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&is_wb_ubwc_supported),
+                              sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetDisplayDppsAdRoi(const ByteStream &input_params,
+                                                               perform_cb _hidl_cb) {
+  const struct DppsAdRoiParams *ad_roi_data;
+
+  const uint8_t *data = input_params.data();
+  ad_roi_data = reinterpret_cast<const DppsAdRoiParams*>(data);
+
+  int32_t error = intf_->SetDisplayDppsAdROI(ad_roi_data->display_id, ad_roi_data->h_start,
+                                             ad_roi_data->h_end, ad_roi_data->v_start,
+                                             ad_roi_data->v_end, ad_roi_data->factor_in,
+                                             ad_roi_data->factor_out);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseUpdateVsyncSourceOnPowerModeOff(perform_cb _hidl_cb) {
+  int32_t error = intf_->UpdateVSyncSourceOnPowerModeOff();
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseUpdateVsyncSourceOnPowerModeDoze(perform_cb _hidl_cb) {
+  int32_t error = intf_->UpdateVSyncSourceOnPowerModeDoze();
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetPowerMode(const ByteStream &input_params,
+                                                        perform_cb _hidl_cb) {
+  const struct PowerModeParams *set_power_mode_data;
+
+  const uint8_t *data = input_params.data();
+  set_power_mode_data = reinterpret_cast<const PowerModeParams*>(data);
+  int32_t error = intf_->SetPowerMode(set_power_mode_data->disp_id,
+                                      set_power_mode_data->power_mode);
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseIsPowerModeOverrideSupported(
+                                      const ByteStream &input_params,
+                                      perform_cb _hidl_cb) {
+  const uint8_t *data = input_params.data();
+  const uint32_t *disp_id = reinterpret_cast<const uint32_t*>(data);
+  bool supported = false;
+  int32_t error = intf_->IsPowerModeOverrideSupported(*disp_id, &supported);
+  ByteStream output_params;
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&supported),
+                              sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseIsHdrSupported(const ByteStream &input_params,
+                                                          perform_cb _hidl_cb) {
+  const uint8_t *data = input_params.data();
+  const uint32_t *disp_id = reinterpret_cast<const uint32_t*>(data);
+  bool supported = false;
+  int32_t error = intf_->IsHDRSupported(*disp_id, &supported);
+  ByteStream output_params;
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&supported),
+                              sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseIsWcgSupported(const ByteStream &input_params,
+                                                          perform_cb _hidl_cb) {
+  const uint8_t *data = input_params.data();
+  const int32_t *disp_id = reinterpret_cast<const int32_t*>(data);
+  bool supported = false;
+  int32_t error = intf_->IsWCGSupported(*disp_id, &supported);
+  ByteStream output_params;
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&supported),
+                              sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetLayerAsMask(const ByteStream &input_params,
+                                                          perform_cb _hidl_cb) {
+  const struct LayerMaskParams *layer_mask_data;
+
+  const uint8_t *data = input_params.data();
+  layer_mask_data = reinterpret_cast<const LayerMaskParams*>(data);
+  int32_t error = intf_->SetLayerAsMask(layer_mask_data->disp_id, layer_mask_data->layer_id);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetDebugProperty(const ByteStream &input_params,
+                                                            perform_cb _hidl_cb) {
+  std::string value;
+  ByteStream output_params;
+
+  const uint8_t *data = input_params.data();
+  const char *name = reinterpret_cast<const char *>(data);
+  std::string prop_name(name);
+  int32_t error = intf_->GetDebugProperty(prop_name, &value);
+  value += '\0';
+  uint8_t *data_output = reinterpret_cast<uint8_t*>(value.data());
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(data_output),
+                              value.size() * sizeof(char));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetActiveBuiltinDisplayAttributes(perform_cb _hidl_cb) {
+  struct Attributes attr;
+  ByteStream output_params;
+
+  int32_t error = intf_->GetActiveBuiltinDisplayAttributes(&attr);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&attr), sizeof(Attributes));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetPanelLuminanceAttributes(
+                                      const ByteStream &input_params,
+                                      perform_cb _hidl_cb) {
+  const struct PanelLumAttrParams *panel_lum_attr_data;
+
+  const uint8_t *data = input_params.data();
+  panel_lum_attr_data = reinterpret_cast<const PanelLumAttrParams*>(data);
+  int32_t error = intf_->SetPanelLuminanceAttributes(panel_lum_attr_data->disp_id,
+                                                     panel_lum_attr_data->min_lum,
+                                                     panel_lum_attr_data->max_lum);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseIsBuiltinDisplay(const ByteStream &input_params,
+                                                            perform_cb _hidl_cb) {
+  const uint32_t *disp_id;
+  bool is_builtin = false;
+  ByteStream output_params;
+
+  const uint8_t *data = input_params.data();
+  disp_id = reinterpret_cast<const uint32_t*>(data);
+  int32_t error = intf_->IsBuiltInDisplay(*disp_id, &is_builtin);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&is_builtin),
+                              sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetCwbOutputBuffer(uint64_t clientHandle,
+                                                              const ByteStream &input_params,
+                                                              const HandleStream &input_handles,
+                                                              perform_cb _hidl_cb) {
+  const struct CwbBufferParams *cwb_buffer_data;
+
+  const uint8_t *data = input_params.data();
+  cwb_buffer_data = reinterpret_cast<const CwbBufferParams*>(data);
+  hidl_handle buffer = input_handles[0];
+
+  if (!callback_ || !buffer.getNativeHandle()) {
+    _hidl_cb(-1, {}, {});
+    return;
+  }
+
+  int32_t error = intf_->SetCWBOutputBuffer(cwb_buffer_data->disp_id , cwb_buffer_data->rect,
+                                            cwb_buffer_data->post_processed,
+                                            buffer.getNativeHandle());
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetSupportedDsiBitclks(const ByteStream &input_params,
+                                                                  perform_cb _hidl_cb) {
+  const uint32_t *disp_id;
+  ByteStream output_params;
+  std::vector<uint64_t> bit_clks;
+  uint64_t *bit_clks_data;
+
+  const uint8_t *data = input_params.data();
+  disp_id = reinterpret_cast<const uint32_t*>(data);
+  int32_t error = intf_->GetSupportedDSIBitClks(*disp_id, &bit_clks);
+
+  bit_clks_data = reinterpret_cast<uint64_t *>(malloc(sizeof(uint64_t) * bit_clks.size()));
+  if (bit_clks_data == NULL) {
+    _hidl_cb(-EINVAL, {}, {});
+    return;
+  }
+  for (int i = 0; i < bit_clks.size(); i++) {
+    bit_clks_data[i] = bit_clks[i];
+  }
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(bit_clks_data),
+                              sizeof(uint64_t) * bit_clks.size());
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetDsiClk(const ByteStream &input_params,
+                                                     perform_cb _hidl_cb) {
+  const uint32_t *disp_id;
+  uint64_t bit_clk = 0;
+  ByteStream output_params;
+
+  const uint8_t *data = input_params.data();
+  disp_id = reinterpret_cast<const uint32_t*>(data);
+  int32_t error = intf_->GetDSIClk(*disp_id, &bit_clk);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&bit_clk),
+                              sizeof(uint64_t));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetDsiClk(const ByteStream &input_params,
+                                                     perform_cb _hidl_cb) {
+  const struct DsiClkParams *set_dsi_clk_data;
+
+  const uint8_t *data = input_params.data();
+  set_dsi_clk_data = reinterpret_cast<const DsiClkParams*>(data);
+  int32_t error = intf_->SetDSIClk(set_dsi_clk_data->disp_id, set_dsi_clk_data->bit_clk);
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSetQsyncMode(const ByteStream &input_params,
+                                                        perform_cb _hidl_cb) {
+  const struct QsyncModeParams *set_qsync_mode_data;
+
+  const uint8_t *data = input_params.data();
+  set_qsync_mode_data = reinterpret_cast<const QsyncModeParams*>(data);
+  int32_t error = intf_->SetQsyncMode(set_qsync_mode_data->disp_id, set_qsync_mode_data->mode);
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseIsSmartPanelConfig(const ByteStream &input_params,
+                                                              perform_cb _hidl_cb) {
+  const struct SmartPanelCfgParams *smart_panel_cfg_data;
+  bool is_smart = false;
+  ByteStream output_params;
+
+  const uint8_t *data = input_params.data();
+  smart_panel_cfg_data = reinterpret_cast<const SmartPanelCfgParams*>(data);
+  int32_t error = intf_->IsSmartPanelConfig(smart_panel_cfg_data->disp_id,
+                                            smart_panel_cfg_data->config_id, &is_smart);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&is_smart),
+                              sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseIsAsyncVdsSupported(perform_cb _hidl_cb) {
+  bool is_supported = false;
+  int32_t error = intf_->IsAsyncVDSCreationSupported(&is_supported);
+  ByteStream output_params;
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&is_supported),
+                             sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseCreateVirtualDisplay(const ByteStream &input_params,
+                                                                perform_cb _hidl_cb) {
+  const struct VdsParams *vds_input_data;
+
+  const uint8_t *data = input_params.data();
+  vds_input_data = reinterpret_cast<const VdsParams*>(data);
+
+  int32_t error = intf_->CreateVirtualDisplay(vds_input_data->width, vds_input_data->height,
+                                              vds_input_data->format);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseIsRotatorSupportedFormat(const ByteStream &input_params,
+                                                                    perform_cb _hidl_cb) {
+  const struct RotatorFormatParams *input_data;
+  bool supported = false;
+  ByteStream output_params;
+
+  const uint8_t *data = input_params.data();
+  input_data = reinterpret_cast<const RotatorFormatParams*>(data);
+  int32_t error = intf_->IsRotatorSupportedFormat(input_data->hal_format, input_data->ubwc,
+                                                  &supported);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&supported),
+                              sizeof(bool));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseControlQsyncCallback(uint64_t client_handle,
+                                                                const ByteStream &input_params,
+                                                                perform_cb _hidl_cb) {
+  const bool *enable;
+
+  const uint8_t *data = input_params.data();
+  enable = reinterpret_cast<const bool*>(data);
+
+  int32_t error = intf_->ControlQsyncCallback(*enable);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseSendTUIEvent(const ByteStream &input_params,
+                                                        perform_cb _hidl_cb) {
+  const struct TUIEventParams *input_data =
+               reinterpret_cast<const TUIEventParams*>(input_params.data());
+
+  int32_t error = intf_->SendTUIEvent(input_data->dpy, input_data->tui_event_type);
+
+  _hidl_cb(error, {}, {});
+}
+
+void DeviceImpl::ParseDestroy(uint64_t client_handle, perform_cb _hidl_cb) {
+  auto itr = display_config_map_.find(client_handle);
+  if (itr == display_config_map_.end()) {
+    _hidl_cb(-EINVAL, {}, {});
+    return;
+  }
+
+  std::shared_ptr<DeviceClientContext> client = itr->second;
+  if (client != NULL) {
+    sp<IDisplayConfigCallback> callback = client->GetDeviceConfigCallback();
+    callback->unlinkToDeath(this);
+    ConfigInterface *intf = client->GetDeviceConfigIntf();
+    intf_->UnRegisterClientContext(intf);
+    client.reset();
+    display_config_map_.erase(itr);
+  }
+
+  _hidl_cb(0, {}, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetDisplayHwId(const ByteStream &input_params,
+                                                          perform_cb _hidl_cb) {
+  uint32_t disp_hw_id = 0;
+  ByteStream output_params;
+
+  const uint8_t *data = input_params.data();
+  const uint32_t *disp_id = reinterpret_cast<const uint32_t*>(data);
+  int32_t error = intf_->GetDisplayHwId(*disp_id, &disp_hw_id);
+  output_params.setToExternal(reinterpret_cast<uint8_t*>(&disp_hw_id), sizeof(uint32_t));
+
+  _hidl_cb(error, output_params, {});
+}
+
+void DeviceImpl::DeviceClientContext::ParseGetSupportedDisplayRefreshRates(
+    const ByteStream &input_params, perform_cb _hidl_cb) {
+  ByteStream output_params;
+  std::vector<uint32_t> refresh_rates;
+
+  const uint8_t *data = input_params.data();
+  const DisplayType *dpy = reinterpret_cast<const DisplayType *>(data);
+  int32_t error = intf_->GetSupportedDisplayRefreshRates(*dpy, &refresh_rates);
+
+  uint32_t *refresh_rates_data =
+      reinterpret_cast<uint32_t *>(malloc(sizeof(uint32_t) * refresh_rates.size()));
+  for (int i = 0; i < refresh_rates.size(); i++) {
+    refresh_rates_data[i] = refresh_rates[i];
+  }
+  output_params.setToExternal(reinterpret_cast<uint8_t *>(refresh_rates_data),
+                              sizeof(uint32_t) * refresh_rates.size());
+  _hidl_cb(error, output_params, {});
+}
+
+Return<void> DeviceImpl::perform(uint64_t client_handle, uint32_t op_code,
+                                 const ByteStream &input_params, const HandleStream &input_handles,
+                                 perform_cb _hidl_cb) {
+  int32_t error = 0;
+  auto itr = display_config_map_.find(client_handle);
+  if (itr == display_config_map_.end()) {
+    error = -EINVAL;
+    _hidl_cb(error, {}, {});
+    return Void();
+  }
+
+  std::shared_ptr<DeviceClientContext> client = itr->second;
+  if (!client) {
+    error = -EINVAL;
+    _hidl_cb(error, {}, {});
+     return Void();
+  }
+  switch (op_code) {
+    case kIsDisplayConnected:
+      client->ParseIsDisplayConnected(input_params, _hidl_cb);
+      break;
+    case kSetDisplayStatus:
+      client->ParseSetDisplayStatus(input_params, _hidl_cb);
+      break;
+    case kConfigureDynRefreshRate:
+      client->ParseConfigureDynRefreshRate(input_params, _hidl_cb);
+      break;
+    case kGetConfigCount:
+      client->ParseGetConfigCount(input_params, _hidl_cb);
+      break;
+    case kGetActiveConfig:
+      client->ParseGetActiveConfig(input_params, _hidl_cb);
+      break;
+    case kSetActiveConfig:
+      client->ParseSetActiveConfig(input_params, _hidl_cb);
+      break;
+    case kGetDisplayAttributes:
+      client->ParseGetDisplayAttributes(input_params, _hidl_cb);
+      break;
+    case kSetPanelBrightness:
+      client->ParseSetPanelBrightness(input_params, _hidl_cb);
+      break;
+    case kGetPanelBrightness:
+      client->ParseGetPanelBrightness(_hidl_cb);
+      break;
+    case kMinHdcpEncryptionLevelChanged:
+      client->ParseMinHdcpEncryptionLevelChanged(input_params, _hidl_cb);
+      break;
+    case kRefreshScreen:
+      client->ParseRefreshScreen(_hidl_cb);
+      break;
+    case kControlPartialUpdate:
+      client->ParseControlPartialUpdate(input_params, _hidl_cb);
+      break;
+    case kToggleScreenUpdate:
+      client->ParseToggleScreenUpdate(input_params, _hidl_cb);
+      break;
+    case kSetIdleTimeout:
+      client->ParseSetIdleTimeout(input_params, _hidl_cb);
+      break;
+    case kGetHdrCapabilities:
+      client->ParseGetHdrCapabilities(input_params, _hidl_cb);
+      break;
+    case kSetCameraLaunchStatus:
+      client->ParseSetCameraLaunchStatus(input_params, _hidl_cb);
+      break;
+    case kDisplayBwTransactionPending:
+      client->ParseDisplayBwTransactionPending(_hidl_cb);
+      break;
+    case kSetDisplayAnimating:
+      client->ParseSetDisplayAnimating(input_params, _hidl_cb);
+      break;
+    case kControlIdlePowerCollapse:
+      client->ParseControlIdlePowerCollapse(input_params, _hidl_cb);
+      break;
+    case kGetWritebackCapabilities:
+      client->ParseGetWritebackCapabilities(_hidl_cb);
+      break;
+    case kSetDisplayDppsAdRoi:
+      client->ParseSetDisplayDppsAdRoi(input_params, _hidl_cb);
+      break;
+    case kUpdateVsyncSourceOnPowerModeOff:
+      client->ParseUpdateVsyncSourceOnPowerModeOff(_hidl_cb);
+      break;
+    case kUpdateVsyncSourceOnPowerModeDoze:
+      client->ParseUpdateVsyncSourceOnPowerModeDoze(_hidl_cb);
+      break;
+    case kSetPowerMode:
+      client->ParseSetPowerMode(input_params, _hidl_cb);
+      break;
+    case kIsPowerModeOverrideSupported:
+      client->ParseIsPowerModeOverrideSupported(input_params, _hidl_cb);
+      break;
+    case kIsHdrSupported:
+      client->ParseIsHdrSupported(input_params, _hidl_cb);
+      break;
+    case kIsWcgSupported:
+      client->ParseIsWcgSupported(input_params, _hidl_cb);
+      break;
+    case kSetLayerAsMask:
+      client->ParseSetLayerAsMask(input_params, _hidl_cb);
+      break;
+    case kGetDebugProperty:
+      client->ParseGetDebugProperty(input_params, _hidl_cb);
+      break;
+    case kGetActiveBuiltinDisplayAttributes:
+      client->ParseGetActiveBuiltinDisplayAttributes(_hidl_cb);
+      break;
+    case kSetPanelLuminanceAttributes:
+      client->ParseSetPanelLuminanceAttributes(input_params, _hidl_cb);
+      break;
+    case kIsBuiltinDisplay:
+      client->ParseIsBuiltinDisplay(input_params, _hidl_cb);
+      break;
+    case kSetCwbOutputBuffer:
+      client->ParseSetCwbOutputBuffer(client_handle, input_params, input_handles, _hidl_cb);
+      break;
+    case kGetSupportedDsiBitclks:
+      client->ParseGetSupportedDsiBitclks(input_params, _hidl_cb);
+      break;
+    case kGetDsiClk:
+      client->ParseGetDsiClk(input_params, _hidl_cb);
+      break;
+    case kSetDsiClk:
+      client->ParseSetDsiClk(input_params, _hidl_cb);
+      break;
+    case kSetQsyncMode:
+      client->ParseSetQsyncMode(input_params, _hidl_cb);
+      break;
+    case kIsSmartPanelConfig:
+      client->ParseIsSmartPanelConfig(input_params, _hidl_cb);
+      break;
+    case kIsAsyncVdsSupported:
+      client->ParseIsAsyncVdsSupported(_hidl_cb);
+      break;
+    case kCreateVirtualDisplay:
+      client->ParseCreateVirtualDisplay(input_params, _hidl_cb);
+      break;
+    case kIsRotatorSupportedFormat:
+      client->ParseIsRotatorSupportedFormat(input_params, _hidl_cb);
+      break;
+    case kControlQsyncCallback:
+      client->ParseControlQsyncCallback(client_handle, input_params, _hidl_cb);
+      break;
+    case kSendTUIEvent:
+      client->ParseSendTUIEvent(input_params, _hidl_cb);
+      break;
+    case kDestroy:
+      ParseDestroy(client_handle, _hidl_cb);
+      break;
+    case kGetDisplayHwId:
+      client->ParseGetDisplayHwId(input_params, _hidl_cb);
+      break;
+    case kGetSupportedDisplayRefreshRates:
+      client->ParseGetSupportedDisplayRefreshRates(input_params, _hidl_cb);
+      break;
+    default:
+      break;
+  }
+  return Void();
+}
+
+}  // namespace DisplayConfig
diff --git a/display-commonsys-intf/services/config/src/device_impl.h b/display-commonsys-intf/services/config/src/device_impl.h
new file mode 100644
index 0000000..a116f30
--- /dev/null
+++ b/display-commonsys-intf/services/config/src/device_impl.h
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __DEVICE_IMPL_H__
+#define __DEVICE_IMPL_H__
+
+#include <vendor/display/config/2.0/IDisplayConfig.h>
+#include <hidl/HidlSupport.h>
+
+#include <config/device_interface.h>
+#include <map>
+#include <utility>
+#include <string>
+#include <vector>
+
+#include "opcode_types.h"
+
+namespace DisplayConfig {
+
+using vendor::display::config::V2_0::IDisplayConfig;
+using vendor::display::config::V2_0::IDisplayConfigCallback;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_handle;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::sp;
+
+typedef hidl_vec<uint8_t> ByteStream;
+typedef hidl_vec<hidl_handle> HandleStream;
+
+class DeviceImpl : public IDisplayConfig, public android::hardware::hidl_death_recipient {
+ public:
+  static int CreateInstance(ClientContext *intf);
+
+ private:
+  class DeviceClientContext : public ConfigCallback {
+   public:
+    explicit DeviceClientContext(const sp<IDisplayConfigCallback> callback);
+
+    void SetDeviceConfigIntf(ConfigInterface *intf);
+    ConfigInterface* GetDeviceConfigIntf();
+    sp<IDisplayConfigCallback> GetDeviceConfigCallback();
+
+    virtual void NotifyCWBBufferDone(int32_t error, const native_handle_t *buffer);
+    virtual void NotifyQsyncChange(bool qsync_enabled, int32_t refresh_rate,
+                                   int32_t qsync_refresh_rate);
+
+    void ParseIsDisplayConnected(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetDisplayStatus(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseConfigureDynRefreshRate(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetConfigCount(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetActiveConfig(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetActiveConfig(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetDisplayAttributes(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetPanelBrightness(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetPanelBrightness(perform_cb _hidl_cb);
+    void ParseMinHdcpEncryptionLevelChanged(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseRefreshScreen(perform_cb _hidl_cb);
+    void ParseControlPartialUpdate(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseToggleScreenUpdate(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetIdleTimeout(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetHdrCapabilities(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetCameraLaunchStatus(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseDisplayBwTransactionPending(perform_cb _hidl_cb);
+    void ParseSetDisplayAnimating(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseControlIdlePowerCollapse(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetWritebackCapabilities(perform_cb _hidl_cb);
+    void ParseSetDisplayDppsAdRoi(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseUpdateVsyncSourceOnPowerModeOff(perform_cb _hidl_cb);
+    void ParseUpdateVsyncSourceOnPowerModeDoze(perform_cb _hidl_cb);
+    void ParseSetPowerMode(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseIsPowerModeOverrideSupported(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseIsHdrSupported(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseIsWcgSupported(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetLayerAsMask(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetDebugProperty(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetActiveBuiltinDisplayAttributes(perform_cb _hidl_cb);
+    void ParseSetPanelLuminanceAttributes(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseIsBuiltinDisplay(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetCwbOutputBuffer(uint64_t clientHandle, const ByteStream &input_params,
+                                 const HandleStream &inputHandles, perform_cb _hidl_cb);
+    void ParseGetSupportedDsiBitclks(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetDsiClk(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetDsiClk(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseSetQsyncMode(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseIsSmartPanelConfig(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseIsAsyncVdsSupported(perform_cb _hidl_cb);
+    void ParseCreateVirtualDisplay(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseIsRotatorSupportedFormat(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseControlQsyncCallback(uint64_t client_handle, const ByteStream &input_params,
+                                   perform_cb _hidl_cb);
+    void ParseSendTUIEvent(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetDisplayHwId(const ByteStream &input_params, perform_cb _hidl_cb);
+    void ParseGetSupportedDisplayRefreshRates(const ByteStream &input_params, perform_cb _hidl_cb);
+
+   private:
+    ConfigInterface *intf_ = nullptr;
+    const sp<IDisplayConfigCallback> callback_;
+  };
+
+  Return<void> registerClient(const hidl_string &client_name, const sp<IDisplayConfigCallback>& cb,
+                              registerClient_cb _hidl_cb) override;
+  Return<void> perform(uint64_t client_handle, uint32_t op_code, const ByteStream &input_params,
+                       const HandleStream &input_handles, perform_cb _hidl_cb) override;
+  void serviceDied(uint64_t client_handle,
+                   const android::wp<::android::hidl::base::V1_0::IBase>& callback);
+  void ParseDestroy(uint64_t client_handle, perform_cb _hidl_cb);
+
+  ClientContext *intf_ = nullptr;
+  std::map<uint64_t, std::shared_ptr<DeviceClientContext>> display_config_map_;
+  uint64_t client_id_ = 0;
+  std::mutex death_service_mutex_;
+  static DeviceImpl *device_obj_;
+  static std::mutex device_lock_;
+};
+
+}  // namespace DisplayConfig
+
+#endif  // __DEVICE_IMPL_H__
diff --git a/display-commonsys-intf/services/config/src/device_interface.cpp b/display-commonsys-intf/services/config/src/device_interface.cpp
new file mode 100644
index 0000000..0c2d6b7
--- /dev/null
+++ b/display-commonsys-intf/services/config/src/device_interface.cpp
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "device_impl.h"
+
+namespace DisplayConfig {
+
+int DeviceInterface::RegisterDevice(ClientContext *intf) {
+  if (!intf) {
+    return -1;
+  }
+
+  return DeviceImpl::CreateInstance(intf);
+}
+
+}  // namespace DisplayConfig
diff --git a/display-commonsys-intf/services/config/src/opcode_types.h b/display-commonsys-intf/services/config/src/opcode_types.h
new file mode 100644
index 0000000..6386cae
--- /dev/null
+++ b/display-commonsys-intf/services/config/src/opcode_types.h
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2020 The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*    * Redistributions of source code must retain the above copyright
+*      notice, this list of conditions and the following disclaimer.
+*    * Redistributions in binary form must reproduce the above
+*      copyright notice, this list of conditions and the following
+*      disclaimer in the documentation and/or other materials provided
+*      with the distribution.
+*    * Neither the name of The Linux Foundation. nor the names of its
+*      contributors may be used to endorse or promote products derived
+*      from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __OPCODE_TYPES_H__
+#define __OPCODE_TYPES_H__
+
+namespace DisplayConfig {
+
+enum OpCode {
+  kIsDisplayConnected = 0,
+  kSetDisplayStatus = 1,
+  kConfigureDynRefreshRate = 2,
+  kGetConfigCount = 3,
+  kGetActiveConfig = 4,
+  kSetActiveConfig = 5,
+  kGetDisplayAttributes = 6,
+  kSetPanelBrightness = 7,
+  kGetPanelBrightness =  8,
+  kMinHdcpEncryptionLevelChanged = 9,
+  kRefreshScreen = 10,
+  kControlPartialUpdate = 11,
+  kToggleScreenUpdate = 12,
+  kSetIdleTimeout = 13,
+  kGetHdrCapabilities = 14,
+  kSetCameraLaunchStatus = 15,
+  kDisplayBwTransactionPending = 16,
+  kSetDisplayAnimating = 17,
+  kControlIdlePowerCollapse = 18,
+  kGetWritebackCapabilities = 19,
+  kSetDisplayDppsAdRoi = 20,
+  kUpdateVsyncSourceOnPowerModeOff = 21,
+  kUpdateVsyncSourceOnPowerModeDoze = 22,
+  kSetPowerMode = 23,
+  kIsPowerModeOverrideSupported = 24,
+  kIsHdrSupported = 25,
+  kIsWcgSupported = 26,
+  kSetLayerAsMask = 27,
+  kGetDebugProperty = 28,
+  kGetActiveBuiltinDisplayAttributes = 29,
+  kSetPanelLuminanceAttributes = 30,
+  kIsBuiltinDisplay = 31,
+  kSetCwbOutputBuffer = 32,
+  kGetSupportedDsiBitclks = 33,
+  kGetDsiClk = 34,
+  kSetDsiClk = 35,
+  kSetQsyncMode = 36,
+  kIsSmartPanelConfig = 37,
+  kIsAsyncVdsSupported = 38,
+  kCreateVirtualDisplay = 39,
+  kIsRotatorSupportedFormat = 40,
+  kControlQsyncCallback = 41,
+  kSendTUIEvent = 42,
+  kGetDisplayHwId = 43,
+  kGetSupportedDisplayRefreshRates = 44,
+
+  kDestroy = 0xFFFF, // Destroy sequence execution
+};
+
+}  // namespace DisplayConfig
+
+#endif  // __OPCODE_TYPES_H__
