Skip to content

Commit

Permalink
Port to wlroots 0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Nov 22, 2023
1 parent d1b7efd commit 4a067fb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/drm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 7 additions & 3 deletions src/rendervulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/wlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion subprojects/wlroots
Submodule wlroots updated from 1712a7 to 767eed

0 comments on commit 4a067fb

Please sign in to comment.