Skip to content
  • Giulio Camuffo's avatar
    drm: port the drm backend to the new init api · 1c0e40d9
    Giulio Camuffo authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    
    Preparing for libweston and for the separation of the code base into
    libweston vs. weston the compositor, we must remove all uses
    weston_config structures from the backends. We have decided that all
    option and config input happens in the compositor (main.c), and
    configuration is passed in for the backends as structs.
    
    Most other backends have already converted, and this patch converts the
    DRM-backend to the libweston-style init API.
    
    The libweston-style init API includes a header for each backend (here
    compositor-drm.h) defining the configuration interface. The compositor
    (main.c) prepares a configuration struct to be passed through libweston
    core to the backend during initialization.
    
    A complication with the DRM-backend is that outputs can be hotplugged,
    and their configuration needs to be fetched from the compositor
    (main.c). For this, the config struct contains a callback member. The
    output configuration API is subject to change later, this is just a
    temporary API to get libweston forward.
    
    As weston_compositor's user_data was not previously used for anything,
    and the output configuration callback needs data, the user_data is set
    to the 'config' pointer. This pointer is only used in
    drm_configure_output() in main.c.
    
    [Bryce: lots of stuff and rebasing]
    Signed-off-by: default avatarBryce Harrington <bryce@osg.samsung.com>
    Reviewed-by: default avatarQuentin Glidic <sardemff7+git@sardemff7.net>
    Acked-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    Tested-by: default avatarBenoit Gschwind <gschwind@gnu-log.net>
    [Pekka: write commit message]
    [Pekka: squash in "drm: Don't hang onto the backend config object
    post-backend_init" from Bryce Harrington]
    [Pekka: drop the compositor.h hunk]
    [Pekka: do not #include inside extern "C"]
    [Pekka: remove incorrect comment about weston_drm_backend_config
    ownership.]
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    1c0e40d9