diff --git a/bin/system-info.c b/bin/system-info.c index 5e741be9afcdf40cfd517ac2ed231c5f5e254e5b..ed6dc1c8667c06ab83c7bd9c2a6b595afb4f4b95 100644 --- a/bin/system-info.c +++ b/bin/system-info.c @@ -501,6 +501,36 @@ print_va_api_details (JsonBuilder *builder, json_builder_end_array (builder); // End va-api_drivers } +static void +print_vdpau_details (JsonBuilder *builder, + GList *vdpau_list) +{ + GList *iter; + + json_builder_set_member_name (builder, "vdpau_drivers"); + json_builder_begin_array (builder); + { + for (iter = vdpau_list; iter != NULL; iter = iter->next) + { + json_builder_begin_object (builder); + json_builder_set_member_name (builder, "library_path"); + json_builder_add_string_value (builder, srt_vdpau_driver_get_library_path (iter->data)); + if (srt_vdpau_driver_get_library_link (iter->data) != NULL) + { + json_builder_set_member_name (builder, "library_link"); + json_builder_add_string_value (builder, srt_vdpau_driver_get_library_link (iter->data)); + } + if (srt_vdpau_driver_is_extra (iter->data)) + { + json_builder_set_member_name (builder, "is_extra"); + json_builder_add_boolean_value (builder, TRUE); + } + json_builder_end_object (builder); + } + } + json_builder_end_array (builder); // End vdpau_drivers +} + static const char * const locales[] = { "", @@ -831,6 +861,7 @@ main (int argc, GList *libraries = NULL; GList *dri_list = NULL; GList *va_api_list = NULL; + GList *vdpau_list = NULL; json_builder_set_member_name (builder, multiarch_tuples[i]); json_builder_begin_object (builder); @@ -864,11 +895,16 @@ main (int argc, extra_driver_flags); print_va_api_details (builder, va_api_list); + vdpau_list = srt_system_info_list_vdpau_drivers (info, multiarch_tuples[i], + extra_driver_flags); + print_vdpau_details (builder, vdpau_list); + json_builder_end_object (builder); // End multiarch_tuple object g_list_free_full (libraries, g_object_unref); g_list_free_full (graphics_list, g_object_unref); g_list_free_full (dri_list, g_object_unref); g_list_free_full (va_api_list, g_object_unref); + g_list_free_full (vdpau_list, g_object_unref); } json_builder_end_object (builder); diff --git a/bin/system-info.md b/bin/system-info.md index 613acd64b3dd26471f3fa3a0bfbfa77fea8a51de..e3fe6a543443246c91ec3ea8867b76deeb6c783e 100644 --- a/bin/system-info.md +++ b/bin/system-info.md @@ -449,6 +449,25 @@ keys: This key is optional and if is not provided, the default %FALSE value should be assumed. + **vdpau_drivers** + : An array of objects describing the VDPAU driver modules that have been + found. These drivers are used by the VDPAU `libvdpau.so.1`. + Every object can have the following keys: + + **library_path** + : Path to the driver module that has been found. + + **library_link** + : Content of the **library_path** symbolic link. This key is optional + and if is not provided, it should be assumed that **library_path** + was a regular file and not a symbolic link. + + **is_extra** + : A boolean value indicating whether the driver module is in an + "unusual" location, probably not in the canonical search path. + This key is optional and if is not provided, the default %FALSE + value should be assumed. + **locale-issues** : An array of strings indicating locale-related issues. The array is empty if no problems were detected. diff --git a/steam-runtime-tools/graphics-internal.h b/steam-runtime-tools/graphics-internal.h index 11517d001317cf54b739e78e78054158131ec2ad..6ea72f79435e10d99c499ef38419ad2f56770d8f 100644 --- a/steam-runtime-tools/graphics-internal.h +++ b/steam-runtime-tools/graphics-internal.h @@ -146,11 +146,13 @@ _srt_graphics_rendering_interface_string (SrtRenderingInterface rendering_interf * SrtGraphicsModule: * @SRT_GRAPHICS_DRI_MODULE: Mesa DRI driver module * @SRT_GRAPHICS_VAAPI_MODULE: VA-API driver module + * @SRT_GRAPHICS_VDPAU_MODULE: VDPAU driver module */ typedef enum { SRT_GRAPHICS_DRI_MODULE = 0, - SRT_GRAPHICS_VAAPI_MODULE + SRT_GRAPHICS_VAAPI_MODULE, + SRT_GRAPHICS_VDPAU_MODULE, } SrtGraphicsModule; G_GNUC_INTERNAL @@ -169,3 +171,8 @@ G_GNUC_INTERNAL GList *_srt_list_dri_drivers (gchar **envp, const char *helpers_path, const char *multiarch_tuple); + +G_GNUC_INTERNAL +GList *_srt_list_vdpau_drivers (gchar **envp, + const char *helpers_path, + const char *multiarch_tuple); diff --git a/steam-runtime-tools/graphics.c b/steam-runtime-tools/graphics.c index 7cf7d8f82af9f5f743d09c199d8c25553787b16f..756d84dfa2ed20f4f0b2ff016bc635564e9037a1 100644 --- a/steam-runtime-tools/graphics.c +++ b/steam-runtime-tools/graphics.c @@ -2445,6 +2445,10 @@ out: static SrtVaApiDriver * srt_va_api_driver_new (const gchar *library_path, gboolean is_extra); +static SrtVdpauDriver * +srt_vdpau_driver_new (const gchar *library_path, + const gchar *library_link, + gboolean is_extra); /** * _srt_get_modules_from_path: @@ -2477,7 +2481,9 @@ _srt_get_modules_from_path (gchar **envp, GList **drivers_out) { const gchar *member; - const gchar *module_suffix; + /* We have up to 2 suffixes that we want to list */ + const gchar *module_suffix[3]; + const gchar *module_prefix = NULL; GDir *dir = NULL; SrtLibraryIssues issues; @@ -2491,11 +2497,20 @@ _srt_get_modules_from_path (gchar **envp, switch (module) { case SRT_GRAPHICS_DRI_MODULE: - module_suffix = "_dri.so"; + module_suffix[0] = "_dri.so"; + module_suffix[1] = NULL; break; case SRT_GRAPHICS_VAAPI_MODULE: - module_suffix = "_drv_video.so"; + module_suffix[0] = "_drv_video.so"; + module_suffix[1] = NULL; + break; + + case SRT_GRAPHICS_VDPAU_MODULE: + module_prefix = "libvdpau_"; + module_suffix[0] = ".so"; + module_suffix[1] = ".so.1"; + module_suffix[2] = NULL; break; default: @@ -2508,14 +2523,21 @@ _srt_get_modules_from_path (gchar **envp, GPtrArray *in_this_dir = g_ptr_array_new_with_free_func (g_free); while ((member = g_dir_read_name (dir)) != NULL) { - if (g_str_has_suffix (member, module_suffix)) - g_ptr_array_add (in_this_dir, g_build_filename (module_directory_path, member, NULL)); + for (gsize i = 0; module_suffix[i] != NULL; i++) + { + if (g_str_has_suffix (member, module_suffix[i]) && + (module_prefix == NULL || g_str_has_prefix (member, module_prefix))) + { + g_ptr_array_add (in_this_dir, g_build_filename (module_directory_path, member, NULL)); + } + } } g_ptr_array_sort (in_this_dir, _srt_indirect_strcmp0); for (gsize j = 0; j < in_this_dir->len; j++) { + gchar *this_driver_link = NULL; const gchar *this_driver = g_ptr_array_index (in_this_dir, j); issues = _srt_check_library_presence (helpers_path, this_driver, multiarch_tuple, NULL, NULL, envp, SRT_LIBRARY_SYMBOLS_FORMAT_PLAIN, NULL); @@ -2534,6 +2556,14 @@ _srt_get_modules_from_path (gchar **envp, *drivers_out = g_list_prepend (*drivers_out, srt_va_api_driver_new (this_driver, is_extra)); break; + case SRT_GRAPHICS_VDPAU_MODULE: + this_driver_link = g_file_read_link (this_driver, NULL); + *drivers_out = g_list_prepend (*drivers_out, srt_vdpau_driver_new (this_driver, + this_driver_link, + is_extra)); + g_free (this_driver_link); + break; + default: g_return_if_reached (); } @@ -2552,8 +2582,9 @@ _srt_get_modules_from_path (gchar **envp, * such as %SRT_ABI_X86_64 * @module: Which graphic module to search * @drivers_out: (inout): Prepend the found drivers to this list. - * If @module is #SRT_GRAPHICS_DRI_MODULE, the element-type will be #SrtDriDriver. - * Otherwise if @module is #SRT_GRAPHICS_VAAPI_MODULE, the element-type will be #SrtVaApiDriver. + * If @module is #SRT_GRAPHICS_DRI_MODULE or #SRT_GRAPHICS_VAAPI_MODULE or + * #SRT_GRAPHICS_VDPAU_MODULE, the element-type will be #SrtDriDriver, or + * #SrtVaApiDriver or #SrtVdpauDriver, respectively. * * On exit, `drivers_out` will have the least-preferred directories first and the * most-preferred directories last. Within a directory, the drivers will be @@ -2571,6 +2602,7 @@ _srt_get_modules_full (gchar **envp, static const char *const dri_loaders[] = { "libGLX_mesa.so.0", "libEGL_mesa.so.0", "libGL.so.1", NULL }; static const char *const va_api_loaders[] = { "libva.so.2", "libva.so.1", NULL }; + static const char *const vdpau_loaders[] = { "libvdpau.so.1", NULL }; const gchar *env_override; const gchar *sysroot; const gchar *drivers_path; @@ -2594,6 +2626,11 @@ _srt_get_modules_full (gchar **envp, env_override = "LIBVA_DRIVERS_PATH"; break; + case SRT_GRAPHICS_VDPAU_MODULE: + loader_libraries = vdpau_loaders; + env_override = "VDPAU_DRIVER_PATH"; + break; + default: g_return_if_reached (); } @@ -2618,7 +2655,20 @@ _srt_get_modules_full (gchar **envp, if (drivers_path) { g_debug ("A driver path environment is available: %s", drivers_path); - gchar **entries = g_strsplit (drivers_path, ":", 0); + gchar **entries; + /* VDPAU_DRIVER_PATH holds just a single path and not a colon separeted + * list of paths. Because of that we handle the VDPAU case separately to + * avoid splitting a theoretically valid path like "/usr/lib/custom_d:r/" */ + if (module == SRT_GRAPHICS_VDPAU_MODULE) + { + entries = g_new (gchar*, 2); + entries[0] = g_strdup (drivers_path); + entries[1] = NULL; + } + else + { + entries = g_strsplit (drivers_path, ":", 0); + } for (gchar **entry = entries; entry != NULL && *entry != NULL; entry++) { @@ -2654,6 +2704,11 @@ _srt_get_modules_full (gchar **envp, * <https://gitlab.com/freedesktop-sdk/freedesktop-sdk/blob/master/elements/extensions/mesa/mesa.bst> * and * <https://gitlab.com/freedesktop-sdk/freedesktop-sdk/blob/master/elements/flatpak-images/platform.bst>) + * + * For VDPAU there is just a single path: + * "%{libdir}/vdpau" + * (reference: + * <https://gitlab.com/freedesktop-sdk/freedesktop-sdk/blob/master/elements/components/libvdpau.bst>) * */ if (g_file_test (flatpak_info, G_FILE_TEST_EXISTS)) { @@ -2678,19 +2733,26 @@ _srt_get_modules_full (gchar **envp, g_free (intel_vaapi); } - gchar *gl_lib_dri = g_build_filename (libdir, "GL", "lib", "dri", NULL); - if (!g_hash_table_contains (drivers_set, gl_lib_dri)) + if (module == SRT_GRAPHICS_VAAPI_MODULE || module == SRT_GRAPHICS_DRI_MODULE) { - g_hash_table_add (drivers_set, g_strdup (gl_lib_dri)); - _srt_get_modules_from_path (envp, helpers_path, multiarch_tuple, gl_lib_dri, - is_extra, module, drivers_out); + gchar *gl_lib_dri = g_build_filename (libdir, "GL", "lib", "dri", NULL); + if (!g_hash_table_contains (drivers_set, gl_lib_dri)) + { + g_hash_table_add (drivers_set, g_strdup (gl_lib_dri)); + _srt_get_modules_from_path (envp, helpers_path, multiarch_tuple, gl_lib_dri, + is_extra, module, drivers_out); + } + g_free (gl_lib_dri); } - g_free (gl_lib_dri); + g_free (libdir); /* We continue to search for libraries but we mark them all as "extra" because the - * loader wouldn't have picked them up. */ - is_extra = TRUE; + * loader wouldn't have picked them up. + * The only exception is for VDPAU, becuase in a Flatpak environment the search path + * is the same as in a non container environment. */ + if (module != SRT_GRAPHICS_VDPAU_MODULE) + is_extra = TRUE; } for (gsize i = 0; loader_libraries[i] != NULL; i++) @@ -2698,7 +2760,7 @@ _srt_get_modules_full (gchar **envp, SrtLibrary *library_details = NULL; char *driver_canonical_path; gchar *libdir; - gchar *dri_path; + gchar *libdir_driver; GList *extras = NULL; SrtLibraryIssues issues; @@ -2743,12 +2805,16 @@ _srt_get_modules_full (gchar **envp, } libdir = g_path_get_dirname (driver_canonical_path); - dri_path = g_build_filename (libdir, "dri", NULL); - if (!g_hash_table_contains (drivers_set, dri_path)) + if (module == SRT_GRAPHICS_VDPAU_MODULE) + libdir_driver = g_build_filename (libdir, "vdpau", NULL); + else + libdir_driver = g_build_filename (libdir, "dri", NULL); + + if (!g_hash_table_contains (drivers_set, libdir_driver)) { - g_hash_table_add (drivers_set, g_strdup (dri_path)); - _srt_get_modules_from_path (envp, helpers_path, multiarch_tuple, dri_path, - is_extra, module, drivers_out); + g_hash_table_add (drivers_set, g_strdup (libdir_driver)); + _srt_get_modules_from_path (envp, helpers_path, multiarch_tuple, + libdir_driver, is_extra, module, drivers_out); } int driver_class = _srt_get_library_class (driver_canonical_path); @@ -2761,7 +2827,7 @@ _srt_get_modules_full (gchar **envp, if (!g_hash_table_contains (drivers_set, this_extra_path->data)) { g_hash_table_add (drivers_set, g_strdup (this_extra_path->data)); - _srt_get_modules_from_path (envp, helpers_path, multiarch_tuple, + _srt_get_modules_from_path (envp, helpers_path, multiarch_tuple, this_extra_path->data, TRUE, module, drivers_out); } @@ -2770,12 +2836,28 @@ _srt_get_modules_full (gchar **envp, free (driver_canonical_path); g_free (libdir); - g_free (dri_path); + g_free (libdir_driver); g_object_unref (library_details); if (extras) g_list_free_full (extras, g_free); } + /* Debian used to hardcode "/usr/lib/vdpau" as an additional search path for VDPAU. + * However since libvdpau 1.3-1 it has been removed; reference: + * <https://salsa.debian.org/nvidia-team/libvdpau/commit/11a3cd84> + * Just to be sure to not miss a potentially valid library path we search on it + * unconditionally, flagging it as extra. */ + if (module == SRT_GRAPHICS_VDPAU_MODULE) + { + gchar *debian_additional = g_build_filename (sysroot, "usr", "lib", "vdpau", NULL); + if (!g_hash_table_contains (drivers_set, debian_additional)) + { + _srt_get_modules_from_path (envp, helpers_path, multiarch_tuple, + debian_additional, TRUE, module, + drivers_out); + } + g_free (debian_additional); + } g_hash_table_unref (drivers_set); g_free (flatpak_info); @@ -3015,6 +3097,246 @@ _srt_list_va_api_drivers (gchar **envp, return g_list_reverse (drivers); } +/** + * SrtVdpauDriver: + * + * Opaque object representing a VDPAU driver. + */ + +struct _SrtVdpauDriver +{ + /*< private >*/ + GObject parent; + gchar *library_path; + gchar *library_link; + gboolean is_extra; +}; + +struct _SrtVdpauDriverClass +{ + /*< private >*/ + GObjectClass parent_class; +}; + +enum +{ + VDPAU_DRIVER_PROP_0, + VDPAU_DRIVER_PROP_LIBRARY_PATH, + VDPAU_DRIVER_PROP_LIBRARY_LINK, + VDPAU_DRIVER_PROP_IS_EXTRA, + N_VDPAU_DRIVER_PROPERTIES +}; + +G_DEFINE_TYPE (SrtVdpauDriver, srt_vdpau_driver, G_TYPE_OBJECT) + +static void +srt_vdpau_driver_init (SrtVdpauDriver *self) +{ +} + +static void +srt_vdpau_driver_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + SrtVdpauDriver *self = SRT_VDPAU_DRIVER (object); + + switch (prop_id) + { + case VDPAU_DRIVER_PROP_LIBRARY_PATH: + g_value_set_string (value, self->library_path); + break; + + case VDPAU_DRIVER_PROP_LIBRARY_LINK: + g_value_set_string (value, self->library_link); + break; + + case VDPAU_DRIVER_PROP_IS_EXTRA: + g_value_set_boolean (value, self->is_extra); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +srt_vdpau_driver_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + SrtVdpauDriver *self = SRT_VDPAU_DRIVER (object); + + switch (prop_id) + { + case VDPAU_DRIVER_PROP_LIBRARY_PATH: + g_return_if_fail (self->library_path == NULL); + self->library_path = g_value_dup_string (value); + break; + + case VDPAU_DRIVER_PROP_LIBRARY_LINK: + g_return_if_fail (self->library_link == NULL); + self->library_link = g_value_dup_string (value); + break; + + case VDPAU_DRIVER_PROP_IS_EXTRA: + self->is_extra = g_value_get_boolean (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +srt_vdpau_driver_finalize (GObject *object) +{ + SrtVdpauDriver *self = SRT_VDPAU_DRIVER (object); + + g_clear_pointer (&self->library_path, g_free); + g_clear_pointer (&self->library_link, g_free); + + G_OBJECT_CLASS (srt_vdpau_driver_parent_class)->finalize (object); +} + +static GParamSpec *vdpau_driver_properties[N_VDPAU_DRIVER_PROPERTIES] = { NULL }; + +static void +srt_vdpau_driver_class_init (SrtVdpauDriverClass *cls) +{ + GObjectClass *object_class = G_OBJECT_CLASS (cls); + + object_class->get_property = srt_vdpau_driver_get_property; + object_class->set_property = srt_vdpau_driver_set_property; + object_class->finalize = srt_vdpau_driver_finalize; + + vdpau_driver_properties[VDPAU_DRIVER_PROP_LIBRARY_PATH] = + g_param_spec_string ("library-path", "Library path", + "Absolute path to the VDPAU driver library", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + + vdpau_driver_properties[VDPAU_DRIVER_PROP_LIBRARY_LINK] = + g_param_spec_string ("library-link", "Library symlink contents", + "Contents of the symbolik link of the VDPAU driver library", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + + vdpau_driver_properties[VDPAU_DRIVER_PROP_IS_EXTRA] = + g_param_spec_boolean ("is-extra", "Is extra?", + "TRUE if the driver is located in an unusual path", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, N_VDPAU_DRIVER_PROPERTIES, + vdpau_driver_properties); +} + +/** + * srt_vdpau_driver_new: + * @library_path: (transfer none): the path to the library + * @library_link: (transfer none) (nullable): the content of the library symlink + * @is_extra: if the VDPAU driver is in an unusual path + * + * Returns: (transfer full): a new VDPAU driver + */ +static SrtVdpauDriver * +srt_vdpau_driver_new (const gchar *library_path, + const gchar *library_link, + gboolean is_extra) +{ + g_return_val_if_fail (library_path != NULL, NULL); + + return g_object_new (SRT_TYPE_VDPAU_DRIVER, + "library-path", library_path, + "library-link", library_link, + "is-extra", is_extra, + NULL); +} + +/** + * srt_vdpau_driver_get_library_path: + * @self: The VDPAU driver + * + * Return the library path for this VDPAU driver. + * + * Returns: (type filename) (transfer none) (nullable): #SrtVdpauDriver:library-path + */ +const gchar * +srt_vdpau_driver_get_library_path (SrtVdpauDriver *self) +{ + g_return_val_if_fail (SRT_IS_VDPAU_DRIVER (self), NULL); + return self->library_path; +} + +/** + * srt_vdpau_driver_get_library_link: + * @self: The VDPAU driver + * + * Return the content of the symbolic link for this VDPAU driver or %NULL + * if the library path is not a symlink. + * + * Returns: (type filename) (transfer none) (nullable): #SrtVdpauDriver:library-link + */ +const gchar * +srt_vdpau_driver_get_library_link (SrtVdpauDriver *self) +{ + g_return_val_if_fail (SRT_IS_VDPAU_DRIVER (self), NULL); + return self->library_link; +} + +/** + * srt_vdpau_driver_is_extra: + * @self: The VDPAU driver + * + * Return a gboolean that indicates if the VDPAU is in an unusual position. + * + * Returns: %TRUE if the VDPAU driver is in an unusual position. + */ +gboolean +srt_vdpau_driver_is_extra (SrtVdpauDriver *self) +{ + g_return_val_if_fail (SRT_IS_VDPAU_DRIVER (self), FALSE); + return self->is_extra; +} + +/* + * _srt_list_vdpau_drivers: + * @envp: (array zero-terminated=1): Behave as though `environ` was this array + * @helpers_path: (nullable): An optional path to find "inspect-library" helper, PATH is used if %NULL + * @multiarch_tuple: (not nullable) (type filename): A Debian-style multiarch tuple + * such as %SRT_ABI_X86_64 + * + * Implementation of srt_system_info_list_vdpau_drivers(). + * + * The returned list will have the most-preferred directories first and the + * least-preferred directories last. Within a directory, the drivers will be in + * lexicographic order, for example `libvdpau_nouveau.so`, `libvdpau_r600.so`, + * `libvdpau_radeonsi.so` in that order. + * + * Returns: (transfer full) (element-type SrtVdpauDriver) (nullable): A list of + * opaque #SrtVdpauDriver objects, or %NULL if nothing was found. Free with + * `g_list_free_full(list, g_object_unref)`. + */ +GList * +_srt_list_vdpau_drivers (gchar **envp, + const char *helpers_path, + const char *multiarch_tuple) +{ + GList *drivers = NULL; + + g_return_val_if_fail (multiarch_tuple != NULL, NULL); + + _srt_get_modules_full (envp, helpers_path, multiarch_tuple, SRT_GRAPHICS_VDPAU_MODULE, &drivers); + + return g_list_reverse (drivers); +} + /** * SrtVulkanIcd: * diff --git a/steam-runtime-tools/graphics.h b/steam-runtime-tools/graphics.h index e23c99743df4222945c0a53d073ac71cc80f00a3..c9906af2b5bd11b4356aab65db150f40046cc000 100644 --- a/steam-runtime-tools/graphics.h +++ b/steam-runtime-tools/graphics.h @@ -183,6 +183,21 @@ GType srt_va_api_driver_get_type (void); const gchar *srt_va_api_driver_get_library_path (SrtVaApiDriver *self); gboolean srt_va_api_driver_is_extra (SrtVaApiDriver *self); +typedef struct _SrtVdpauDriver SrtVdpauDriver; +typedef struct _SrtVdpauDriverClass SrtVdpauDriverClass; + +#define SRT_TYPE_VDPAU_DRIVER (srt_vdpau_driver_get_type ()) +#define SRT_VDPAU_DRIVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SRT_TYPE_VDPAU_DRIVER, SrtVdpauDriver)) +#define SRT_VDPAU_DRIVER_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST ((cls), SRT_TYPE_VDPAU_DRIVER, SrtVdpauDriverClass)) +#define SRT_IS_VDPAU_DRIVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SRT_TYPE_VDPAU_DRIVER)) +#define SRT_IS_VDPAU_DRIVER_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE ((cls), SRT_TYPE_VDPAU_DRIVER)) +#define SRT_VDPAU_DRIVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), SRT_TYPE_VDPAU_DRIVER, SrtVdpauDriverClass) +GType srt_vdpau_driver_get_type (void); + +const gchar *srt_vdpau_driver_get_library_path (SrtVdpauDriver *self); +const gchar *srt_vdpau_driver_get_library_link (SrtVdpauDriver *self); +gboolean srt_vdpau_driver_is_extra (SrtVdpauDriver *self); + typedef struct _SrtVulkanIcd SrtVulkanIcd; typedef struct _SrtVulkanIcdClass SrtVulkanIcdClass; @@ -211,5 +226,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (SrtGraphics, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (SrtEglIcd, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (SrtDriDriver, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (SrtVaApiDriver, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (SrtVdpauDriver, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (SrtVulkanIcd, g_object_unref) #endif diff --git a/steam-runtime-tools/system-info.c b/steam-runtime-tools/system-info.c index c90964aa850271fd987c90fc723086d076fb7a53..f433ccdee006367ab62785d0acaec712c3d05af1 100644 --- a/steam-runtime-tools/system-info.c +++ b/steam-runtime-tools/system-info.c @@ -229,6 +229,9 @@ typedef struct GList *cached_va_api_list; gboolean va_api_cache_available; + + GList *cached_vdpau_list; + gboolean vdpau_cache_available; } Abi; static Abi * @@ -261,6 +264,8 @@ ensure_abi (SrtSystemInfo *self, abi->dri_cache_available = FALSE; abi->cached_va_api_list = NULL; abi->va_api_cache_available = FALSE; + abi->cached_vdpau_list = NULL; + abi->vdpau_cache_available = FALSE; /* transfer ownership to self->abis */ g_ptr_array_add (self->abis, abi); @@ -279,6 +284,7 @@ abi_free (gpointer self) g_list_free_full (abi->cached_dri_list, g_object_unref); g_list_free_full (abi->cached_va_api_list, g_object_unref); + g_list_free_full (abi->cached_vdpau_list, g_object_unref); g_slice_free (Abi, self); } @@ -1425,6 +1431,24 @@ forget_va_apis (SrtSystemInfo *self) } } +/* + * Forget any cached information about VDPAU drivers. + */ +static void +forget_vdpau (SrtSystemInfo *self) +{ + gsize i; + + for (i = 0; i < self->abis->len; i++) + { + Abi *abi = g_ptr_array_index (self->abis, i); + + g_list_free_full (abi->cached_vdpau_list, g_object_unref); + abi->cached_vdpau_list = NULL; + abi->vdpau_cache_available = FALSE; + } +} + /** * srt_system_info_check_graphics: * @self: The #SrtSystemInfo object to use. @@ -1577,6 +1601,7 @@ srt_system_info_set_environ (SrtSystemInfo *self, forget_dris (self); forget_va_apis (self); + forget_vdpau (self); forget_libraries (self); forget_graphics_results (self); forget_locales (self); @@ -2155,6 +2180,7 @@ srt_system_info_set_helpers_path (SrtSystemInfo *self, forget_dris (self); forget_va_apis (self); + forget_vdpau (self); forget_libraries (self); forget_graphics_results (self); forget_locales (self); @@ -2600,6 +2626,67 @@ srt_system_info_list_va_api_drivers (SrtSystemInfo *self, return g_list_reverse (ret); } +/** + * srt_system_info_list_vdpau_drivers: + * @self: The #SrtSystemInfo object + * @multiarch_tuple: (not nullable) (type filename): A Debian-style multiarch + * tuple such as %SRT_ABI_X86_64 + * @flags: Filter the list of VDPAU drivers accordingly to these flags. + * For example, "extra" drivers that are unlikely to be found by + * the VDPAU loader will only be included if the + * %SRT_DRIVER_FLAGS_INCLUDE_ALL flag is set. + * + * List of the available VDPAU drivers. + * + * For the search $VDPAU_DRIVER_PATH will be used if set. + * Otherwise some implementation-dependent paths will be used instead. + * + * Note that if `$VDPAU_DRIVER_PATH` is set, all drivers outside that + * path will be treated as "extra", and omitted from the list unless + * %SRT_DRIVER_FLAGS_INCLUDE_ALL is used. + * + * Returns: (transfer full) (element-type SrtVaApiDriver) (nullable): A list of + * opaque #SrtVaApiDriver objects, or %NULL if nothing was found. Free with + * `g_list_free_full(list, g_object_unref)`. + */ +GList * +srt_system_info_list_vdpau_drivers (SrtSystemInfo *self, + const char *multiarch_tuple, + SrtDriverFlags flags) +{ + Abi *abi = NULL; + GList *ret = NULL; + const GList *iter; + + g_return_val_if_fail (SRT_IS_SYSTEM_INFO (self), NULL); + g_return_val_if_fail (multiarch_tuple != NULL, NULL); + + abi = ensure_abi (self, multiarch_tuple); + + if (!abi->vdpau_cache_available) + { + abi->cached_vdpau_list = _srt_list_vdpau_drivers (self->env, + self->helpers_path, + multiarch_tuple); + abi->vdpau_cache_available = TRUE; + } + + for (iter = abi->cached_vdpau_list; iter != NULL; iter = iter->next) + { + if ((flags & SRT_DRIVER_FLAGS_INCLUDE_ALL) == 0 && + srt_vdpau_driver_is_extra (iter->data)) + continue; + ret = g_list_prepend (ret, g_object_ref (iter->data)); + } + + for (const GList *iteri = ret; iteri != NULL; iteri = iteri->next) + { + g_debug ("LIST VDPAU %s", srt_vdpau_driver_get_library_path (iteri->data)); + } + + return g_list_reverse (ret); +} + static void ensure_driver_environment (SrtSystemInfo *self) { diff --git a/steam-runtime-tools/system-info.h b/steam-runtime-tools/system-info.h index 7f5b78a35e6cea62052cc9340aa36f54fd3d24a6..9713e95a1bb9f860b982b18ef62811e4bb03b104 100644 --- a/steam-runtime-tools/system-info.h +++ b/steam-runtime-tools/system-info.h @@ -115,6 +115,9 @@ GList *srt_system_info_list_dri_drivers (SrtSystemInfo *self, GList *srt_system_info_list_va_api_drivers (SrtSystemInfo *self, const char *multiarch_tuple, SrtDriverFlags flags); +GList *srt_system_info_list_vdpau_drivers (SrtSystemInfo *self, + const char *multiarch_tuple, + SrtDriverFlags flags); void srt_system_info_set_environ (SrtSystemInfo *self, gchar * const *env); diff --git a/tests/graphics.c b/tests/graphics.c index be7cfb9375a359781db980edd15ca5e61443bf02..e169e2dea7a72e92b1cc34b53afc4c3d0b1d43ba 100644 --- a/tests/graphics.c +++ b/tests/graphics.c @@ -1687,6 +1687,8 @@ check_list_suffixes (const GList *list, value = srt_dri_driver_get_library_path (iter->data); else if (module == SRT_GRAPHICS_VAAPI_MODULE) value = srt_va_api_driver_get_library_path (iter->data); + else if (module == SRT_GRAPHICS_VDPAU_MODULE) + value = srt_vdpau_driver_get_library_path (iter->data); g_assert_nonnull (suffixes[i]); g_assert_true (g_str_has_suffix (value, suffixes[i])); } @@ -1702,11 +1704,55 @@ check_list_extra (const GList *list, for (const GList *iter = list; iter != NULL; iter = iter->next, i++) { gboolean is_extra = (i >= non_extra); - if (module == SRT_GRAPHICS_DRI_MODULE) - g_assert_cmpint (is_extra, ==, srt_dri_driver_is_extra (iter->data)); - else if (module == SRT_GRAPHICS_VAAPI_MODULE) - g_assert_cmpint (is_extra, ==, srt_va_api_driver_is_extra (iter->data)); + switch (module) + { + case SRT_GRAPHICS_DRI_MODULE: + g_assert_cmpint (is_extra, ==, srt_dri_driver_is_extra (iter->data)); + break; + + case SRT_GRAPHICS_VAAPI_MODULE: + g_assert_cmpint (is_extra, ==, srt_va_api_driver_is_extra (iter->data)); + break; + + case SRT_GRAPHICS_VDPAU_MODULE: + g_assert_cmpint (is_extra, ==, srt_vdpau_driver_is_extra (iter->data)); + break; + + default: + g_return_if_reached (); + } + } +} + +static void +check_list_links (const GList *list, + const gchar *suffixes[], + SrtGraphicsModule module) +{ + const gchar *value = NULL; + gsize i = 0; + for (const GList *iter = list; iter != NULL; iter = iter->next) + { + switch (module) + { + case SRT_GRAPHICS_VDPAU_MODULE: + value = srt_vdpau_driver_get_library_link (iter->data); + break; + + case SRT_GRAPHICS_VAAPI_MODULE: + case SRT_GRAPHICS_DRI_MODULE: + default: + g_return_if_reached (); + } + /* If we don't expect any more symlinks, then "value" should be NULL too */ + if (suffixes[i] == NULL) + g_assert_cmpstr (value, ==, NULL); + if (value == NULL) + continue; + g_assert_true (g_str_has_suffix (value, suffixes[i])); + i++; } + g_assert_cmpstr (suffixes[i], ==, NULL); } static void @@ -1989,6 +2035,198 @@ test_dri_flatpak (Fixture *f, g_strfreev (envp); } +static void +test_vdpau_debian10 (Fixture *f, + gconstpointer context) +{ + SrtSystemInfo *info; + gchar **envp; + gchar *sysroot; + GList *vdpau; + const gchar *multiarch_tuples[] = {"mock-debian-i386", "mock-debian-x86_64", NULL}; + const gchar *vdpau_suffixes_i386[] = {"/lib/i386-linux-gnu/vdpau/libvdpau_r600.so", + "/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so", + "/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so.1", + NULL}; + const gchar *vdpau_suffixes_x86_64[] = {"/lib/x86_64-linux-gnu/vdpau/libvdpau_r600.so.1", + "/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so", + "/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so.1", + NULL}; + /* These symlinks are provided by "libvdpau_radeonsi.so" and "libvdpau_radeonsi.so.1" */ + const gchar *vdpau_links_i386[] = {"libvdpau_radeonsi.so.1.0.0", + "libvdpau_radeonsi.so.1.0.0", + NULL}; + /* These symlinks are provided by "libvdpau_r600.so", "libvdpau_radeonsi.so" + * and "libvdpau_radeonsi.so.1" */ + const gchar *vdpau_links_x86_64[] = {"libvdpau_r600.so.1.0.0", + "libvdpau_radeonsi.so.1.0.0", + "libvdpau_radeonsi.so.1.0.0", + NULL}; + + sysroot = g_build_filename (f->srcdir, "sysroots", "debian10", NULL); + envp = g_get_environ (); + envp = g_environ_setenv (envp, "SRT_TEST_SYSROOT", sysroot, TRUE); + envp = g_environ_unsetenv (envp, "VDPAU_DRIVER_PATH"); + + info = srt_system_info_new (NULL); + srt_system_info_set_environ (info, envp); + srt_system_info_set_helpers_path (info, f->builddir); + + vdpau = srt_system_info_list_vdpau_drivers (info, multiarch_tuples[0], SRT_DRIVER_FLAGS_NONE); + check_list_suffixes (vdpau, vdpau_suffixes_i386, SRT_GRAPHICS_VDPAU_MODULE); + check_list_links (vdpau, vdpau_links_i386, SRT_GRAPHICS_VDPAU_MODULE); + g_list_free_full (vdpau, g_object_unref); + + vdpau = srt_system_info_list_vdpau_drivers (info, multiarch_tuples[1], SRT_DRIVER_FLAGS_NONE); + check_list_suffixes (vdpau, vdpau_suffixes_x86_64, SRT_GRAPHICS_VDPAU_MODULE); + check_list_links (vdpau, vdpau_links_x86_64, SRT_GRAPHICS_VDPAU_MODULE); + g_list_free_full (vdpau, g_object_unref); + + g_object_unref (info); + g_free (sysroot); + g_strfreev (envp); +} + +static void +test_vdpau_fedora (Fixture *f, + gconstpointer context) +{ + SrtSystemInfo *info; + gchar **envp; + gchar *sysroot; + GList *vdpau; + const gchar *multiarch_tuples[] = {"mock-fedora-32-bit", "mock-fedora-64-bit", NULL}; + const gchar *vdpau_suffixes_32[] = {"/usr/lib/vdpau/libvdpau_nouveau.so.1", + "/usr/lib/vdpau/libvdpau_r600.so", + "/usr/lib/vdpau/libvdpau_radeonsi.so", + "/usr/lib/vdpau/libvdpau_radeonsi.so.1", + NULL}; + const gchar *vdpau_suffixes_64[] = {"/usr/lib64/vdpau/libvdpau_r300.so", + "/usr/lib64/vdpau/libvdpau_r300.so.1", + "/usr/lib64/vdpau/libvdpau_radeonsi.so", + "/usr/lib64/vdpau/libvdpau_radeonsi.so.1", + NULL}; + /* These symlinks are provided by "libvdpau_radeonsi.so" and "libvdpau_radeonsi.so.1" */ + const gchar *vdpau_links_32[] = {"libvdpau_radeonsi.so.1.0.0", + "libvdpau_radeonsi.so.1.0.0", + NULL}; + /* These symlinks are provided by "libvdpau_r300.so.1" and "libvdpau_radeonsi.so.1" */ + const gchar *vdpau_links_64[] = {"libvdpau_r300.so", + "libvdpau_radeonsi.so", + NULL}; + + sysroot = g_build_filename (f->srcdir, "sysroots", "fedora", NULL); + envp = g_get_environ (); + envp = g_environ_setenv (envp, "SRT_TEST_SYSROOT", sysroot, TRUE); + envp = g_environ_unsetenv (envp, "VDPAU_DRIVER_PATH"); + + info = srt_system_info_new (NULL); + srt_system_info_set_environ (info, envp); + srt_system_info_set_helpers_path (info, f->builddir); + + vdpau = srt_system_info_list_vdpau_drivers (info, multiarch_tuples[0], SRT_DRIVER_FLAGS_NONE); + check_list_suffixes (vdpau, vdpau_suffixes_32, SRT_GRAPHICS_VDPAU_MODULE); + check_list_links (vdpau, vdpau_links_32, SRT_GRAPHICS_VDPAU_MODULE); + g_list_free_full (vdpau, g_object_unref); + + vdpau = srt_system_info_list_vdpau_drivers (info, multiarch_tuples[1], SRT_DRIVER_FLAGS_NONE); + check_list_suffixes (vdpau, vdpau_suffixes_64, SRT_GRAPHICS_VDPAU_MODULE); + check_list_links (vdpau, vdpau_links_64, SRT_GRAPHICS_VDPAU_MODULE); + g_list_free_full (vdpau, g_object_unref); + + g_object_unref (info); + g_free (sysroot); + g_strfreev (envp); +} + +static void +test_vdpau_with_env (Fixture *f, + gconstpointer context) +{ + SrtSystemInfo *info; + gchar **envp; + gchar *sysroot; + gchar *vdpau_path; + GList *vdpau; + const gchar *multiarch_tuples[] = {"mock-fedora-32-bit", NULL}; + const gchar *vdpau_suffixes[] = {"/custom_path32/vdpau/libvdpau_r600.so.1", + "/custom_path32/vdpau/libvdpau_radeonsi.so.1", + NULL}; + const gchar *vdpau_suffixes_with_extras[] = {"/custom_path32/vdpau/libvdpau_r600.so.1", + "/custom_path32/vdpau/libvdpau_radeonsi.so.1", + "/usr/lib/vdpau/libvdpau_nouveau.so.1", + NULL}; + /* There are no symlinks */ + const gchar *vdpau_links[] = {NULL}; + + if (strcmp (_SRT_MULTIARCH, "") == 0) + { + g_test_skip ("Unsupported architecture"); + return; + } + + sysroot = g_build_filename (f->srcdir, "sysroots", "no-os-release", NULL); + + vdpau_path = g_build_filename (sysroot, "custom_path32", "vdpau", NULL); + + envp = g_get_environ (); + envp = g_environ_setenv (envp, "SRT_TEST_SYSROOT", sysroot, TRUE); + envp = g_environ_setenv (envp, "VDPAU_DRIVER_PATH", vdpau_path, TRUE); + + info = srt_system_info_new (NULL); + srt_system_info_set_environ (info, envp); + srt_system_info_set_helpers_path (info, f->builddir); + + /* The output is guaranteed to be in aphabetical order */ + vdpau = srt_system_info_list_vdpau_drivers (info, multiarch_tuples[0], SRT_DRIVER_FLAGS_NONE); + check_list_suffixes (vdpau, vdpau_suffixes, SRT_GRAPHICS_VDPAU_MODULE); + check_list_links (vdpau, vdpau_links, SRT_GRAPHICS_VDPAU_MODULE); + g_list_free_full (vdpau, g_object_unref); + + /* Do it again, this time including the extras */ + vdpau = srt_system_info_list_vdpau_drivers (info, multiarch_tuples[0], SRT_DRIVER_FLAGS_INCLUDE_ALL); + check_list_suffixes (vdpau, vdpau_suffixes_with_extras, SRT_GRAPHICS_VDPAU_MODULE); + check_list_links (vdpau, vdpau_links, SRT_GRAPHICS_VDPAU_MODULE); + /* Minus one to not count the NULL terminator */ + check_list_extra (vdpau, G_N_ELEMENTS(vdpau_suffixes)-1, SRT_GRAPHICS_VDPAU_MODULE); + g_list_free_full (vdpau, g_object_unref); + + g_object_unref (info); + g_free (sysroot); + g_free (vdpau_path); + g_strfreev (envp); +} + +static void +test_vdpau_flatpak (Fixture *f, + gconstpointer context) +{ + SrtSystemInfo *info; + gchar **envp; + gchar *sysroot; + GList *vdpau; + const gchar *multiarch_tuples[] = { "mock-abi", NULL }; + const gchar *vdpau_suffixes[] = {"/usr/lib/mock-abi/vdpau/libvdpau_radeonsi.so.1", + NULL}; + + sysroot = g_build_filename (f->srcdir, "sysroots", "flatpak-example", NULL); + envp = g_get_environ (); + envp = g_environ_setenv (envp, "SRT_TEST_SYSROOT", sysroot, TRUE); + envp = g_environ_unsetenv (envp, "VDPAU_DRIVER_PATH"); + + info = srt_system_info_new (NULL); + srt_system_info_set_environ (info, envp); + srt_system_info_set_helpers_path (info, f->builddir); + + vdpau = srt_system_info_list_vdpau_drivers (info, multiarch_tuples[0], SRT_DRIVER_FLAGS_NONE); + check_list_suffixes (vdpau, vdpau_suffixes, SRT_GRAPHICS_VDPAU_MODULE); + g_list_free_full (vdpau, g_object_unref); + + g_object_unref (info); + g_free (sysroot); + g_strfreev (envp); +} + static const Config dir_config = { ICD_MODE_EXPLICIT_DIRS }; static const Config filename_config = { ICD_MODE_EXPLICIT_FILENAMES }; static const Config flatpak_config = { ICD_MODE_FLATPAK }; @@ -2058,5 +2296,14 @@ main (int argc, g_test_add ("/graphics/dri/flatpak", Fixture, NULL, setup, test_dri_flatpak, teardown); + g_test_add ("/graphics/vdpau/debian10", Fixture, NULL, + setup, test_vdpau_debian10, teardown); + g_test_add ("/graphics/vdpau/fedora", Fixture, NULL, + setup, test_vdpau_fedora, teardown); + g_test_add ("/graphics/vdpau/with_env", Fixture, NULL, + setup, test_vdpau_with_env, teardown); + g_test_add ("/graphics/vdpau/flatpak", Fixture, NULL, + setup, test_vdpau_flatpak, teardown); + return g_test_run (); } diff --git a/tests/meson.build b/tests/meson.build index 8a59c3c4d5ed42ec1dceb08cf5e42c611e5dd148..9c0fdbed3963915cdf82ba3026d3408d3880f11e 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -60,7 +60,12 @@ install_subdir('expectations_with_missings', install_dir : tests_dir) # Vulkan *.json files. (The order of EGL *.json files is well-defined.) install_subdir('fake-icds', install_dir : tests_dir) install_subdir('fake-steam-runtime', install_dir : tests_dir) -install_subdir('sysroots', install_dir : tests_dir) +# Instead of doing `install_subdir` for "sysroot" we use a custom install +# script because with `install_subdir` the symlinks don't get preserved, +# but instead they are copied as files. And this behavior breaks our tests. +src = meson.current_source_dir() + '/' + 'sysroots' +# Note that the `-a` option is Linux specific +meson.add_install_script('sh', '-c', 'cp -a "$1" "${DESTDIR}/${MESON_INSTALL_PREFIX}/$2"', 'sh', src, tests_dir) executable( 'mock-true', diff --git a/tests/mock-fedora-32-bit-inspect-library.c b/tests/mock-fedora-32-bit-inspect-library.c index f21e5f062552dc9a1e50cefa33c534855486a4aa..f79b89171d0c22acdd6e7dea2e96f6d9528c1734 100644 --- a/tests/mock-fedora-32-bit-inspect-library.c +++ b/tests/mock-fedora-32-bit-inspect-library.c @@ -41,6 +41,7 @@ main (int argc, if (g_strstr_len (argv[1], -1, "/lib/i386-linux-gnu/") != NULL || g_strstr_len (argv[1], -1, "/lib32/dri/") != NULL || g_strstr_len (argv[1], -1, "/lib/dri/") != NULL || + g_strstr_len (argv[1], -1, "/lib/vdpau/") != NULL || g_strstr_len (argv[1], -1, "/custom_path32/") != NULL || g_strstr_len (argv[1], -1, "/custom_path32_2/") != NULL) { diff --git a/tests/sysroots/debian10/usr/lib/i386-linux-gnu/libvdpau.so.1 b/tests/sysroots/debian10/usr/lib/i386-linux-gnu/libvdpau.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_r600.so b/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_r600.so new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so b/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so new file mode 120000 index 0000000000000000000000000000000000000000..7d720b5733249de86ebe74f714e3d4168e9b47b1 --- /dev/null +++ b/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so @@ -0,0 +1 @@ +libvdpau_radeonsi.so.1.0.0 \ No newline at end of file diff --git a/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so.1 b/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so.1 new file mode 120000 index 0000000000000000000000000000000000000000..7d720b5733249de86ebe74f714e3d4168e9b47b1 --- /dev/null +++ b/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so.1 @@ -0,0 +1 @@ +libvdpau_radeonsi.so.1.0.0 \ No newline at end of file diff --git a/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so.1.0.0 b/tests/sysroots/debian10/usr/lib/i386-linux-gnu/vdpau/libvdpau_radeonsi.so.1.0.0 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/libvdpau.so.1 b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/libvdpau.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_r600.so.1 b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_r600.so.1 new file mode 120000 index 0000000000000000000000000000000000000000..6645179651d23785fd525c99a83c87d62c24387c --- /dev/null +++ b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_r600.so.1 @@ -0,0 +1 @@ +libvdpau_r600.so.1.0.0 \ No newline at end of file diff --git a/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_r600.so.1.0.0 b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_r600.so.1.0.0 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so new file mode 120000 index 0000000000000000000000000000000000000000..7d720b5733249de86ebe74f714e3d4168e9b47b1 --- /dev/null +++ b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so @@ -0,0 +1 @@ +libvdpau_radeonsi.so.1.0.0 \ No newline at end of file diff --git a/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so.1 b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so.1 new file mode 120000 index 0000000000000000000000000000000000000000..7d720b5733249de86ebe74f714e3d4168e9b47b1 --- /dev/null +++ b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so.1 @@ -0,0 +1 @@ +libvdpau_radeonsi.so.1.0.0 \ No newline at end of file diff --git a/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so.1.0.0 b/tests/sysroots/debian10/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_radeonsi.so.1.0.0 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/fedora/usr/lib/libvdpau.so.1 b/tests/sysroots/fedora/usr/lib/libvdpau.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_nouveau.so.1 b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_nouveau.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_r600.so b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_r600.so new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so new file mode 120000 index 0000000000000000000000000000000000000000..7d720b5733249de86ebe74f714e3d4168e9b47b1 --- /dev/null +++ b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so @@ -0,0 +1 @@ +libvdpau_radeonsi.so.1.0.0 \ No newline at end of file diff --git a/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so.1 b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so.1 new file mode 120000 index 0000000000000000000000000000000000000000..7d720b5733249de86ebe74f714e3d4168e9b47b1 --- /dev/null +++ b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so.1 @@ -0,0 +1 @@ +libvdpau_radeonsi.so.1.0.0 \ No newline at end of file diff --git a/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so.1.0 b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so.1.0 new file mode 120000 index 0000000000000000000000000000000000000000..7d720b5733249de86ebe74f714e3d4168e9b47b1 --- /dev/null +++ b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so.1.0 @@ -0,0 +1 @@ +libvdpau_radeonsi.so.1.0.0 \ No newline at end of file diff --git a/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so.1.0.0 b/tests/sysroots/fedora/usr/lib/vdpau/libvdpau_radeonsi.so.1.0.0 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/fedora/usr/lib64/libvdpau.so.1 b/tests/sysroots/fedora/usr/lib64/libvdpau.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_r300.so b/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_r300.so new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_r300.so.1 b/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_r300.so.1 new file mode 120000 index 0000000000000000000000000000000000000000..980ac00a7f53a4e28231c6ea16bbcb8d057e4510 --- /dev/null +++ b/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_r300.so.1 @@ -0,0 +1 @@ +libvdpau_r300.so \ No newline at end of file diff --git a/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_radeonsi.so b/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_radeonsi.so new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_radeonsi.so.1 b/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_radeonsi.so.1 new file mode 120000 index 0000000000000000000000000000000000000000..47629d3133a70cdf821f76cc330fed7a2c3f1e70 --- /dev/null +++ b/tests/sysroots/fedora/usr/lib64/vdpau/libvdpau_radeonsi.so.1 @@ -0,0 +1 @@ +libvdpau_radeonsi.so \ No newline at end of file diff --git a/tests/sysroots/flatpak-example/usr/lib/mock-abi/libvdpau.so.1 b/tests/sysroots/flatpak-example/usr/lib/mock-abi/libvdpau.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/flatpak-example/usr/lib/mock-abi/vdpau/libvdpau_radeonsi.so.1 b/tests/sysroots/flatpak-example/usr/lib/mock-abi/vdpau/libvdpau_radeonsi.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/no-os-release/custom_path32/vdpau/libvdpau_r600.so.1 b/tests/sysroots/no-os-release/custom_path32/vdpau/libvdpau_r600.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/no-os-release/custom_path32/vdpau/libvdpau_radeonsi.so.1 b/tests/sysroots/no-os-release/custom_path32/vdpau/libvdpau_radeonsi.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/no-os-release/usr/lib/libvdpau.so.1 b/tests/sysroots/no-os-release/usr/lib/libvdpau.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/sysroots/no-os-release/usr/lib/vdpau/libvdpau_nouveau.so.1 b/tests/sysroots/no-os-release/usr/lib/vdpau/libvdpau_nouveau.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/system-info-cli.c b/tests/system-info-cli.c index 3673e5361bf26814cfba31ff4064d53e05a71fdb..a94bf2a6a2a2d444cd781c849b73fbc0e51c3afa 100644 --- a/tests/system-info-cli.c +++ b/tests/system-info-cli.c @@ -152,6 +152,7 @@ libraries_presence (Fixture *f, } g_assert_true (json_object_has_member (json_arch, "dri_drivers")); g_assert_true (json_object_has_member (json_arch, "va-api_drivers")); + g_assert_true (json_object_has_member (json_arch, "vdpau_drivers")); } g_object_unref (parser); @@ -274,6 +275,7 @@ libraries_missing (Fixture *f, ==, srt_system_info_can_run (info, multiarch_tuples[i])); g_assert_true (json_object_has_member (json_arch, "dri_drivers")); g_assert_true (json_object_has_member (json_arch, "va-api_drivers")); + g_assert_true (json_object_has_member (json_arch, "vdpau_drivers")); check_libraries_missing (json_arch); } @@ -393,6 +395,7 @@ libraries_presence_verbose (Fixture *f, ==, srt_system_info_can_run (info, multiarch_tuples[i])); g_assert_true (json_object_has_member (json_arch, "dri_drivers")); g_assert_true (json_object_has_member (json_arch, "va-api_drivers")); + g_assert_true (json_object_has_member (json_arch, "vdpau_drivers")); check_libraries_verbose (json_arch); } @@ -462,6 +465,7 @@ no_arguments (Fixture *f, ==, srt_system_info_can_run (info, multiarch_tuples[i])); g_assert_true (json_object_has_member (json_arch, "dri_drivers")); g_assert_true (json_object_has_member (json_arch, "va-api_drivers")); + g_assert_true (json_object_has_member (json_arch, "vdpau_drivers")); } g_object_unref (parser);