compositor/main: Re-work plug-in loading to avoid an invalid color manager

Rather than loading the plug-ins when loading the DRM backend, do that
after *all* the other backends have been loaded, and after we made sure
we have at least a no-op color manager.

As the plug-ins enable the outputs on their own this has the side-effect
of enabling the output without having any color manager set-up at that
time.  Moving the plug-in loading a bit later ensures that we have one
set-up (a no-op one).

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2023-10-12 15:20:25 +03:00
parent 4d633dd0b2
commit df493400c1

View File

@ -149,6 +149,7 @@ struct wet_compositor {
pid_t autolaunch_pid;
bool autolaunch_watch;
bool use_color_manager;
bool drm_backend_loaded;
struct wl_listener screenshot_auth;
enum require_outputs require_outputs;
};
@ -158,6 +159,12 @@ static struct weston_log_scope *log_scope;
static struct weston_log_scope *protocol_scope;
static int cached_tm_mday = -1;
static void
load_remoting(struct weston_compositor *c, struct weston_config *wc);
static void
load_pipewire(struct weston_compositor *c, struct weston_config *wc);
static void
custom_handler(const char *fmt, va_list arg)
{
@ -1030,6 +1037,15 @@ load_modules(struct weston_compositor *ec, const char *modules,
return 0;
}
static void
load_additional_modules(struct wet_compositor wet)
{
if (wet.drm_backend_loaded) {
load_remoting(wet.compositor, wet.config);
load_pipewire(wet.compositor, wet.config);
}
}
static int
save_touch_device_calibration(struct weston_compositor *compositor,
struct weston_touch_device *device,
@ -3054,11 +3070,8 @@ load_drm_backend(struct weston_compositor *c, int *argc, char **argv,
if (!wb)
return -1;
/* remoting */
load_remoting(c, wc);
/* pipewire */
load_pipewire(c, wc);
wet->drm_backend_loaded = true;
free(config.gbm_format);
free(config.seat_id);
@ -4256,6 +4269,8 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data)
goto out;
}
load_additional_modules(wet);
weston_compositor_flush_heads_changed(wet.compositor);
if (wet.init_failed)
goto out;