diff options
author | Prabhanjan Kandula <pkandula@codeaurora.org> | 2017-09-14 19:29:46 -0700 |
---|---|---|
committer | Divya Sharma <divyash@codeaurora.org> | 2017-09-26 13:51:30 -0700 |
commit | 89105d14ff365dc144f561b385a63f6b24f05c2c (patch) | |
tree | dd9666c85fce4970d7829613e8f72b9abe896845 /libqdutils/display_config.cpp | |
parent | be9ee5de6ea2344ddadd2f99ec8d8db4fed0fbbd (diff) | |
download | display-89105d14ff365dc144f561b385a63f6b24f05c2c.tar.gz |
hqd: add qservice binder for blocking dpps
Dpps should wait opening driver before composer comes up.
Add a wservice binder call to query composer init status.
Add util function to block dpps until composer is up.
Change-Id: I82c025011e23a0b159ef2449b00b868a365d681a
CRs-fixed: 2102579
Diffstat (limited to 'libqdutils/display_config.cpp')
-rw-r--r-- | libqdutils/display_config.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libqdutils/display_config.cpp b/libqdutils/display_config.cpp index 83d912e2..87ca401e 100644 --- a/libqdutils/display_config.cpp +++ b/libqdutils/display_config.cpp @@ -366,3 +366,25 @@ extern "C" int controlPartialUpdate(int dpy, int mode) { return err; } +// returns 0 if composer is up +extern "C" int waitForComposerInit() { + int status = false; + sp<IQService> binder = getBinder(); + if (binder == NULL) { + sleep(2); + binder = getBinder(); + } + + if (binder != NULL) { + Parcel inParcel, outParcel; + binder->dispatch(IQService::GET_COMPOSER_STATUS, &inParcel, &outParcel); + status = !!outParcel.readInt32(); + if (!status) { + sleep(2); + binder->dispatch(IQService::GET_COMPOSER_STATUS, &inParcel, &outParcel); + status = !!outParcel.readInt32(); + } + } + + return !status; +} |