compositor-drm: Use GBM modifier API
authorDaniel Stone <daniels@collabora.com>
Fri, 18 Nov 2016 18:02:08 +0000 (18:02 +0000)
committerDaniel Stone <daniels@collabora.com>
Mon, 9 Jul 2018 14:39:32 +0000 (15:39 +0100)
commit244244d11b5a9168656dd613029a0feb4879aff7
treee3d33356e7e55185b1af5a8ff298c4ea64fe665a
parentf4456221db312f326dc0f16a306686d8c2f3c999
compositor-drm: Use GBM modifier API

Now that we collect information about which modifiers are supported for
KMS display, and are able to create KMS framebuffers with modifiers,
begin using the modifier-aware GBM API.

Client buffers from dmabuf already store multi-plane and modifier
information into drm_fb. Extend this to drm_fb_get_from_bo(), used for
wl_buffer, cursor, and gbm_surface buffers. wl_buffer buffers should by
convention not require modifiers. Cursor buffers must not require
modifiers, as they should be linear. Prior to this patch, GBM buffers
must have been single-planar, and able to used without explicitly naming
modifiers.

Using gbm_surface_create_with_modifiers allows us to pass the list of
modifiers acceptable to KMS for scanout to GBM, so it can allocate
multi-planar buffers or those which are otherwise only addressible with
modifiers. On platforms supporting and preferring modifiers for scanout,
this means that the gbm_bos we get from our scanout surface need to use
the extended API to query multiple planes, offsets, modifiers, etc.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Emre Ucan <eucan@de.adit-jv.com>
configure.ac
libweston/compositor-drm.c