-
Notifications
You must be signed in to change notification settings - Fork 1
qt5-qpa-hwcomposer-plugin: Synchronize LCD time when transitioning display. #4
Conversation
…splay. Use the vendor provided libmcutool.so library to synchronize the LCD time when the screen turns off. Signed-off-by: Darrel Griët <dgriet@gmail.com>
How about we try a systemd timer using |
Thanks so much for that suggestion! The 12/24h time format is already controllable from the settings app, but it's only for the ui. It does not change anything else. We may build some small daemon that always runs in the background and listens to the D-Bus change. (ref: https://github.com/AsteroidOS/asteroid-settings/blob/master/src/qml/UnitsPage.qml#L31) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree, a systemd timer and a slim daemon could be great here :)
Thanks for sharing your experiment MagneFire
+ fprintf(stderr, "Unable to get symbol\n"); \ | ||
+ } \ | ||
+} | ||
+#define LOAD_MCU_FUNC5(x) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooc have you tried using variadic macros ? something along the line of https://github.com/torvalds/linux/blob/master/tools/lib/bpf/bpf_tracing.h#L321
+ } \ | ||
+} | ||
+ | ||
+extern "C" void *android_dlopen(const char *filename, int flags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to add this header on a cmake file at #5 , but I can't figure out how to do so. Any hints on that?
#ifdef HWC_DEVICE_API_VERSION_1_5 | ||
+ if (mcu) { | ||
+ mcu->nativeAutoLowPowerScreen(0, 0, 1); | ||
+ mcu->nativeSyncTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you lookup all these symbols if you only end up calling two ?
sleepDisplay(false); | ||
+ void *handler = android_dlopen("libmcutool.so", RTLD_LAZY); | ||
+ if (handler) { | ||
+ mcu = (mcu_t*) malloc(sizeof(mcu_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be freed in the destructor as well then
This work has been superseded by #5. |
Use the vendor provided libmcutool.so library to synchronize the LCD time when the screen turns off.
The patch isn't currently the greatest work (hence draft for now). But it should get the general idea across.
I'm also not entirely sure if having this code in here is even the correct state. I was thinking about some daemon, but that needs to somehow hook into time change events. Which for now I'm not sure how to do.