sdm: Add support for compliance test mode for DP
1. Add functionality in qdutils to get the DP test config from the
sysfs node.
2. Add support to generate ColorRamp, ColorSquare and Black and White
vertical line test pattern for 18/24/30 bpp DP display
3. Create layer stack with test layer and ignore all layers from the
SF framework.
4. Generate the pattern with 18/24/30 bpp based on pattern type and
bpp read from sysfs node and send it to DP interface.
5. Add support to calculate CRC to validate the color pattern.
Change-Id: I49469d94a96ada729d24d7cc03a7e79f2af6edc0
CRs-Fixed: 1107663
diff --git a/libqdutils/qd_utils.cpp b/libqdutils/qd_utils.cpp
index 43fb715..b84ae87 100644
--- a/libqdutils/qd_utils.cpp
+++ b/libqdutils/qd_utils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013, 2017 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
@@ -31,7 +31,7 @@
namespace qdutils {
-int parseLine(char *input, char *tokens[], const uint32_t maxToken, uint32_t *count) {
+static int parseLine(char *input, char *tokens[], const uint32_t maxToken, uint32_t *count) {
char *tmpToken = NULL;
char *tmpPtr;
uint32_t index = 0;
@@ -49,6 +49,38 @@
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 < HWC_NUM_DISPLAY_TYPES; j++) {
+ snprintf (msmFbTypePath, sizeof(msmFbTypePath),
+ "/sys/class/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 %d", __func__, j);
+ }
+ }
+
+ if (j < HWC_NUM_DISPLAY_TYPES)
+ return j;
+ else
+ ALOGE("%s: Failed to find %s node", __func__, type);
+
+ return -1;
+}
+
int querySDEInfo(HWQueryType type, int *value) {
FILE *fileptr = NULL;
const char *featureName;
@@ -102,37 +134,8 @@
return 0;
}
-int getHDMINode(void)
-{
- FILE *displayDeviceFP = NULL;
- char fbType[MAX_FRAME_BUFFER_NAME_SIZE];
- char msmFbTypePath[MAX_FRAME_BUFFER_NAME_SIZE];
- int j = 0;
-
- for(j = 0; j < HWC_NUM_DISPLAY_TYPES; j++) {
- snprintf (msmFbTypePath, sizeof(msmFbTypePath),
- "/sys/class/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, "dtv panel", strlen("dtv panel")) == 0) {
- ALOGD("%s: HDMI is at fb%d", __func__, j);
- fclose(displayDeviceFP);
- break;
- }
- fclose(displayDeviceFP);
- } else {
- ALOGE("%s: Failed to open fb node %d", __func__, j);
- }
- }
-
- if (j < HWC_NUM_DISPLAY_TYPES)
- return j;
- else
- ALOGE("%s: Failed to find HDMI node", __func__);
-
- return -1;
+int getHDMINode(void) {
+ return getExternalNode("dtv panel");
}
int getEdidRawData(char *buffer)
@@ -162,4 +165,80 @@
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/class/graphics/fb%d/connected", nodeId);
+
+ connectFile = fopen(connectPath, "rb");
+ if (!connectFile) {
+ ALOGW("Failed to open connect node for device node %d", nodeId);
+ 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/class/graphics/fb%d/config", nodeId);
+
+ configFile = fopen(configPath, "rb");
+ if (!configFile) {
+ ALOGW("Failed to open config node for device node %d", nodeId);
+ return -EINVAL;
+ }
+
+ while (getline(&line, &len, configFile) != -1) {
+ if (!parseLine(line, tokens, maxCount, &tokenCount)) {
+ 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;
+}
+
}; //namespace qdutils
diff --git a/libqdutils/qd_utils.h b/libqdutils/qd_utils.h
index 4722dcd..5e8d1bf 100644
--- a/libqdutils/qd_utils.h
+++ b/libqdutils/qd_utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2013, 2017 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
@@ -59,10 +59,11 @@
MAX_STRING_LENGTH = 1024,
};
-int parseLine(char *input, char *tokens[], const uint32_t maxToken, uint32_t *count);
int querySDEInfo(HWQueryType type, int *value);
int getEdidRawData(char *buffer);
int getHDMINode(void);
+bool isDPConnected();
+int getDPTestConfig(uint32_t *panelBpp, uint32_t *patternType);
}; //namespace qdutils
#endif
diff --git a/sdm/libs/hwc/Android.mk b/sdm/libs/hwc/Android.mk
index 594ade9..6fcc4c3 100644
--- a/sdm/libs/hwc/Android.mk
+++ b/sdm/libs/hwc/Android.mk
@@ -30,7 +30,8 @@
blit_engine_c2d.cpp \
cpuhint.cpp \
hwc_tonemapper.cpp \
- hwc_socket_handler.cpp
+ hwc_socket_handler.cpp \
+ hwc_display_external_test.cpp
include $(BUILD_SHARED_LIBRARY)
endif
diff --git a/sdm/libs/hwc/hwc_display_external_test.cpp b/sdm/libs/hwc/hwc_display_external_test.cpp
new file mode 100644
index 0000000..0f84326
--- /dev/null
+++ b/sdm/libs/hwc/hwc_display_external_test.cpp
@@ -0,0 +1,760 @@
+/*
+* Copyright (c) 2017, 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 <cutils/properties.h>
+#include <sys/mman.h>
+#include <utils/constants.h>
+#include <utils/debug.h>
+#include <utils/formats.h>
+#include <algorithm>
+#include <array>
+#include <sstream>
+#include <string>
+#include <fstream>
+
+#include "hwc_display_external_test.h"
+#include "hwc_debugger.h"
+
+#define __CLASS__ "HWCDisplayExternalTest"
+
+namespace sdm {
+
+using std::array;
+
+int HWCDisplayExternalTest::Create(CoreInterface *core_intf, hwc_procs_t const **hwc_procs,
+ qService::QService *qservice, uint32_t panel_bpp,
+ uint32_t pattern_type, HWCDisplay **hwc_display) {
+ HWCDisplay *hwc_external_test = new HWCDisplayExternalTest(core_intf, hwc_procs, qservice,
+ panel_bpp, pattern_type);
+
+ int status = static_cast<HWCDisplayExternalTest *>(hwc_external_test)->Init();
+ if (status) {
+ delete hwc_external_test;
+ return status;
+ }
+
+ *hwc_display = hwc_external_test;
+
+ DLOGI("panel_bpp %d, pattern_type %d", panel_bpp, pattern_type);
+
+ return status;
+}
+
+void HWCDisplayExternalTest::Destroy(HWCDisplay *hwc_display) {
+ static_cast<HWCDisplayExternalTest *>(hwc_display)->Deinit();
+
+ delete hwc_display;
+}
+
+HWCDisplayExternalTest::HWCDisplayExternalTest(CoreInterface *core_intf,
+ hwc_procs_t const **hwc_procs,
+ qService::QService *qservice, uint32_t panel_bpp,
+ uint32_t pattern_type)
+ : HWCDisplay(core_intf, hwc_procs, kHDMI, HWC_DISPLAY_EXTERNAL, false, qservice,
+ DISPLAY_CLASS_EXTERNAL), panel_bpp_(panel_bpp), pattern_type_(pattern_type) {
+}
+
+int HWCDisplayExternalTest::Init() {
+ uint32_t external_width = 0;
+ uint32_t external_height = 0;
+
+ int status = HWCDisplay::Init();
+ if (status) {
+ return status;
+ }
+
+ buffer_allocator_ = new HWCBufferAllocator();
+
+ status = CreateLayerStack();
+ if (status) {
+ Deinit();
+ return status;
+ }
+
+ DisplayError error = HWCDisplay::GetMixerResolution(&external_width, &external_height);
+ if (error != kErrorNone) {
+ Deinit();
+ return -EINVAL;
+ }
+
+ status = HWCDisplay::SetFrameBufferResolution(external_width, external_height);
+ if (status) {
+ Deinit();
+ return status;
+ }
+
+ return status;
+}
+
+int HWCDisplayExternalTest::Deinit() {
+ DestroyLayerStack();
+
+ delete buffer_allocator_;
+ buffer_allocator_ = NULL;
+
+ return HWCDisplay::Deinit();
+}
+
+
+int HWCDisplayExternalTest::Prepare(hwc_display_contents_1_t *content_list) {
+ int status = 0;
+
+ if (secure_display_active_) {
+ MarkLayersForGPUBypass(content_list);
+ return status;
+ }
+
+ if (!content_list || !content_list->numHwLayers) {
+ DLOGW("Invalid content list");
+ return -EINVAL;
+ }
+
+ if (shutdown_pending_) {
+ return 0;
+ }
+
+ DisplayError error = display_intf_->Prepare(&layer_stack_);
+ if (error != kErrorNone) {
+ if (error == kErrorShutDown) {
+ shutdown_pending_ = true;
+ } else if (error != kErrorPermission) {
+ DLOGE("Prepare failed. Error = %d", error);
+ // To prevent surfaceflinger infinite wait, flush the previous frame during Commit()
+ // so that previous buffer and fences are released, and override the error.
+ flush_ = true;
+ }
+ }
+
+ MarkLayersForGPUBypass(content_list);
+
+ return 0;
+}
+
+int HWCDisplayExternalTest::Commit(hwc_display_contents_1_t *content_list) {
+ int status = 0;
+
+ if (secure_display_active_) {
+ return status;
+ }
+
+ if (!content_list || !content_list->numHwLayers) {
+ DLOGW("Invalid content list");
+ return -EINVAL;
+ }
+
+ if (shutdown_pending_) {
+ return 0;
+ }
+
+ DumpInputBuffer();
+
+ if (!flush_) {
+ DisplayError error = kErrorUndefined;
+
+ error = display_intf_->Commit(&layer_stack_);
+ if (error == kErrorNone) {
+ // A commit is successfully submitted, start flushing on failure now onwards.
+ flush_on_error_ = true;
+ } else {
+ if (error == kErrorShutDown) {
+ shutdown_pending_ = true;
+ return status;
+ } else if (error != kErrorPermission) {
+ DLOGE("Commit failed. Error = %d", error);
+ // To prevent surfaceflinger infinite wait, flush the previous frame during Commit()
+ // so that previous buffer and fences are released, and override the error.
+ flush_ = true;
+ }
+ }
+ }
+
+ return PostCommit(content_list);
+}
+
+void HWCDisplayExternalTest::SetSecureDisplay(bool secure_display_active, bool force_flush) {
+ if (secure_display_active_ != secure_display_active) {
+ secure_display_active_ = secure_display_active;
+
+ if (secure_display_active_) {
+ DisplayError error = display_intf_->Flush();
+ if (error != kErrorNone) {
+ DLOGE("Flush failed. Error = %d", error);
+ }
+ }
+ }
+ return;
+}
+
+int HWCDisplayExternalTest::Perform(uint32_t operation, ...) {
+ return 0;
+}
+
+void HWCDisplayExternalTest::DumpInputBuffer() {
+ if (!dump_frame_count_ || flush_ || !dump_input_layers_) {
+ return;
+ }
+
+ const char *dir_path = "/data/misc/display/frame_dump_external";
+ uint32_t width = buffer_info_.alloc_buffer_info.aligned_width;
+ uint32_t height = buffer_info_.alloc_buffer_info.aligned_height;
+ string format_str = GetFormatString(buffer_info_.buffer_config.format);
+
+ char *buffer = reinterpret_cast<char *>(mmap(NULL, buffer_info_.alloc_buffer_info.size,
+ PROT_READ|PROT_WRITE, MAP_SHARED,
+ buffer_info_.alloc_buffer_info.fd, 0));
+ if (buffer == MAP_FAILED) {
+ DLOGW("mmap failed. err = %d", errno);
+ return;
+ }
+
+ if (mkdir(dir_path, 0777) != 0 && errno != EEXIST) {
+ DLOGW("Failed to create %s directory errno = %d, desc = %s", dir_path, errno, strerror(errno));
+ return;
+ }
+
+ // if directory exists already, need to explicitly change the permission.
+ if (errno == EEXIST && chmod(dir_path, 0777) != 0) {
+ DLOGW("Failed to change permissions on %s directory", dir_path);
+ return;
+ }
+
+ if (buffer) {
+ std::stringstream dump_file_name(dir_path);
+ dump_file_name << "/input_layer_" << width << "x" << height << "_" << format_str << ".raw";
+
+ std::fstream fs(dump_file_name.str().c_str());
+ if (!fs.is_open()) {
+ DLOGI("File open failed", dump_file_name.str().c_str());
+ return;
+ }
+
+ fs.write(buffer, (std::streamsize)buffer_info_.alloc_buffer_info.size);
+ fs.close();
+
+ DLOGI("Frame Dump %s: is successful", dump_file_name.str().c_str());
+ }
+
+ // Dump only once as the content is going to be same for all draw cycles
+ if (dump_frame_count_) {
+ dump_frame_count_ = 0;
+ }
+
+ if (munmap(buffer, buffer_info_.alloc_buffer_info.size) != 0) {
+ DLOGW("munmap failed. err = %d", errno);
+ return;
+ }
+}
+
+void HWCDisplayExternalTest::CalcCRC(uint32_t color_val, std::bitset<16> *crc_data) {
+ std::bitset<16> color = {};
+ std::bitset<16> temp_crc = {};
+
+ switch (panel_bpp_) {
+ case kDisplayBpp18:
+ color = (color_val & 0xFC) << 8;
+ break;
+ case kDisplayBpp24:
+ color = color_val << 8;
+ break;
+ case kDisplayBpp30:
+ color = color_val << 6;
+ break;
+ default:
+ return;
+ }
+
+ temp_crc[15] = (*crc_data)[0] ^ (*crc_data)[1] ^ (*crc_data)[2] ^ (*crc_data)[3] ^
+ (*crc_data)[4] ^ (*crc_data)[5] ^ (*crc_data)[6] ^ (*crc_data)[7] ^
+ (*crc_data)[8] ^ (*crc_data)[9] ^ (*crc_data)[10] ^ (*crc_data)[11] ^
+ (*crc_data)[12] ^ (*crc_data)[14] ^ (*crc_data)[15] ^ color[0] ^ color[1] ^
+ color[2] ^ color[3] ^ color[4] ^ color[5] ^ color[6] ^ color[7] ^ color[8] ^
+ color[9] ^ color[10] ^ color[11] ^ color[12] ^ color[14] ^ color[15];
+
+ temp_crc[14] = (*crc_data)[12] ^ (*crc_data)[13] ^ color[12] ^ color[13];
+ temp_crc[13] = (*crc_data)[11] ^ (*crc_data)[12] ^ color[11] ^ color[12];
+ temp_crc[12] = (*crc_data)[10] ^ (*crc_data)[11] ^ color[10] ^ color[11];
+ temp_crc[11] = (*crc_data)[9] ^ (*crc_data)[10] ^ color[9] ^ color[10];
+ temp_crc[10] = (*crc_data)[8] ^ (*crc_data)[9] ^ color[8] ^ color[9];
+ temp_crc[9] = (*crc_data)[7] ^ (*crc_data)[8] ^ color[7] ^ color[8];
+ temp_crc[8] = (*crc_data)[6] ^ (*crc_data)[7] ^ color[6] ^ color[7];
+ temp_crc[7] = (*crc_data)[5] ^ (*crc_data)[6] ^ color[5] ^ color[6];
+ temp_crc[6] = (*crc_data)[4] ^ (*crc_data)[5] ^ color[4] ^ color[5];
+ temp_crc[5] = (*crc_data)[3] ^ (*crc_data)[4] ^ color[3] ^ color[4];
+ temp_crc[4] = (*crc_data)[2] ^ (*crc_data)[3] ^ color[2] ^ color[3];
+ temp_crc[3] = (*crc_data)[1] ^ (*crc_data)[2] ^ (*crc_data)[15] ^ color[1] ^ color[2] ^ color[15];
+ temp_crc[2] = (*crc_data)[0] ^ (*crc_data)[1] ^ (*crc_data)[14] ^ color[0] ^ color[1] ^ color[14];
+
+ temp_crc[1] = (*crc_data)[1] ^ (*crc_data)[2] ^ (*crc_data)[3] ^ (*crc_data)[4] ^ (*crc_data)[5] ^
+ (*crc_data)[6] ^ (*crc_data)[7] ^ (*crc_data)[8] ^ (*crc_data)[9] ^
+ (*crc_data)[10] ^ (*crc_data)[11] ^ (*crc_data)[12] ^ (*crc_data)[13] ^
+ (*crc_data)[14] ^ color[1] ^ color[2] ^ color[3] ^ color[4] ^ color[5] ^ color[6] ^
+ color[7] ^ color[8] ^ color[9] ^ color[10] ^ color[11] ^ color[12] ^ color[13] ^
+ color[14];
+
+ temp_crc[0] = (*crc_data)[0] ^ (*crc_data)[1] ^ (*crc_data)[2] ^ (*crc_data)[3] ^ (*crc_data)[4] ^
+ (*crc_data)[5] ^ (*crc_data)[6] ^ (*crc_data)[7] ^ (*crc_data)[8] ^ (*crc_data)[9] ^
+ (*crc_data)[10] ^ (*crc_data)[11] ^ (*crc_data)[12] ^ (*crc_data)[13] ^
+ (*crc_data)[15] ^ color[0] ^ color[1] ^ color[2] ^ color[3] ^ color[4] ^ color[5] ^
+ color[6] ^ color[7] ^ color[8] ^ color[9] ^ color[10] ^ color[11] ^ color[12] ^
+ color[13] ^ color[15];
+
+ (*crc_data) = temp_crc;
+}
+
+int HWCDisplayExternalTest::FillBuffer() {
+ uint8_t *buffer = reinterpret_cast<uint8_t *>(mmap(NULL, buffer_info_.alloc_buffer_info.size,
+ PROT_READ|PROT_WRITE, MAP_SHARED,
+ buffer_info_.alloc_buffer_info.fd, 0));
+ if (buffer == MAP_FAILED) {
+ DLOGE("mmap failed. err = %d", errno);
+ return -EFAULT;
+ }
+
+ switch (pattern_type_) {
+ case kPatternColorRamp:
+ GenerateColorRamp(buffer);
+ break;
+ case kPatternBWVertical:
+ GenerateBWVertical(buffer);
+ break;
+ case kPatternColorSquare:
+ GenerateColorSquare(buffer);
+ break;
+ default:
+ DLOGW("Invalid Pattern type %d", pattern_type_);
+ return -EINVAL;
+ }
+
+ if (munmap(buffer, buffer_info_.alloc_buffer_info.size) != 0) {
+ DLOGE("munmap failed. err = %d", errno);
+ return -EFAULT;
+ }
+
+ return 0;
+}
+
+int HWCDisplayExternalTest::GetStride(LayerBufferFormat format, uint32_t width, uint32_t *stride) {
+ switch (format) {
+ case kFormatRGBA8888:
+ case kFormatRGBA1010102:
+ *stride = width * 4;
+ break;
+ case kFormatRGB888:
+ *stride = width * 3;
+ break;
+ default:
+ DLOGE("Unsupported format type %d", format);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+void HWCDisplayExternalTest::PixelCopy(uint32_t red, uint32_t green, uint32_t blue, uint32_t alpha,
+ uint8_t **buffer) {
+ LayerBufferFormat format = buffer_info_.buffer_config.format;
+
+ switch (format) {
+ case kFormatRGBA8888:
+ *(*buffer)++ = UINT8(red & 0xFF);
+ *(*buffer)++ = UINT8(green & 0xFF);
+ *(*buffer)++ = UINT8(blue & 0xFF);
+ *(*buffer)++ = UINT8(alpha & 0xFF);
+ break;
+ case kFormatRGB888:
+ *(*buffer)++ = UINT8(red & 0xFF);
+ *(*buffer)++ = UINT8(green & 0xFF);
+ *(*buffer)++ = UINT8(blue & 0xFF);
+ break;
+ case kFormatRGBA1010102:
+ // Lower 8 bits of red
+ *(*buffer)++ = UINT8(red & 0xFF);
+
+ // Upper 2 bits of Red + Lower 6 bits of green
+ *(*buffer)++ = UINT8(((green & 0x3F) << 2) | ((red >> 0x8) & 0x3));
+
+ // Upper 4 bits of green + Lower 4 bits of blue
+ *(*buffer)++ = UINT8(((blue & 0xF) << 4) | ((green >> 6) & 0xF));
+
+ // Upper 6 bits of blue + Lower 2 bits of alpha
+ *(*buffer)++ = UINT8(((alpha & 0x3) << 6) | ((blue >> 4) & 0x3F));
+ break;
+ default:
+ DLOGW("format not supported format = %d", format);
+ break;
+ }
+}
+
+void HWCDisplayExternalTest::GenerateColorRamp(uint8_t *buffer) {
+ uint32_t width = buffer_info_.buffer_config.width;
+ uint32_t height = buffer_info_.buffer_config.height;
+ LayerBufferFormat format = buffer_info_.buffer_config.format;
+ uint32_t aligned_width = buffer_info_.alloc_buffer_info.aligned_width;
+ uint32_t buffer_stride = 0;
+
+ uint32_t color_ramp = 0;
+ uint32_t start_color_val = 0;
+ uint32_t step_size = 1;
+ uint32_t ramp_width = 0;
+ uint32_t ramp_height = 0;
+ uint32_t shift_by = 0;
+
+ std::bitset<16> crc_red = {};
+ std::bitset<16> crc_green = {};
+ std::bitset<16> crc_blue = {};
+
+ switch (panel_bpp_) {
+ case kDisplayBpp18:
+ ramp_height = 64;
+ ramp_width = 64;
+ shift_by = 2;
+ break;
+ case kDisplayBpp24:
+ ramp_height = 64;
+ ramp_width = 256;
+ break;
+ case kDisplayBpp30:
+ ramp_height = 32;
+ ramp_width = 256;
+ start_color_val = 0x180;
+ break;
+ default:
+ return;
+ }
+
+ GetStride(format, aligned_width, &buffer_stride);
+
+ for (uint32_t loop_height = 0; loop_height < height; loop_height++) {
+ uint32_t color_value = start_color_val;
+ uint8_t *temp = buffer + (loop_height * buffer_stride);
+
+ for (uint32_t loop_width = 0; loop_width < width; loop_width++) {
+ if (color_ramp == kColorRedRamp) {
+ PixelCopy(color_value, 0, 0, 0, &temp);
+ CalcCRC(color_value, &crc_red);
+ CalcCRC(0, &crc_green);
+ CalcCRC(0, &crc_blue);
+ }
+ if (color_ramp == kColorGreenRamp) {
+ PixelCopy(0, color_value, 0, 0, &temp);
+ CalcCRC(0, &crc_red);
+ CalcCRC(color_value, &crc_green);
+ CalcCRC(0, &crc_blue);
+ }
+ if (color_ramp == kColorBlueRamp) {
+ PixelCopy(0, 0, color_value, 0, &temp);
+ CalcCRC(0, &crc_red);
+ CalcCRC(0, &crc_green);
+ CalcCRC(color_value, &crc_blue);
+ }
+ if (color_ramp == kColorWhiteRamp) {
+ PixelCopy(color_value, color_value, color_value, 0, &temp);
+ CalcCRC(color_value, &crc_red);
+ CalcCRC(color_value, &crc_green);
+ CalcCRC(color_value, &crc_blue);
+ }
+
+ color_value = (start_color_val + (((loop_width + 1) % ramp_width) * step_size)) << shift_by;
+ }
+
+ if (panel_bpp_ == kDisplayBpp30 && ((loop_height + 1) % ramp_height) == 0) {
+ if (start_color_val == 0x180) {
+ start_color_val = 0;
+ step_size = 4;
+ } else {
+ start_color_val = 0x180;
+ step_size = 1;
+ color_ramp = (color_ramp + 1) % 4;
+ }
+ continue;
+ }
+
+ if (((loop_height + 1) % ramp_height) == 0) {
+ color_ramp = (color_ramp + 1) % 4;
+ }
+ }
+
+ DLOGI("CRC red %x", crc_red.to_ulong());
+ DLOGI("CRC green %x", crc_green.to_ulong());
+ DLOGI("CRC blue %x", crc_blue.to_ulong());
+}
+
+void HWCDisplayExternalTest::GenerateBWVertical(uint8_t *buffer) {
+ uint32_t width = buffer_info_.buffer_config.width;
+ uint32_t height = buffer_info_.buffer_config.height;
+ LayerBufferFormat format = buffer_info_.buffer_config.format;
+ uint32_t aligned_width = buffer_info_.alloc_buffer_info.aligned_width;
+ uint32_t buffer_stride = 0;
+ uint32_t bits_per_component = panel_bpp_ / 3;
+ uint32_t max_color_val = (1 << bits_per_component) - 1;
+
+ std::bitset<16> crc_red = {};
+ std::bitset<16> crc_green = {};
+ std::bitset<16> crc_blue = {};
+
+ if (panel_bpp_ == kDisplayBpp18) {
+ max_color_val <<= 2;
+ }
+
+ GetStride(format, aligned_width, &buffer_stride);
+
+ for (uint32_t loop_height = 0; loop_height < height; loop_height++) {
+ uint32_t color = 0;
+ uint8_t *temp = buffer + (loop_height * buffer_stride);
+
+ for (uint32_t loop_width = 0; loop_width < width; loop_width++) {
+ if (color == kColorBlack) {
+ PixelCopy(0, 0, 0, 0, &temp);
+ CalcCRC(0, &crc_red);
+ CalcCRC(0, &crc_green);
+ CalcCRC(0, &crc_blue);
+ }
+ if (color == kColorWhite) {
+ PixelCopy(max_color_val, max_color_val, max_color_val, 0, &temp);
+ CalcCRC(max_color_val, &crc_red);
+ CalcCRC(max_color_val, &crc_green);
+ CalcCRC(max_color_val, &crc_blue);
+ }
+
+ color = (color + 1) % 2;
+ }
+ }
+
+ DLOGI("CRC red %x", crc_red.to_ulong());
+ DLOGI("CRC green %x", crc_green.to_ulong());
+ DLOGI("CRC blue %x", crc_blue.to_ulong());
+}
+
+void HWCDisplayExternalTest::GenerateColorSquare(uint8_t *buffer) {
+ uint32_t width = buffer_info_.buffer_config.width;
+ uint32_t height = buffer_info_.buffer_config.height;
+ LayerBufferFormat format = buffer_info_.buffer_config.format;
+ uint32_t aligned_width = buffer_info_.alloc_buffer_info.aligned_width;
+ uint32_t buffer_stride = 0;
+ uint32_t max_color_val = 0;
+ uint32_t min_color_val = 0;
+
+ std::bitset<16> crc_red = {};
+ std::bitset<16> crc_green = {};
+ std::bitset<16> crc_blue = {};
+
+ switch (panel_bpp_) {
+ case kDisplayBpp18:
+ max_color_val = 63 << 2; // CEA Dynamic range for 18bpp 0 - 63
+ min_color_val = 0;
+ break;
+ case kDisplayBpp24:
+ max_color_val = 235; // CEA Dynamic range for 24bpp 16 - 235
+ min_color_val = 16;
+ break;
+ case kDisplayBpp30:
+ max_color_val = 940; // CEA Dynamic range for 30bpp 64 - 940
+ min_color_val = 64;
+ break;
+ default:
+ return;
+ }
+
+ array<array<uint32_t, 3>, 8> colors = {{
+ {{max_color_val, max_color_val, max_color_val}}, // White Color
+ {{max_color_val, max_color_val, min_color_val}}, // Yellow Color
+ {{min_color_val, max_color_val, max_color_val}}, // Cyan Color
+ {{min_color_val, max_color_val, min_color_val}}, // Green Color
+ {{max_color_val, min_color_val, max_color_val}}, // Megenta Color
+ {{max_color_val, min_color_val, min_color_val}}, // Red Color
+ {{min_color_val, min_color_val, max_color_val}}, // Blue Color
+ {{min_color_val, min_color_val, min_color_val}}, // Black Color
+ }};
+
+ GetStride(format, aligned_width, &buffer_stride);
+
+ for (uint32_t loop_height = 0; loop_height < height; loop_height++) {
+ uint32_t color = 0;
+ uint8_t *temp = buffer + (loop_height * buffer_stride);
+
+ for (uint32_t loop_width = 0; loop_width < width; loop_width++) {
+ PixelCopy(colors[color][0], colors[color][1], colors[color][2], 0, &temp);
+ CalcCRC(colors[color][0], &crc_red);
+ CalcCRC(colors[color][1], &crc_green);
+ CalcCRC(colors[color][2], &crc_blue);
+
+ if (((loop_width + 1) % 64) == 0) {
+ color = (color + 1) % colors.size();
+ }
+ }
+
+ if (((loop_height + 1) % 64) == 0) {
+ std::reverse(colors.begin(), (colors.end() - 1));
+ }
+ }
+
+ DLOGI("CRC red %x", crc_red.to_ulong());
+ DLOGI("CRC green %x", crc_green.to_ulong());
+ DLOGI("CRC blue %x", crc_blue.to_ulong());
+}
+
+int HWCDisplayExternalTest::InitLayer(Layer *layer) {
+ uint32_t active_config = 0;
+ DisplayConfigVariableInfo var_info = {};
+
+ GetActiveDisplayConfig(&active_config);
+
+ GetDisplayAttributesForConfig(INT32(active_config), &var_info);
+
+ layer->flags.updating = 1;
+ layer->src_rect = LayerRect(0, 0, var_info.x_pixels, var_info.y_pixels);
+ layer->dst_rect = layer->src_rect;
+ layer->frame_rate = var_info.fps;
+ layer->blending = kBlendingPremultiplied;
+
+ layer->input_buffer.unaligned_width = var_info.x_pixels;
+ layer->input_buffer.unaligned_height = var_info.y_pixels;
+ buffer_info_.buffer_config.format = kFormatRGBA8888;
+
+ if (layer->composition != kCompositionGPUTarget) {
+ buffer_info_.buffer_config.width = var_info.x_pixels;
+ buffer_info_.buffer_config.height = var_info.y_pixels;
+ switch (panel_bpp_) {
+ case kDisplayBpp18:
+ case kDisplayBpp24:
+ buffer_info_.buffer_config.format = kFormatRGB888;
+ break;
+ case kDisplayBpp30:
+ buffer_info_.buffer_config.format = kFormatRGBA1010102;
+ break;
+ default:
+ DLOGW("panel bpp not supported %d", panel_bpp_);
+ return -EINVAL;
+ }
+ buffer_info_.buffer_config.buffer_count = 1;
+
+ int ret = buffer_allocator_->AllocateBuffer(&buffer_info_);
+ if (ret != 0) {
+ DLOGE("Buffer allocation failed. ret: %d", ret);
+ return -ENOMEM;
+ }
+
+ ret = FillBuffer();
+ if (ret != 0) {
+ buffer_allocator_->FreeBuffer(&buffer_info_);
+ return ret;
+ }
+
+ layer->input_buffer.width = buffer_info_.alloc_buffer_info.aligned_width;
+ layer->input_buffer.height = buffer_info_.alloc_buffer_info.aligned_height;
+ layer->input_buffer.size = buffer_info_.alloc_buffer_info.size;
+ layer->input_buffer.planes[0].fd = buffer_info_.alloc_buffer_info.fd;
+ layer->input_buffer.planes[0].stride = buffer_info_.alloc_buffer_info.stride;
+ layer->input_buffer.format = buffer_info_.buffer_config.format;
+
+ DLOGI("Input buffer WxH %dx%d format %s size %d fd %d stride %d", layer->input_buffer.width,
+ layer->input_buffer.height, GetFormatString(layer->input_buffer.format),
+ layer->input_buffer.size, layer->input_buffer.planes[0].fd,
+ layer->input_buffer.planes[0].stride);
+ }
+
+ return 0;
+}
+
+int HWCDisplayExternalTest::DeinitLayer(Layer *layer) {
+ if (layer->composition != kCompositionGPUTarget) {
+ int ret = buffer_allocator_->FreeBuffer(&buffer_info_);
+ if (ret != 0) {
+ DLOGE("Buffer deallocation failed. ret: %d", ret);
+ return -ENOMEM;
+ }
+ }
+
+ return 0;
+}
+
+int HWCDisplayExternalTest::CreateLayerStack() {
+ for (uint32_t i = 0; i < (kTestLayerCnt + 1 /* one dummy gpu_target layer */); i++) {
+ Layer *layer = new Layer();
+
+ if (i == kTestLayerCnt) {
+ layer->composition = kCompositionGPUTarget;
+ }
+
+ int ret = InitLayer(layer);
+ if (ret != 0) {
+ delete layer;
+ return ret;
+ }
+ layer_stack_.layers.push_back(layer);
+ }
+
+ return 0;
+}
+
+int HWCDisplayExternalTest::DestroyLayerStack() {
+ for (uint32_t i = 0; i < UINT32(layer_stack_.layers.size()); i++) {
+ Layer *layer = layer_stack_.layers.at(i);
+ int ret = DeinitLayer(layer);
+ if (ret != 0) {
+ return ret;
+ }
+
+ delete layer;
+ }
+
+ layer_stack_.layers = {};
+
+ return 0;
+}
+
+int HWCDisplayExternalTest::PostCommit(hwc_display_contents_1_t *content_list) {
+ int status = 0;
+
+ // Do no call flush on errors, if a successful buffer is never submitted.
+ if (flush_ && flush_on_error_) {
+ display_intf_->Flush();
+ }
+
+ if (!flush_) {
+ for (size_t i = 0; i < layer_stack_.layers.size(); i++) {
+ Layer *layer = layer_stack_.layers.at(i);
+ LayerBuffer &layer_buffer = layer->input_buffer;
+
+ close(layer_buffer.release_fence_fd);
+ layer_buffer.release_fence_fd = -1;
+ }
+
+ close(layer_stack_.retire_fence_fd);
+ layer_stack_.retire_fence_fd = -1;
+ content_list->retireFenceFd = -1;
+ }
+
+ flush_ = false;
+
+ return status;
+}
+
+} // namespace sdm
+
diff --git a/sdm/libs/hwc/hwc_display_external_test.h b/sdm/libs/hwc/hwc_display_external_test.h
new file mode 100644
index 0000000..050823e
--- /dev/null
+++ b/sdm/libs/hwc/hwc_display_external_test.h
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2017, 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 __HWC_DISPLAY_EXTERNAL_TEST_H__
+#define __HWC_DISPLAY_EXTERNAL_TEST_H__
+
+#include<bitset>
+
+#include "hwc_display.h"
+#include "hwc_buffer_allocator.h"
+
+namespace sdm {
+
+class HWCDisplayExternalTest : public HWCDisplay {
+ public:
+ static int Create(CoreInterface *core_intf, hwc_procs_t const **hwc_procs,
+ qService::QService *qservice, uint32_t panel_bpp, uint32_t pattern_type,
+ HWCDisplay **hwc_display);
+ static void Destroy(HWCDisplay *hwc_display);
+ virtual int Prepare(hwc_display_contents_1_t *content_list);
+ virtual int Commit(hwc_display_contents_1_t *content_list);
+ virtual void SetSecureDisplay(bool secure_display_active, bool force_flush);
+ virtual int Perform(uint32_t operation, ...);
+
+ protected:
+ HWCBufferAllocator *buffer_allocator_ = NULL;
+ BufferInfo buffer_info_ = {};
+ uint32_t panel_bpp_ = 0;
+ uint32_t pattern_type_ = 0;
+
+ enum ColorPatternType {
+ kPatternNone = 0,
+ kPatternColorRamp,
+ kPatternBWVertical,
+ kPatternColorSquare,
+ };
+
+ enum DisplayBpp {
+ kDisplayBpp18 = 18,
+ kDisplayBpp24 = 24,
+ kDisplayBpp30 = 30,
+ };
+
+ enum ColorRamp {
+ kColorRedRamp = 0,
+ kColorGreenRamp = 1,
+ kColorBlueRamp = 2,
+ kColorWhiteRamp = 3,
+ };
+
+ enum Colors {
+ kColorBlack = 0,
+ kColorWhite = 1,
+ };
+
+ private:
+ HWCDisplayExternalTest(CoreInterface *core_intf, hwc_procs_t const **hwc_procs,
+ qService::QService *qservice, uint32_t panel_bpp, uint32_t pattern_type);
+ int Init();
+ int Deinit();
+ void DumpInputBuffer();
+ void CalcCRC(uint32_t color_value, std::bitset<16> *crc_data);
+ int FillBuffer();
+ int GetStride(LayerBufferFormat format, uint32_t width, uint32_t *stride);
+ void PixelCopy(uint32_t red, uint32_t green, uint32_t blue, uint32_t alpha, uint8_t **buffer);
+ void GenerateColorRamp(uint8_t *buffer);
+ void GenerateBWVertical(uint8_t *buffer);
+ void GenerateColorSquare(uint8_t *buffer);
+ int InitLayer(Layer *layer);
+ int DeinitLayer(Layer *layer);
+ int CreateLayerStack();
+ int DestroyLayerStack();
+ int PostCommit(hwc_display_contents_1_t *content_list);
+
+ static const uint32_t kTestLayerCnt = 1;
+};
+
+} // namespace sdm
+
+#endif // __HWC_DISPLAY_EXTERNAL_TEST_H__
+
diff --git a/sdm/libs/hwc/hwc_session.cpp b/sdm/libs/hwc/hwc_session.cpp
index 8f829ea..07c241e 100644
--- a/sdm/libs/hwc/hwc_session.cpp
+++ b/sdm/libs/hwc/hwc_session.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2014 - 2016, The Linux Foundation. All rights reserved.
+* Copyright (c) 2014 - 2017, 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
@@ -54,6 +54,8 @@
#include "hwc_display_null.h"
#include "hwc_display_primary.h"
#include "hwc_display_virtual.h"
+#include "hwc_display_external_test.h"
+#include "qd_utils.h"
#define __CLASS__ "HWCSession"
@@ -148,8 +150,7 @@
HWCDebugHandler::Get()->SetProperty("persist.sys.is_hdmi_primary", "1");
is_hdmi_primary_ = true;
if (hw_disp_info.is_connected) {
- status = HWCDisplayExternal::Create(core_intf_, &hwc_procs_, qservice_,
- &hwc_display_[HWC_DISPLAY_PRIMARY]);
+ status = CreateExternalDisplay(HWC_DISPLAY_PRIMARY, 0, 0, false);
is_hdmi_yuv_ = IsDisplayYUV(HWC_DISPLAY_PRIMARY);
} else {
// NullDisplay simply closes all its fences, and advertizes a standard
@@ -640,8 +641,7 @@
hwc_display_[HWC_DISPLAY_PRIMARY]->GetFrameBufferResolution(&primary_width, &primary_height);
if (disp == HWC_DISPLAY_EXTERNAL) {
- status = HWCDisplayExternal::Create(core_intf_, &hwc_procs_, primary_width, primary_height,
- qservice_, false, &hwc_display_[disp]);
+ status = CreateExternalDisplay(disp, primary_width, primary_height, false);
connected_displays_[HWC_DISPLAY_EXTERNAL] = 1;
} else if (disp == HWC_DISPLAY_VIRTUAL) {
status = HWCDisplayVirtual::Create(core_intf_, &hwc_procs_, primary_width, primary_height,
@@ -1481,6 +1481,7 @@
// If we are in HDMI as primary and the primary display just got plugged in
if (is_hdmi_primary_ && null_display) {
uint32_t primary_width, primary_height;
+ int status = 0;
null_display->GetFrameBufferResolution(&primary_width, &primary_height);
delete null_display;
hwc_display_[HWC_DISPLAY_PRIMARY] = NULL;
@@ -1489,9 +1490,7 @@
// display had. This is necessary because SurfaceFlinger does not dynamically update
// framebuffer resolution once it reads it at bootup. So we always have to have the NULL
// display/external display both at the bootup resolution.
- int status = HWCDisplayExternal::Create(core_intf_, &hwc_procs_, primary_width,
- primary_height, qservice_, true,
- &hwc_display_[HWC_DISPLAY_PRIMARY]);
+ status = CreateExternalDisplay(HWC_DISPLAY_PRIMARY, primary_width, primary_height, true);
if (status) {
DLOGE("Could not create external display");
return -1;
@@ -1654,5 +1653,23 @@
return android::NO_ERROR;
}
+int HWCSession::CreateExternalDisplay(int disp, uint32_t primary_width, uint32_t primary_height,
+ bool use_primary_res) {
+ uint32_t panel_bpp = 0;
+ uint32_t pattern_type = 0;
+
+ if (qdutils::isDPConnected()) {
+ qdutils::getDPTestConfig(&panel_bpp, &pattern_type);
+ }
+
+ if (panel_bpp && pattern_type) {
+ return HWCDisplayExternalTest::Create(core_intf_, &hwc_procs_, qservice_, panel_bpp,
+ pattern_type, &hwc_display_[disp]);
+ }
+
+ return HWCDisplayExternal::Create(core_intf_, &hwc_procs_, primary_width, primary_height,
+ qservice_, use_primary_res, &hwc_display_[disp]);
+}
+
} // namespace sdm
diff --git a/sdm/libs/hwc/hwc_session.h b/sdm/libs/hwc/hwc_session.h
index 6ef92eb..c3ffa98 100644
--- a/sdm/libs/hwc/hwc_session.h
+++ b/sdm/libs/hwc/hwc_session.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2014 - 2016, The Linux Foundation. All rights reserved.
+* Copyright (c) 2014 - 2017, 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:
@@ -86,6 +86,8 @@
int DisconnectDisplay(int disp);
void HandleSecureDisplaySession(hwc_display_contents_1_t **displays);
int GetVsyncPeriod(int disp);
+ int CreateExternalDisplay(int disp, uint32_t primary_width, uint32_t primary_height,
+ bool use_primary_res);
// QClient methods
virtual android::status_t notifyCallback(uint32_t command, const android::Parcel *input_parcel,