So, this is going to segfault all over the place on mesa. get_graphics_region returns NULL for hardware buffers there, as they can't be mmapped.
It's *probably* fine to just unconditionally throw a logic_error from Buffer::read() and Buffer::write()? (Leading to the obvious question: why are those methods there? GBMBuffer unconditionally throws if either are called)
If we need stride elsewhere (for GL import?) we should indeed add that as an mir_buffer_get_stride() accessor.
So, this is going to segfault all over the place on mesa. get_graphics_region returns NULL for hardware buffers there, as they can't be mmapped.
It's *probably* fine to just unconditionally throw a logic_error from Buffer::read() and Buffer::write()? (Leading to the obvious question: why are those methods there? GBMBuffer unconditionally throws if either are called)
If we need stride elsewhere (for GL import?) we should indeed add that as an mir_buffer_ get_stride( ) accessor.