Closed mbernat closed 10 months ago
Minor update on my crash: looking at strace, it happens at program shutdown, which probably means I have to add some manual cleanup and/or fix one of the dozen other issues with this code :smile:
ioctl(5, DRM_IOCTL_NOUVEAU_GEM_NEW, 0x7ffc3a9c3b30) = 0
ioctl(5, DRM_IOCTL_NOUVEAU_GEM_PUSHBUF, 0x7ffc3a9c3bf0) = 0
ioctl(5, DRM_IOCTL_PRIME_HANDLE_TO_FD, 0x7ffc3a9c3dbc) = 0
close(7) = 0
ioctl(3, DRM_IOCTL_MODE_ADDFB, 0x7ffc3a9c3ed0) = 0
ioctl(3, DRM_IOCTL_MODE_SETCRTC, 0x7ffc3a9c3ba8) = 0
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=3, tv_nsec=0}, 0x7ffc3a9c41c0) = 0
getpid() = 18543
getpid() = 18543
ioctl(5, DRM_IOCTL_NOUVEAU_GEM_NEW, 0x7ffc3a9c3bd0) = 0
ioctl(5, DRM_IOCTL_NOUVEAU_GEM_PUSHBUF, 0x7ffc3a9c3c90) = -1 EINVAL (Invalid argument)
write(2, "nouveau: kernel rejected pushbuf"..., 51nouveau: kernel rejected pushbuf: Invalid argument
So, turns out you're supposed to restore the original frame buffer at the end of your program.
This both fixes my crash and also makes shutdown faster.
Resolves #3
This PR adds glutin initialization, simple frame drawing and presentation. And a bit of code organization, although it's too early to abstract things properly and everything feels ad-hoc / random.
It's full of TODOs, some of which should probably be resolved in this PR. But I'd like to get some eyes on the code anyway and also see if people can actually run this.
This code also crashes, so it's not ready for merging. I hope I'll be able to resolve the crash in parallel with the reviews.