qdutils: Add display config to qdutils
This API is meant for system level users that need to get/set
various display attributes that are normally not available via
the regular Android framework channels.
Initially the APIs exposed are to check HDMI status, get display
attributes and set HSIC data.
Only physically connected displays are supported for now.
Change-Id: Ia783ce2ab0c4599a54c992171e01e2f0504550dc
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index 3b98788..a3f6b5b 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -86,12 +86,10 @@
static android::status_t screenRefresh(hwc_context_t *ctx) {
status_t result = NO_INIT;
-#ifdef QCOM_BSP
if(ctx->proc) {
ctx->proc->invalidate(ctx->proc);
result = NO_ERROR;
}
-#endif
return result;
}
@@ -100,11 +98,9 @@
const Parcel* inParcel,
Parcel* outParcel) {
status_t result = NO_INIT;
-#ifdef QCOM_BSP
#ifdef VPU_TARGET
result = ctx->mVPUClient->processCommand(command, inParcel, outParcel);
#endif
-#endif
return result;
}
@@ -112,6 +108,34 @@
ctx->mExtOrientation = orientation;
}
+static void isExternalConnected(hwc_context_t* ctx, Parcel* outParcel) {
+ int connected;
+ connected = ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].connected ? 1 : 0;
+ outParcel->writeInt32(connected);
+}
+
+static void getDisplayAttributes(hwc_context_t* ctx, const Parcel* inParcel,
+ Parcel* outParcel) {
+ int dpy = inParcel->readInt32();
+ outParcel->writeInt32(ctx->dpyAttr[dpy].vsync_period);
+ outParcel->writeInt32(ctx->dpyAttr[dpy].xres);
+ outParcel->writeInt32(ctx->dpyAttr[dpy].yres);
+ outParcel->writeFloat(ctx->dpyAttr[dpy].xdpi);
+ outParcel->writeFloat(ctx->dpyAttr[dpy].ydpi);
+ //XXX: Need to check what to return for HDMI
+ outParcel->writeInt32(ctx->mMDP.panel);
+}
+static void setHSIC(hwc_context_t* ctx, const Parcel* inParcel) {
+ int dpy = inParcel->readInt32();
+ HSICData_t hsic_data;
+ hsic_data.hue = inParcel->readInt32();
+ hsic_data.saturation = inParcel->readFloat();
+ hsic_data.intensity = inParcel->readInt32();
+ hsic_data.contrast = inParcel->readFloat();
+ //XXX: Actually set the HSIC data through ABL lib
+}
+
+
static void setBufferMirrorMode(hwc_context_t *ctx, uint32_t enable) {
ctx->mBufferMirrorMode = enable;
}
@@ -140,6 +164,15 @@
case IQService::BUFFER_MIRRORMODE:
setBufferMirrorMode(mHwcContext, inParcel->readInt32());
break;
+ case IQService::CHECK_EXTERNAL_STATUS:
+ isExternalConnected(mHwcContext, outParcel);
+ break;
+ case IQService::GET_DISPLAY_ATTRIBUTES:
+ getDisplayAttributes(mHwcContext, inParcel, outParcel);
+ break;
+ case IQService::SET_HSIC_DATA:
+ setHSIC(mHwcContext, inParcel);
+ break;
default:
return NO_ERROR;
}