Skip to content
  • Daniel Stone's avatar
    compositor-drm: Use GBM modifier API · 244244d1
    Daniel Stone authored
    
    
    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: default avatarDaniel Stone <daniels@collabora.com>
    Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    Tested-by: default avatarEmre Ucan <eucan@de.adit-jv.com>
    244244d1