Merge "hwc2: Implement IDisplayConfig HIDL service."
diff --git a/libgralloc1/gr_buf_mgr.cpp b/libgralloc1/gr_buf_mgr.cpp
index 767a4e9..16f5635 100644
--- a/libgralloc1/gr_buf_mgr.cpp
+++ b/libgralloc1/gr_buf_mgr.cpp
@@ -214,7 +214,9 @@
private_handle_t * handle = const_cast<private_handle_t *>(hnd);
handle->fd = -1;
handle->fd_metadata = -1;
- delete handle;
+ if (!(handle->flags & private_handle_t::PRIV_FLAGS_CLIENT_ALLOCATED)) {
+ delete handle;
+ }
return GRALLOC1_ERROR_NONE;
}
@@ -277,10 +279,6 @@
}
gralloc1_error_t BufferManager::RetainBuffer(private_handle_t const *hnd) {
- if (hnd->flags & private_handle_t::PRIV_FLAGS_CLIENT_ALLOCATED) {
- return GRALLOC1_ERROR_NONE;
- }
-
ALOGD_IF(DEBUG, "Retain buffer handle:%p id: %" PRIu64, hnd, hnd->id);
gralloc1_error_t err = GRALLOC1_ERROR_NONE;
std::lock_guard<std::mutex> lock(buffer_lock_);
@@ -302,10 +300,6 @@
}
gralloc1_error_t BufferManager::ReleaseBuffer(private_handle_t const *hnd) {
- if (hnd->flags & private_handle_t::PRIV_FLAGS_CLIENT_ALLOCATED) {
- return GRALLOC1_ERROR_NONE;
- }
-
ALOGD_IF(DEBUG, "Release buffer handle:%p id: %" PRIu64, hnd, hnd->id);
std::lock_guard<std::mutex> lock(buffer_lock_);
auto buf = GetBufferFromHandleLocked(hnd);
@@ -630,9 +624,20 @@
}
BufferDim_t buffer_dim;
+ int interlaced = 0;
if (getMetaData(hnd, GET_BUFFER_GEOMETRY, &buffer_dim) == 0) {
*stride = buffer_dim.sliceWidth;
*height = buffer_dim.sliceHeight;
+ } else if (getMetaData(hnd, GET_PP_PARAM_INTERLACED, &interlaced) == 0) {
+ if (interlaced && IsUBwcFormat(hnd->format)) {
+ unsigned int alignedw = 0, alignedh = 0;
+ // Get re-aligned height for single ubwc interlaced field and
+ // multiple by 2 to get frame height.
+ BufferInfo info(hnd->width, ((hnd->height+1)>>1), hnd->format);
+ GetAlignedWidthAndHeight(info, &alignedw, &alignedh);
+ *stride = static_cast<int>(alignedw);
+ *height = static_cast<int>(alignedh * 2);
+ }
} else {
*stride = hnd->width;
*height = hnd->height;
diff --git a/liblight/Android.mk b/liblight/Android.mk
index f627286..2f2e1ca 100644
--- a/liblight/Android.mk
+++ b/liblight/Android.mk
@@ -22,7 +22,7 @@
LOCAL_SRC_FILES := lights.c lights_prv.cpp
LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SHARED_LIBRARIES := liblog libcutils libsdm-disp-apis
+LOCAL_SHARED_LIBRARIES := liblog libcutils libsdm-disp-vndapis
LOCAL_CFLAGS := -DLOG_TAG=\"qdlights\"
LOCAL_CLANG := true
LOCAL_MODULE := lights.$(TARGET_BOARD_PLATFORM)
diff --git a/sdm/libs/hwc/hwc_color_manager.h b/sdm/libs/hwc/hwc_color_manager.h
index 0f4247d..20d2b39 100644
--- a/sdm/libs/hwc/hwc_color_manager.h
+++ b/sdm/libs/hwc/hwc_color_manager.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Linux Foundataion. All rights reserved.
+/* Copyright (c) 2015-2017, The Linux Foundataion. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -42,7 +42,7 @@
// This macro defines name for display APIs interface wrapper library.
// This macro shall be used to load library using dlopen().
-#define DISPLAY_API_INTERFACE_LIBRARY_NAME "libsdm-disp-apis.so"
+#define DISPLAY_API_INTERFACE_LIBRARY_NAME "libsdm-disp-vndapis.so"
// This macro defines variable name of display color APIs function tables
// This macro shall be used to specify name of the variable in dlsym().
diff --git a/sdm/libs/hwc2/hwc_color_manager.h b/sdm/libs/hwc2/hwc_color_manager.h
index 0bfd29f..f88a5bb 100644
--- a/sdm/libs/hwc2/hwc_color_manager.h
+++ b/sdm/libs/hwc2/hwc_color_manager.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Linux Foundataion. All rights reserved.
+/* Copyright (c) 2015-2017, The Linux Foundataion. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -40,7 +40,7 @@
// This macro defines name for display APIs interface wrapper library.
// This macro shall be used to load library using dlopen().
-#define DISPLAY_API_INTERFACE_LIBRARY_NAME "libsdm-disp-apis.so"
+#define DISPLAY_API_INTERFACE_LIBRARY_NAME "libsdm-disp-vndapis.so"
// This macro defines variable name of display color APIs function tables
// This macro shall be used to specify name of the variable in dlsym().