Consistently use drmModeAddFB2 in native backend
KMS offers multiple APIs to create a framebuffer from a GEM buffer. drmModeAddFB() infers the format from the depth and bpp, e.g. depth 24 + bpp 32 -> DRM_FORMAT_XRGB8888
.
drmModeAddFB2
and drmModeAddFBWithModifiers
both allow passing the format explicitly. These are used in the EGL/GBM paths, but the dumb-buffer path still uses the legacy API. Having these be consistent would be nice. This also prevents a possible future trap: Nouveau always mapped depth 30 + bpp 32 to DRM_FORMAT_XBGR8888
, rather than the RGB everyone else uses. Being explicit about the format everywhere (cf. #2 (closed)) avoids this.
Edited by Daniel Stone