compositor: Version the backend configuration structures
authorBryce Harrington <bryce@osg.samsung.com>
Sat, 16 Apr 2016 03:28:29 +0000 (20:28 -0700)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 18 Apr 2016 10:37:41 +0000 (13:37 +0300)
commit20b66c3004bf47ed56c1b2fc2fb4503d3fd60351
tree396d0bd73f958430ef798a30c38a1279188564fa
parente9b8a2b853d87c1cd66a1a516449eb313276af42
compositor: Version the backend configuration structures

With this struct versioning, it is possible to add new options without
breaking the ABI, as long as all additions are made to the end of a
struct and nothing existing is modified or removed.  When things are
added, the structure's size will increase, and we'll use this size as
our minor version number.  If existing things need to be changed, then
the major version, struct_version, is incremented to indicate the ABI
break.

From our call sites in main these major and minor version will be
recorded as struct_version and struct_size.  Each backend will then
verify these against its own assumptions.  So long as the backend's
struct is equal or larger than what was passed in and the major versions
are equal, we're good; but if it is larger, then this is a fatal error.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
v6:
 - Document refs for alternatives/assumptions for backend configs
v5:
 - Move the header changes to a pre-requisite patch from the drm backend

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: bring back the archive links Bryce looked up.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
src/compositor.h