In order to save redundancy with initializing empty fields with NULL / 0
values and improve readability of the Vulkan code.
This patch also uses struct initializers where possible.
This essentially reverts 1eae45212e.
Since there currently is no Vulkan extension that takes XCB handles to
aqcuire the display Xlib interop needs to be used.
Before this patch Monado was opening connections for both APIs, which
introduced overhead.
Even though all XCB handles can be casted to Xlib ones, this cannot be
done with the main xcb_connection_t / Display. In it's design the
interop between both APIs can create a xcb_connection_t from a XCB
handle, but not the other way round. So in an interop case the Xlib
connection is the main one, since it's on a higher level.
More information on this can be found here:
https://xcb.freedesktop.org/MixingCalls/
Unfortunately the clean solution for this would be to specify a Vulkan
extension that takes XCB handles. This would make sense since Vulkan
is aware of XCB in other parts of the API as well. In Mesa the Xlib
structs will be ultimately casted to XCB.
According the XCB documentation the reply structs must be freed. I found
this when running a minimal example related to the direct mode code in
valgrind.
This allows the data to be safely shared and passed around, even allowing us
to tag frames with the data and passed around that way instead.
Since it now can be passed around more safely make the prober call the save
function instead of the calibration code. This then forms a basis for further
work where we can hook this up into a more proper configuration file.
The previous two call helper macro copied the entire input struct to output struct.
In particular this did not keep the .type and .next fields intact.
Rather than trying to keep those intact, each struct type should have its own fill function,
only filling in the data we actually want to fill in.
Features:
* draws 6 level lines with labels
* draws a line for a reference timing
* reference timing can be bottom of the graph, or center
* range around (up from) the reference timing can be specified
* optional automatic rescaling of the graph