While this week was also busy, I still have managed to get some work done.
This week, my goal was to get weston to run when there are no outputs present. Fixing this mostly required adding a couple of null pointer checks to prevent weston from crashing.
However, this also introduced some problems. When an output is NULL, weston subsurfaces don't get mapped correctly. Currently, the code for configuring a subsurface will assert when the output list is null and that leads weston to a crash.
Pekka pointed out in order to solve this, I need to fix mapping functions not to rely on an output member, which I will be working on in the following days.
Also, attaching an EGL or DMABUF will result in a crash when no outputs are present. I have tracked this down to a call to image_target_texture_2d. This might be a bug in Mesa's EGL implementation. So far, I've made the function abort attaching in case there are no outputs, but I need to find a way to reattach it when an output appears. Otherwise, nothing gets displayed.
With the fixes from above, minus the problems mentioned, weston seems to handle zero outputs nicely. I have tested all of the weston demo apps and they start with no outputs present and get displayed correctly when an output gets attached.
My goal for the next week is to fix all of the issues mentioned above and make weston behave correctly when an output gets removed at runtime.