[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I'm trying to understand how I could modify the CM libgui that it works with the huawei surfaceflinger.

These are a few missing symbols which I can workaround with shim libs

(Found them again in the Honor 4C repo. Tried somethink like this at the very beginning already)
int _ZN7android26DISPLAY_SIZE_DENSITY_VALUEE = 1080;
int _ZN7android20DISPLAY_SIZE_DENSITYE = 8;
int _ZNK7android10GLConsumer18getCurRefreshDirtyEv(){
return 0;
}

The stacktrace then is:

02-21 23:02:10.479 2940 2940 F DEBUG : backtrace:
02-21 23:02:10.480 2940 2940 F DEBUG : #00 pc 00000000000405d0 /system/lib64/libsurfaceflinger.so
02-21 23:02:10.480 2940 2940 F DEBUG : #01 pc 000000000004071c /system/lib64/libsurfaceflinger.so
02-21 23:02:10.480 2940 2940 F DEBUG : #02 pc 000000000005296c /system/lib64/libgui.so (_ZN7android11BufferQueue21ProxyConsumerListener16onFrameAvailableERKNS_10BufferItemE+84)
02-21 23:02:10.480 2940 2940 F DEBUG : #03 pc 000000000005a3a0 /system/lib64/libgui.so (_ZN7android19BufferQueueProducer11queueBufferEiRKNS_22IGraphicBufferProducer16QueueBufferInputEPNS1_17QueueBufferOutputE+2448)
02-21 23:02:10.480 2940 2940 F DEBUG : #04 pc 0000000000073608 /system/lib64/libgui.so (_ZN7android7Surface11queueBufferEP19ANativeWindowBufferi+968)
02-21 23:02:10.480 2940 2940 F DEBUG : #05 pc 000000000042fee4 /system/vendor/lib64/egl/libGLES_mali.so
02-21 23:02:10.480 2940 2940 F DEBUG : #06 pc 000000000060cbbc /system/vendor/lib64/egl/libGLES_mali.so
02-21 23:02:10.480 2940 2940 F DEBUG : #07 pc 000000000060d70c /system/vendor/lib64/egl/libGLES_mali.so (eglp_swap_buffers+1976)
02-21 23:02:10.480 2940 2940 F DEBUG : #08 pc 000000000002ad08 /system/lib64/libEGL.so (eglSwapBuffersWithDamageKHR+548)
02-21 23:02:10.480 2940 2940 F DEBUG : #09 pc 00000000000233a8 /system/lib64/libsurfaceflinger.so
02-21 23:02:10.480 2940 2940 F DEBUG : #10 pc 000000000003613c /system/lib64/libsurfaceflinger.so
02-21 23:02:10.480 2940 2940 F DEBUG : #11 pc 0000000000034194 /system/lib64/libsurfaceflinger.so
02-21 23:02:10.480 2940 2940 F DEBUG : #12 pc 0000000000032d24 /system/lib64/libsurfaceflinger.so
02-21 23:02:10.480 2940 2940 F DEBUG : #13 pc 000000000004e834 /system/lib64/libsurfaceflinger.so (_ZN7android16SurfaceFlingerEx17onMessageReceivedEi+424)
02-21 23:02:10.480 2940 2940 F DEBUG : #14 pc 000000000001aff8 /system/lib64/libutils.so (_ZN7android6Looper9pollInnerEi+312)
02-21 23:02:10.480 2940 2940 F DEBUG : #15 pc 000000000001b330 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+80)
02-21 23:02:10.480 2940 2940 F DEBUG : #16 pc 000000000002e4f8 /system/lib64/libsurfaceflinger.so
02-21 23:02:10.480 2940 2940 F DEBUG : #17 pc 000000000003255c /system/lib64/libsurfaceflinger.so (_ZN7android14SurfaceFlinger3runEv+20)
02-21 23:02:10.480 2940 2940 F DEBUG : #18 pc 0000000000001170 /system/bin/surfaceflinger
02-21 23:02:10.480 2940 2940 F DEBUG : #19 pc 000000000001bcd8 /system/lib64/libc.so (__libc_init+100)
02-21 23:02:10.480 2940 2940 F DEBUG : #20 pc 0000000000000f9c /system/bin/surfaceflinger

There's some incompatibility between the things passed. between libgui and surfaceflinger. That's also why the huawei one does work there.

XePeleato is digging pretty deep into the root issue and it looks like we have exactly the same problem.

This was discussed a bit at page ~10-14.

https://github.com/XePeleato/hisi_frameworks_native/wiki/HwComposer

The best would be to use the Huawei HWC and CM Surfaceflinger. The problem is just - well see the link above ^.

To make it work I replaced Surfaceflinger by the Huawei one but to make that work I depend on their libgui. Their surfaceflinger isn't the root of the issues at this point. The library is the problem. It might be more easy to fix that instead the problem where XePeleato is digging. At least as a non c/cpp dev. This graphical subsystem looks quite complex to me and I'm glad someone is investigating there.

btw I tried to run surfaceflinger with an addidional custom library path with the vendor version of libgui in it as well as running it with ld_preload. It results in eighter a device freeze or system.server crash.