diff --git a/repos/libports/lib/mk/egl_i965.mk b/repos/libports/lib/mk/egl_i965.mk index d43a14c489..40f145d174 100644 --- a/repos/libports/lib/mk/egl_i965.mk +++ b/repos/libports/lib/mk/egl_i965.mk @@ -1,5 +1,5 @@ SHARED_LIB = yes -LIBS = libc egl i965 +LIBS = libc egl i965 pthread include $(REP_DIR)/lib/mk/mesa-common.inc diff --git a/repos/libports/src/lib/mesa/egl/genode_interface.cc b/repos/libports/src/lib/mesa/egl/genode_interface.cc index f40ac2f1f1..2eca6159c4 100644 --- a/repos/libports/src/lib/mesa/egl/genode_interface.cc +++ b/repos/libports/src/lib/mesa/egl/genode_interface.cc @@ -14,24 +14,13 @@ /* needed since there exists a 'util/list.h' in mesa */ #include <../include/util/list.h> #include -#include - #include extern "C" { #include } - -void genode_framebuffer_refresh(Genode_egl_window *win, int x, int y, int w, int h) -{ - Window *window = static_cast(win); - window->framebuffer->refresh(x, y, w, h); -} - - void genode_blit(void const *src, unsigned src_w, void *dst, unsigned dst_w, int w, int h) { blit(src, src_w, dst, dst_w, w, h); } - diff --git a/repos/libports/src/lib/mesa/egl/platform.c b/repos/libports/src/lib/mesa/egl/platform.c index d4c32cd021..843ac2e503 100644 --- a/repos/libports/src/lib/mesa/egl/platform.c +++ b/repos/libports/src/lib/mesa/egl/platform.c @@ -80,7 +80,6 @@ _create_surface(_EGLDriver *drv, _EGLDisplay *disp, dri2_surf->base.Width = window->width;; dri2_surf->base.Height = window->height; - config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT, dri2_surf->base.GLColorspace); diff --git a/repos/libports/src/lib/mesa/i965/drm_init.cc b/repos/libports/src/lib/mesa/i965/drm_init.cc index 01a640851c..67368267db 100644 --- a/repos/libports/src/lib/mesa/i965/drm_init.cc +++ b/repos/libports/src/lib/mesa/i965/drm_init.cc @@ -18,9 +18,17 @@ extern "C" { #include } -extern void drm_init(Genode::Env &env); +extern Genode::Entrypoint &genode_entrypoint(); +extern void drm_init(Genode::Env &env, Genode::Entrypoint &ep); void genode_drm_init() { - drm_init(*genode_env); + drm_init(*genode_env, genode_entrypoint()); +} + +extern void drm_complete(); + +void genode_drm_complete() +{ + drm_complete(); } diff --git a/repos/libports/src/lib/mesa/i965/platform_i965.c b/repos/libports/src/lib/mesa/i965/platform_i965.c index 5eda2b7ced..f5b36dfb03 100644 --- a/repos/libports/src/lib/mesa/i965/platform_i965.c +++ b/repos/libports/src/lib/mesa/i965/platform_i965.c @@ -67,8 +67,6 @@ dri2_genode_put_image(__DRIdrawable * draw, int op, (char *)dst, data, dst_stride, src_stride, false, 1, memcpy); - - genode_framebuffer_refresh(window, x, y, w, h); } @@ -77,6 +75,8 @@ dri2_genode_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw) { struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw); + genode_drm_complete(); + void *data = genode_map_image(dri2_surf->back_image); dri2_genode_put_image(dri2_surf->dri_drawable, 0, 0, 0, dri2_surf->base.Width, dri2_surf->base.Height, @@ -84,7 +84,6 @@ dri2_genode_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw) genode_unmap_image(dri2_surf->back_image); - return EGL_TRUE; } @@ -254,4 +253,3 @@ cleanup_dpy: return EGL_FALSE; } - diff --git a/repos/libports/src/lib/mesa/include/platform.h b/repos/libports/src/lib/mesa/include/platform.h index a8c53ea4cf..93ffc2c08a 100644 --- a/repos/libports/src/lib/mesa/include/platform.h +++ b/repos/libports/src/lib/mesa/include/platform.h @@ -15,15 +15,16 @@ #define _PLATFORM_H_ #ifdef __cplusplus +namespace Genode { class Env; } extern Genode::Env *genode_env; #endif #include struct Genode_egl_window; -void genode_framebuffer_refresh(struct Genode_egl_window *win, int x, int y, int w, int h); void genode_blit(void const *src, unsigned src_w, void *dst, unsigned dst_w, int w, int h); void genode_drm_init(); +void genode_drm_complete(); struct _EGLSurface; struct _EGLDriver; diff --git a/repos/libports/src/lib/mesa/include/window.h b/repos/libports/src/lib/mesa/include/window.h deleted file mode 100644 index 4c90637d15..0000000000 --- a/repos/libports/src/lib/mesa/include/window.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * \brief EGL window with framebuffer connection - * \author Sebastian Sumpf - * \date 2017-08-17 - */ - -/* - * Copyright (C) 2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -#ifndef _WINDOW_H_ -#define _WINDOW_H_ - -#include -#include -#include -#include - -#include - -struct Window : Genode_egl_window -{ - Genode::Constructible framebuffer; - Genode::Io_signal_handler sync_dispatcher; - Genode::Io_signal_handler mode_dispatcher; - Genode::Env &env; - - Window(Genode::Env &env, int w, int h) - : - sync_dispatcher(env.ep(), *this, &Window::sync_handler), - mode_dispatcher(env.ep(), *this, &Window::mode_handler), - env(env) - { - width = w; - height = h; - - framebuffer.construct(env, Framebuffer::Mode(width, height, Framebuffer::Mode::RGB565)); - addr = env.rm().attach(framebuffer->dataspace()); - - framebuffer->sync_sigh(sync_dispatcher); - framebuffer->mode_sigh(mode_dispatcher); - - mode_handler(); - } - - void sync_handler(); - void mode_handler(); - - void update() - { - env.rm().detach(addr); - addr = env.rm().attach(framebuffer->dataspace()); - } -}; - -#endif /* _WINDOW_H_ */ diff --git a/repos/libports/src/lib/mesa/swrast/platform_swrast.c b/repos/libports/src/lib/mesa/swrast/platform_swrast.c index 98ad8415d0..4b70e17920 100644 --- a/repos/libports/src/lib/mesa/swrast/platform_swrast.c +++ b/repos/libports/src/lib/mesa/swrast/platform_swrast.c @@ -124,9 +124,6 @@ dri2_genode_swrast_put_image(__DRIdrawable * draw, int op, /* copy to frame buffer and refresh */ genode_blit(data, src_stride, dst, dst_stride, copy_width, h); - - if (window->type == WINDOW) - genode_framebuffer_refresh(window, x, y, w, h); } @@ -138,10 +135,16 @@ dri2_genode_swrast_get_drawable_info(__DRIdrawable * draw, struct dri2_egl_surface *dri2_surf = loaderPrivate; //XXX: (void) swrast_update_buffers(dri2_surf); + struct Genode_egl_window *window = dri2_surf->g_win; + *x = 0; *y = 0; - *w = dri2_surf->base.Width; - *h = dri2_surf->base.Height; + *w = window->width; + *h = window->height; + + dri2_surf->base.Width = window->width; + dri2_surf->base.Height = window->height; + }