mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
Add wl_output globals for wlr_outputs
This commit is contained in:
parent
5055d89955
commit
168f0955ab
8 changed files with 87 additions and 7 deletions
|
|
@ -118,6 +118,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
|
|||
state->drm_invalidated.notify = drm_invalidated;
|
||||
wlr_udev_signal_add(udev, state->dev, &state->drm_invalidated);
|
||||
|
||||
state->display = display;
|
||||
struct wl_event_loop *event_loop = wl_display_get_event_loop(display);
|
||||
|
||||
state->drm_event = wl_event_loop_add_fd(event_loop, state->fd,
|
||||
|
|
|
|||
|
|
@ -564,6 +564,7 @@ void wlr_drm_scan_connectors(struct wlr_backend_state *state) {
|
|||
|
||||
scan_property_ids(state->fd, conn, output);
|
||||
|
||||
wlr_output_create_global(wlr_output, state->display);
|
||||
list_add(state->outputs, output);
|
||||
wlr_log(L_INFO, "Found display '%s'", wlr_output->name);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ static bool egl_get_config(EGLDisplay disp, EGLConfig *out, EGLenum platform) {
|
|||
for (int i = 0; i < matched; ++i) {
|
||||
EGLint gbm_format;
|
||||
|
||||
if(platform == EGL_PLATFORM_WAYLAND_EXT) {
|
||||
if (platform == EGL_PLATFORM_WAYLAND_EXT) {
|
||||
*out = configs[i];
|
||||
return true;
|
||||
}
|
||||
|
|
@ -99,8 +99,6 @@ static bool egl_get_config(EGLDisplay disp, EGLConfig *out, EGLenum platform) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// XXX: Is GBM_FORMAT_XRGB8888 what we want?
|
||||
// I don't know if this works for wl_displays.
|
||||
if (gbm_format == GBM_FORMAT_XRGB8888) {
|
||||
*out = configs[i];
|
||||
return true;
|
||||
|
|
@ -111,7 +109,6 @@ static bool egl_get_config(EGLDisplay disp, EGLConfig *out, EGLenum platform) {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *display) {
|
||||
if (!egl_exts()) {
|
||||
return false;
|
||||
|
|
@ -155,14 +152,12 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *display) {
|
|||
EGL_EXTENSIONS));
|
||||
wlr_log(L_INFO, "Using %s", glGetString(GL_VERSION));
|
||||
wlr_log(L_INFO, "Supported OpenGL ES extensions: %s", glGetString(GL_EXTENSIONS));
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
eglTerminate(egl->display);
|
||||
eglReleaseThread();
|
||||
eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -180,6 +175,5 @@ EGLSurface wlr_egl_create_surface(struct wlr_egl *egl, void *window) {
|
|||
wlr_log(L_ERROR, "Failed to create EGL surface: %s", egl_error());
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
return surf;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *_backend) {
|
|||
return false;
|
||||
}
|
||||
|
||||
wlr_output_create_global(wlr_output, backend->local_display);
|
||||
list_add(backend->outputs, wlr_output);
|
||||
wl_signal_emit(&backend->backend->events.output_add, wlr_output);
|
||||
return wlr_output;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue