Il giorno mar 17 ott 2023 alle ore 08:43 Vivek Kasireddy <vivek.kasireddy@xxxxxxxxx> ha scritto: > > Given that libudev is widely available on many Linux distros, we > can use the relevant APIs to iterate over all the devices associated > with the drm subsystem to figure out if a specific vendor GPU > is available or not. > > This capability (identifying GPU Vendor) is useful to determine > whether to launch Gstreamer pipeline using h/w accelerated > plugins. On systems where libudev is not available (Windows, > MacOS, etc) we'd have to make this determination based on the > availability of the relevant plugins in the Gstreamer registry. > > v2: (Frediano) > - Add autoconf support > - Add license text > - Add pragma once and SPICE_BEGIN/END_DECLS to the header > - Check the vendor id udev attribute of the pci device to > determine a vendor GPU instead of checking the driver name > > v3: (fixups by Frediano) > - Fix broken autoconf support added in v2 > - Fix compiler error on systems with no libudev support > - Return VENDOR_GPU_UNKNOWN if we cannot create udev instance > - Make libudev dependency optional > - Change the type of gpu_vendor from long to int as PCI vendor IDs > are defined as 16-bit unsigned int > > Cc: Frediano Ziglio <freddy77@xxxxxxxxx> > Cc: Gerd Hoffmann <kraxel@xxxxxxxxxx> > Cc: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> > Cc: Dongwon Kim <dongwon.kim@xxxxxxxxx> > Cc: Hazwan Arif Mazlan <hazwan.arif.mazlan@xxxxxxxxx> > Cc: Jin Chung Teng <jin.chung.teng@xxxxxxxxx> > Signed-off-by: Vivek Kasireddy <vivek.kasireddy@xxxxxxxxx> > --- > common/Makefile.am | 3 ++ > common/meson.build | 2 ++ > common/udev.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++ > common/udev.h | 33 ++++++++++++++++++++ > configure.ac | 1 + > m4/spice-deps.m4 | 12 +++++++ > meson.build | 7 +++++ > 7 files changed, 136 insertions(+) > create mode 100644 common/udev.c > create mode 100644 common/udev.h > Merged. Minor space change. Frediano