Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package wayland-utils for openSUSE:Factory checked in at 2023-06-09 20:37:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/wayland-utils (Old) and /work/SRC/openSUSE:Factory/.wayland-utils.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "wayland-utils" Fri Jun 9 20:37:08 2023 rev:3 rq:1091448 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/wayland-utils/wayland-utils.changes 2022-12-07 17:35:55.908856756 +0100 +++ /work/SRC/openSUSE:Factory/.wayland-utils.new.15902/wayland-utils.changes 2023-06-09 20:38:14.378833645 +0200 @@ -1,0 +2,11 @@ +Thu Jun 8 12:53:42 UTC 2023 - Jan Engelhardt <[email protected]> + +- Update to release 1.2.0 + * Support for the drm-lease-v1 protocol. + * Improved linux_dmabuf v4 report now prints the DRM device + paths. + * Restored support for older versions (< 3) of linux_dmabuf. + * New command line option to restrict queries to specific + interfaces. + +------------------------------------------------------------------- Old: ---- wayland-utils-1.1.0.tar.xz wayland-utils-1.1.0.tar.xz.sig New: ---- wayland-utils-1.2.0.tar.xz wayland-utils-1.2.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ wayland-utils.spec ++++++ --- /var/tmp/diff_new_pack.tinl6V/_old 2023-06-09 20:38:15.102837849 +0200 +++ /var/tmp/diff_new_pack.tinl6V/_new 2023-06-09 20:38:15.106837873 +0200 @@ -1,7 +1,7 @@ # # spec file for package wayland-utils # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: wayland-utils -Version: 1.1.0 +Version: 1.2.0 Release: 0 Summary: Wayland diagnostic utilities License: MIT ++++++ wayland-utils-1.1.0.tar.xz -> wayland-utils-1.2.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wayland-utils-1.1.0/man/wayland-info.man new/wayland-utils-1.2.0/man/wayland-info.man --- old/wayland-utils-1.1.0/man/wayland-info.man 2022-09-13 10:51:57.000000000 +0200 +++ new/wayland-utils-1.2.0/man/wayland-info.man 2023-06-08 10:38:01.000000000 +0200 @@ -3,6 +3,7 @@ wayland-info \- display information utility for Wayland .SH SYNOPSIS .B wayland-info +[option ...] . .\" *************************************************************** .SH DESCRIPTION @@ -23,7 +24,14 @@ .SH OPTIONS . .B wayland-info -does not accept any command line option. +accepts the following line options: +.TP 8 +.B \-h, \-\-help +Print a summary of command line options, and quit. +.TP 8 +.B \-i, \-\-interface \fIinterface\fR +Only print information about the Wayland globals containing the string +\fIinterface\fR in their name. . .\" *************************************************************** .SH ENVIRONMENT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wayland-utils-1.1.0/meson.build new/wayland-utils-1.2.0/meson.build --- old/wayland-utils-1.1.0/meson.build 2022-09-13 10:51:57.000000000 +0200 +++ new/wayland-utils-1.2.0/meson.build 2023-06-08 10:38:01.000000000 +0200 @@ -1,6 +1,6 @@ project('wayland-utils', 'c', - version: '1.1.0', + version: '1.2.0', default_options: [ 'warning_level=3', 'c_std=c99', @@ -18,19 +18,18 @@ pkgconfig = import('pkgconfig') cc = meson.get_compiler('c') -cflags = ['-Wno-unused-parameter'] -add_project_arguments(cflags, language: 'c') +add_project_arguments(cc.get_supported_arguments([ + '-Wundef', + '-Wno-unused-parameter', +]), language: 'c') dep_wayland_client = dependency('wayland-client', version: '>= 1.20.0') -dep_libdrm = dependency('libdrm', required: get_option('drm')) +dep_libdrm = dependency('libdrm', version: '>=2.4.109', required: get_option('drm')) dep_libdrm_version = dep_libdrm.version() config_h = configuration_data() config_h.set('_POSIX_C_SOURCE', '200809L') -if dep_libdrm_version.version_compare('>=2.4.107') - message('Found libdrm with human format modifier support.') - config_h.set('HAVE_HUMAN_FORMAT_MODIFIER', '1') -endif +config_h.set('HAVE_LIBDRM', dep_libdrm.found().to_int()) configure_file(output: 'config.h', configuration: config_h) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wayland-utils-1.1.0/wayland-info/meson.build new/wayland-utils-1.2.0/wayland-info/meson.build --- old/wayland-utils-1.1.0/wayland-info/meson.build 2022-09-13 10:51:57.000000000 +0200 +++ new/wayland-utils-1.2.0/wayland-info/meson.build 2023-06-08 10:38:01.000000000 +0200 @@ -4,25 +4,22 @@ dep_wp = dependency('wayland-protocols', version: '>= 1.24') dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir') -generated_protocols = [ - [ 'linux-dmabuf', 'v1' ], - [ 'presentation-time', 'stable' ], - [ 'tablet', 'v2' ], - [ 'xdg-output', 'v1' ], -] +generated_protocols = { + # stable + 'presentation-time': dir_wp_base / 'stable/presentation-time/presentation-time.xml', -generated_protocols_sources = [] + # staging + 'drm-lease-v1': dir_wp_base / 'staging/drm-lease/drm-lease-v1.xml', + + # unstable + 'linux-dmabuf-unstable-v1': dir_wp_base / 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml', + 'tablet-unstable-v2': dir_wp_base / 'unstable/tablet/tablet-unstable-v2.xml', + 'xdg-output-unstable-v1': dir_wp_base / 'unstable/xdg-output/xdg-output-unstable-v1.xml', +} -foreach proto: generated_protocols - proto_name = proto[0] - if proto[1] == 'stable' - base_file = proto_name - xml_path = '@0@/stable/@1@/@[email protected]'.format(dir_wp_base, proto_name, base_file) - else - base_file = '@0@-unstable-@1@'.format(proto_name, proto[1]) - xml_path = '@0@/unstable/@1@/@[email protected]'.format(dir_wp_base, proto_name, base_file) - endif +generated_protocols_sources = [] +foreach base_file, xml_path: generated_protocols foreach output_type: [ 'client-header', 'private-code' ] if output_type == 'client-header' output_file = '@[email protected]'.format(base_file) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wayland-utils-1.1.0/wayland-info/wayland-info.c new/wayland-utils-1.2.0/wayland-info/wayland-info.c --- old/wayland-utils-1.1.0/wayland-info/wayland-info.c 2022-09-13 10:51:57.000000000 +0200 +++ new/wayland-utils-1.2.0/wayland-info/wayland-info.c 2023-06-08 10:38:01.000000000 +0200 @@ -34,14 +34,16 @@ #include <ctype.h> #include <unistd.h> #include <sys/mman.h> +#include <sys/types.h> #include <wayland-client.h> -#if HAVE_HUMAN_FORMAT_MODIFIER -#include "xf86drm.h" -#include "drm_fourcc.h" +#if HAVE_LIBDRM +#include <xf86drm.h> +#include <drm_fourcc.h> #endif #include "presentation-time-client-protocol.h" +#include "drm-lease-v1-client-protocol.h" #include "linux-dmabuf-unstable-v1-client-protocol.h" #include "tablet-unstable-v2-client-protocol.h" #include "xdg-output-unstable-v1-client-protocol.h" @@ -259,9 +261,30 @@ clockid_t clk_id; }; +struct drm_lease_connector { + struct wl_list link; + + struct wp_drm_lease_connector_v1 *connector; + + uint32_t id; + char *name, *description; +}; + +struct drm_lease_device_info { + struct global_info global; + struct wl_list link; + + struct wp_drm_lease_device_v1 *device; + + char *path; + + struct wl_list connectors; +}; + struct wayland_info { struct wl_display *display; struct wl_registry *registry; + char *interface; struct wl_list infos; bool roundtrip_needed; @@ -479,13 +502,23 @@ } static void +print_format(uint32_t format) +{ + char str[5]; + + fourcc2str(format, str, sizeof(str)); + printf("0x%08x = '%s'", + format, str); +} + +static void print_format_and_modifier(uint32_t format, uint64_t modifier) { char str[5]; fourcc2str(format, str, sizeof(str)); -#if HAVE_HUMAN_FORMAT_MODIFIER +#if HAVE_LIBDRM char *name = drmGetFormatModifierName(modifier); char *vendor = drmGetFormatModifierVendor(modifier); if (!vendor) @@ -510,6 +543,34 @@ } static void +print_devid(dev_t devid) +{ + printf("0x%" PRIX64, (uint64_t) devid); + +#if HAVE_LIBDRM + drmDevice *dev = NULL; + if (drmGetDeviceFromDevId(devid, 0, &dev) != 0) { + perror("drmGetDeviceFromDevId failed"); + return; + } + + if (!(dev->available_nodes & (1 << DRM_NODE_PRIMARY))) { + /* Should never happen */ + fprintf(stderr, "Device has no primary node\n"); + return; + } + + printf(" (%s", dev->nodes[DRM_NODE_PRIMARY]); + if (dev->available_nodes & (1 << DRM_NODE_RENDER)) { + printf(" or %s", dev->nodes[DRM_NODE_RENDER]); + } + printf(")"); + + drmFreeDevice(&dev); +#endif +} + +static void print_linux_dmabuf_info(void *data) { struct linux_dmabuf_info *dmabuf = data; @@ -519,7 +580,8 @@ print_global_info(data); if (dmabuf->main_device) { - printf("\tmain device: 0x%" PRIX64, (uint64_t) dmabuf->main_device); + printf("\tmain device: "); + print_devid(dmabuf->main_device); if (dmabuf->format_map == MAP_FAILED) { printf("\tError: failed to map format table\n"); @@ -535,8 +597,8 @@ wl_list_for_each(tranche, &dmabuf->tranches, link) { printf("\n\ttranche"); - printf("\n\t\ttarget device: 0x%" PRIX64, - (uint64_t) tranche->target_device); + printf("\n\t\ttarget device: "); + print_devid(tranche->target_device); printf("\n\t\tflags: "); if (tranche->flags == 0) printf("none"); @@ -544,7 +606,7 @@ printf("scanout"); printf("\n"); -#if HAVE_HUMAN_FORMAT_MODIFIER +#if HAVE_LIBDRM printf("\t\tformats (fourcc) and modifiers (names):"); #else printf("\t\tformats (fourcc) and modifiers:"); @@ -559,8 +621,8 @@ } munmap(dmabuf->format_map, dmabuf->format_size); - } else { -#if HAVE_HUMAN_FORMAT_MODIFIER + } else if (dmabuf->global.version > 2) { +#if HAVE_LIBDRM printf("\tformats (fourcc) and modifiers (names):"); #else printf("\tformats (fourcc) and modifiers:"); @@ -570,6 +632,12 @@ printf("\n\t"); print_format_and_modifier(modifier->format, modifier->modifier); } + } else { + printf("\tformats (fourcc):"); + wl_list_for_each(modifier, &dmabuf->modifiers, link) { + printf("\n\t"); + print_format(modifier->format); + } } printf("\n"); @@ -1682,7 +1750,15 @@ static void linux_dmabuf_handle_format(void *data, struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1, uint32_t format) { - /* This is a deprecated event, donât use it. */ + struct linux_dmabuf_info *dmabuf = data; + struct linux_dmabuf_modifier *linux_dmabuf_modifier; + + if (dmabuf->global.version > 2) + return; + + linux_dmabuf_modifier = xzalloc(sizeof *linux_dmabuf_modifier); + wl_list_insert(&dmabuf->modifiers, &linux_dmabuf_modifier->link); + linux_dmabuf_modifier->format = format; } static void @@ -1719,6 +1795,9 @@ free(tranche); } + if (dmabuf->feedback) + zwp_linux_dmabuf_feedback_v1_destroy(dmabuf->feedback); + zwp_linux_dmabuf_v1_destroy(dmabuf->dmabuf); } @@ -1807,13 +1886,14 @@ wl_list_init(&dmabuf->tranches); wl_list_init(&dmabuf->modifiers); - if (version == 3) { + if (version <= 3) { dmabuf->dmabuf = wl_registry_bind(info->registry, - id, &zwp_linux_dmabuf_v1_interface, 3); + id, &zwp_linux_dmabuf_v1_interface, + MIN(version, 3)); zwp_linux_dmabuf_v1_add_listener(dmabuf->dmabuf, &linux_dmabuf_listener, dmabuf); info->roundtrip_needed = true; - } else if (version >= 4) { + } else { dmabuf->dmabuf = wl_registry_bind(info->registry, id, &zwp_linux_dmabuf_v1_interface, 4); dmabuf->feedback = zwp_linux_dmabuf_v1_get_default_feedback(dmabuf->dmabuf); @@ -2030,7 +2110,160 @@ } static void -destroy_global_info(void *data) +drm_lease_connector_name(void *data, + struct wp_drm_lease_connector_v1 *connector, const char *name) +{ + struct drm_lease_connector *con = data; + con->name = strdup(name); +} + +static void +drm_lease_connector_description(void *data, + struct wp_drm_lease_connector_v1 *connector, const char *desc) +{ + struct drm_lease_connector *con = data; + con->description = strdup(desc); +} + +static void +drm_lease_connector_id(void *data, struct wp_drm_lease_connector_v1 *connector, + uint32_t id) +{ + struct drm_lease_connector *con = data; + con->id = id; +} + +static void +drm_lease_connector_done(void *data, + struct wp_drm_lease_connector_v1 *connector) +{ + /* no-op */ +} + +static void +drm_lease_connector_withdrawn(void *data, + struct wp_drm_lease_connector_v1 *connector) +{ + /* no-op */ +} + +static const struct wp_drm_lease_connector_v1_listener drm_lease_connector_listener = { + .name = drm_lease_connector_name, + .description = drm_lease_connector_description, + .connector_id = drm_lease_connector_id, + .done = drm_lease_connector_done, + .withdrawn = drm_lease_connector_withdrawn, +}; + +static void +drm_lease_device_drm_fd(void *data, struct wp_drm_lease_device_v1 *device, + int32_t fd) +{ + struct drm_lease_device_info *dev = data; +#if HAVE_LIBDRM + dev->path = drmGetDeviceNameFromFd(fd); +#else + dev->path = NULL; +#endif + close(fd); +} + +static void +drm_lease_device_connector(void *data, struct wp_drm_lease_device_v1 *device, + struct wp_drm_lease_connector_v1 *connector) +{ + struct drm_lease_device_info *dev = data; + + struct drm_lease_connector *conn = xzalloc(sizeof *conn); + + conn->connector = connector; + + wp_drm_lease_connector_v1_add_listener(connector, + &drm_lease_connector_listener, conn); + + wl_list_insert(&dev->connectors, &conn->link); +} + +static void +drm_lease_device_done(void *data, struct wp_drm_lease_device_v1 *device) +{ + /* no-op */ +} + +static void +drm_lease_device_released(void *data, struct wp_drm_lease_device_v1 *device) +{ + /* no-op */ +} + +static const struct wp_drm_lease_device_v1_listener drm_lease_device_listener = { + .drm_fd = drm_lease_device_drm_fd, + .connector = drm_lease_device_connector, + .done = drm_lease_device_done, + .released = drm_lease_device_released, +}; + +static void +destroy_drm_lease_device_info(void *info) +{ + struct drm_lease_device_info *dev = info; + + free(dev->path); + + wp_drm_lease_device_v1_destroy(dev->device); + + struct drm_lease_connector *conn, *tmp; + wl_list_for_each_safe(conn, tmp, &dev->connectors, link) { + wl_list_remove(&conn->link); + + wp_drm_lease_connector_v1_destroy(conn->connector); + + free(conn->name); + free(conn->description); + free(conn); + } +} + +static void +print_drm_lease_device_info(void *info) +{ + print_global_info(info); + struct drm_lease_device_info *dev = info; + + printf("\tpath: %s\n", dev->path); + + struct drm_lease_connector *conn; + wl_list_for_each(conn, &dev->connectors, link) { + printf("\tconnector:\n"); + printf("\t\tid: %u\n", conn->id); + printf("\t\tname: %s\n", conn->name); + printf("\t\tdescription: %s\n", conn->description); + } +} + +static void +add_drm_lease_device_v1_info(struct wayland_info *info, uint32_t id, + uint32_t version) +{ + struct drm_lease_device_info *dev = xzalloc(sizeof *dev); + + init_global_info(info, &dev->global, id, + wp_drm_lease_device_v1_interface.name, version); + dev->global.print = print_drm_lease_device_info; + dev->global.destroy = destroy_drm_lease_device_info; + + dev->device = wl_registry_bind(info->registry, id, + &wp_drm_lease_device_v1_interface, 1); + wp_drm_lease_device_v1_add_listener(dev->device, + &drm_lease_device_listener, dev); + + wl_list_init(&dev->connectors); + + info->roundtrip_needed = true; +} + +static void +destroy_global_info(void *info) { } @@ -2065,6 +2298,8 @@ add_tablet_v2_info(info, id, version); else if (!strcmp(interface, zxdg_output_manager_v1_interface.name)) add_xdg_output_manager_v1_info(info, id, version); + else if (!strcmp(interface, wp_drm_lease_device_v1_interface.name)) + add_drm_lease_device_v1_info(info, id, version); else add_global_info(info, id, interface, version); } @@ -2079,13 +2314,22 @@ global_remove_handler }; +static bool +should_print_info(struct wayland_info *wayland_info, struct global_info *global) +{ + return !wayland_info->interface || + strstr(global->interface, wayland_info->interface); +} + static void -print_infos(struct wl_list *infos) +print_infos(struct wayland_info *wayland_info) { + struct wl_list *infos = &wayland_info->infos; struct global_info *info; wl_list_for_each(info, infos, link) - info->print(info); + if (should_print_info(wayland_info, info)) + info->print(info); } static void @@ -2107,11 +2351,48 @@ destroy_info(info); } +static void +print_usage(const char *name, int exit_status) +{ + fprintf(stderr, "Usage: %s [options...] \n", name); + fprintf(stderr, "\n"); + fprintf(stderr, " -h|--help: Print this help and exit\n"); + fprintf(stderr, " -i|--interface <interface>: Only print information about the" + " Wayland globals containing <interface> in their name\n"); + fprintf(stderr, "\n"); + exit(exit_status); +} + +static void +parse_cmdline(struct wayland_info *info, int argc, char **argv) +{ + int i; + + info->interface = NULL; + + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) { + print_usage(argv[0], EXIT_SUCCESS); + } else if (!strcmp(argv[i], "--interface") || !strcmp(argv[i], "-i")) { + if (i + 1 >= argc) { + fprintf(stderr, "Missing interface name\n"); + print_usage(argv[0], EXIT_FAILURE); + } + info->interface = strdup(argv[++i]); + } else { + fprintf(stderr, "Unknown option %s\n", argv[i]); + print_usage(argv[0], EXIT_FAILURE); + } + } +} + int main(int argc, char **argv) { struct wayland_info info; + parse_cmdline(&info, argc, argv); + info.display = wl_display_connect(NULL); if (!info.display) { fprintf(stderr, "failed to create display: %s\n", @@ -2133,7 +2414,7 @@ wl_display_roundtrip(info.display); } while (info.roundtrip_needed); - print_infos(&info.infos); + print_infos(&info); destroy_infos(&info.infos); wl_registry_destroy(info.registry);
