Port to wlroots 0.17

This commit is contained in:
Simon Ser 2022-11-23 11:52:14 +01:00
parent d1b7efd218
commit 4a067fb4eb
5 changed files with 14 additions and 10 deletions

View file

@ -233,7 +233,7 @@ static uint32_t pick_plane_format( const struct wlr_drm_format_set *formats, uin
{
uint32_t result = DRM_FORMAT_INVALID;
for ( size_t i = 0; i < formats->len; i++ ) {
uint32_t fmt = formats->formats[i]->format;
uint32_t fmt = formats->formats[i].format;
if ( fmt == Xformat ) {
// Prefer formats without alpha channel for main plane
result = fmt;

View file

@ -22,9 +22,9 @@ stb_dep = dependency('stb')
wlroots_dep = dependency(
'wlroots',
version: ['>= 0.16.0', '< 0.17.0'],
version: ['>= 0.17.0', '< 0.18.0'],
fallback: ['wlroots', 'wlroots'],
default_options: ['default_library=static', 'examples=false', 'xwayland=enabled', 'backends=libinput', 'renderers=[]', 'allocators=[]'],
default_options: ['default_library=static', 'examples=false', 'xwayland=enabled', 'backends=libinput', 'renderers=[]', 'allocators=[]', 'session=enabled'],
)
displayinfo_dep = dependency(

View file

@ -12,6 +12,10 @@
#include <thread>
#include <vulkan/vulkan_core.h>
#if defined(__linux__)
#include <sys/sysmacros.h>
#endif
// Used to remove the config struct alignment specified by the NIS header
#define NIS_ALIGNED(x)
// NIS_Config needs to be included before the X11 headers because of conflicting defines introduced by X11
@ -2554,7 +2558,7 @@ bool vulkan_init_formats()
vk_log.infof( "supported DRM formats for sampling usage:" );
for ( size_t i = 0; i < sampledDRMFormats.len; i++ )
{
uint32_t fmt = sampledDRMFormats.formats[ i ]->format;
uint32_t fmt = sampledDRMFormats.formats[ i ].format;
char *name = drmGetFormatName(fmt);
vk_log.infof( " %s (0x%" PRIX32 ")", name, fmt );
free(name);
@ -3889,7 +3893,7 @@ static uint32_t renderer_get_render_buffer_caps( struct wlr_renderer *renderer )
return 0;
}
static void renderer_begin( struct wlr_renderer *renderer, uint32_t width, uint32_t height )
static bool renderer_begin( struct wlr_renderer *renderer, uint32_t width, uint32_t height )
{
abort(); // unreachable
}
@ -3939,7 +3943,7 @@ static int renderer_get_drm_fd( struct wlr_renderer *wlr_renderer )
static struct wlr_texture *renderer_texture_from_buffer( struct wlr_renderer *wlr_renderer, struct wlr_buffer *buf )
{
VulkanWlrTexture_t *tex = new VulkanWlrTexture_t();
wlr_texture_init( &tex->base, &texture_impl, buf->width, buf->height );
wlr_texture_init( &tex->base, wlr_renderer, &texture_impl, buf->width, buf->height );
tex->buf = wlr_buffer_lock( buf );
// TODO: check format/modifier
// TODO: if DMA-BUF, try importing it into Vulkan

View file

@ -1381,9 +1381,9 @@ void xdg_surface_new(struct wl_listener *listener, void *data)
wlserver_surface->xdg_surface = xdg_surface_info;
xdg_surface_info->map.notify = xdg_toplevel_map;
wl_signal_add(&xdg_surface->events.map, &xdg_surface_info->map);
wl_signal_add(&xdg_surface->surface->events.map, &xdg_surface_info->map);
xdg_surface_info->unmap.notify = xdg_toplevel_unmap;
wl_signal_add(&xdg_surface->events.unmap, &xdg_surface_info->unmap);
wl_signal_add(&xdg_surface->surface->events.unmap, &xdg_surface_info->unmap);
xdg_surface_info->destroy.notify = xdg_toplevel_destroy;
wl_signal_add(&xdg_surface->events.destroy, &xdg_surface_info->destroy);
@ -1441,7 +1441,7 @@ bool wlserver_init( void ) {
wlr_renderer_init_wl_display(wlserver.wlr.renderer, wlserver.display);
wlserver.wlr.compositor = wlr_compositor_create(wlserver.display, wlserver.wlr.renderer);
wlserver.wlr.compositor = wlr_compositor_create(wlserver.display, 5, wlserver.wlr.renderer);
wl_signal_add( &wlserver.wlr.compositor->events.new_surface, &new_surface_listener );

@ -1 +1 @@
Subproject commit 1712a7d27444d62f8da8eeedf0840b386a810e96
Subproject commit 767eedd3cbe9900687bf3b82236320dcd7b77aae