NVIDIA / egl-wayland

The EGLStream-based Wayland external platform
MIT License
275 stars 43 forks source link

wayland-eglsurface: Change type of timout from EGLint -> EGLTime #112

Closed kraj closed 1 week ago

kraj commented 2 weeks ago

This seems to be the appropriate type representation for timeout, moreover it also fixes an error with newer compilers where it complains about type mismatch between EGLint and EGL_FOREVER because EGL_FOREVER is defined as 0xFFFFFFFFFFFFFFFFull which is unsinged long long.

Fixes | ../git/src/wayland-eglsurface.c:1591:62: error: implicit conversion from 'unsigned long long' to 'EGLint' (aka 'int') changes value from 18446744073709551615 to -1 [-Werror,] | 1591 | EGLint timeout = surface->wlSyncobjSurf ? EGL_FOREVER : 0; | | ~~~ ^~~ | /mnt/b/yoe/master/build/tmp/work/armv8a-yoe-linux/egl-wayland/1.1.13+git/recipe-sysroot/usr/include/EGL/egl.h:293:43: note: expanded from macro 'EGL_FOREVER' | 293 | #define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull | | ^~~~~ | 1 error generated.

amshafer commented 2 weeks ago

Thanks, this looks good to me and better matches what eglQueryStreamConsumerEvent accepts.

Out of curiosity what environment did you see the compilation errors on? Primarily interested in the distro (Yocto?) and compiler version.

kraj commented 2 weeks ago

Thanks, this looks good to me and better matches what eglQueryStreamConsumerEvent accepts.

Out of curiosity what environment did you see the compilation errors on? Primarily interested in the distro (Yocto?) and compiler version.

@amshafer yes its yocto based distribution (https://github.com/yoedistro/yoe-distro ) building orin-nano based system https://github.com/YoeDistro/yoe-distro/tree/master/conf/projects/jetson-orin-nano-devkit, Yoe distro defaults to llvm/clang + compiler-rt + libc++ for C/C++ runtime, Right now default uses clang 18.1 but locally using latest master of llvm (I hack on llvm too) thats where I discovered it, perhaps I will see it with 18.1 as well, but I have not done that build for orin-nano lately.