summaryrefslogtreecommitdiff
path: root/lib/igt_device.h
AgeCommit message (Collapse)Author
2022-05-18lib/igt_device: Get gfx PCI card root portAnshuman Gupta
Utility library function to get the Gfx Card PCI topology root port pci device using libpaciaccess. root port will be used to get the real ACPI D state. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2022-02-23lib/igt_device: Add support for accessing unbound VF PCI devicesJanusz Krzysztofik
The library provides igt_device_get_pci_device() function that allows to get access to a PCI device from an open DRM device file descriptor. It can be used on VF devices as long as a DRM driver is bound to them. However, SR-IOV tests may want to exercise VF PCI devices created by a PF without binding any DRM driver to them. While keeping the API of igt_device_get_pci_device() untouched, extend API of its underlying helper __igt_device_get_pci_device() with an extra argument for specifying VF ID of the requested PCI device and expose this function as public. v2: refresh on top of IGT libpciaccess wrappers and drop previously added but no longer needed error unwind path and recommendations for users on calling pci_system_cleanup() after use (Chris), - fix incorrect validation of snprintf() result and misaligned formatting of igt_warn_on_f() arguments. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Chris Wilson <chris.p.wilson@intel.com> [jkrzyszt: DOC fix and wording improvement]
2022-02-23Revert "lib/igt_device: Add support for accessing unbound VF PCI devices"Janusz Krzysztofik
This reverts commit c220c60bb4679e2e9cdf8accbf90f888e6819456. Incorrect version of the patch has been pushed, sorry. Signed-of-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
2022-02-23lib/igt_device: Add support for accessing unbound VF PCI devicesJanusz Krzysztofik
The library provides igt_device_get_pci_device() function that allows to get access to a PCI device from an open DRM device file descriptor. It can be used on VF devices as long as a DRM driver is bound to them. However, SR-IOV tests may want to exercise VF PCI devices created by a PF without binding any DRM driver to them. While keeping the API of igt_device_get_pci_device() untouched, extend API of its underlying helper __igt_device_get_pci_device() with an extra argument for specifying VF ID of the requested PCI device and expose this function as public. While being at it, fix pci_system_cleanup() not called on errors and instruct users to call it for symmetry when the obtained struct pci_device is no longer needed. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
2019-08-29lib/igt_device: add igt_device_get_pci_addr by fdMichał Winiarski
This function get us pci address based by fd. It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v4: close sysfs fd Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Signed-off-by: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com>
2019-03-29Revert "lib/igt_device: Move intel_get_pci_device under igt_device"Ville Syrjälä
One significant usecase for intel_reg/etc. is to be able to examine the hardware state *before* loading the driver. If the tool forces the driver to load we've totally lost that capability. This reverts commit 8ae86621d6fff60b6e20c6b0f9b336785c935b0f. Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Michał Winiarski <michal.winiarski@intel.com>
2019-03-20lib/igt_device: Move intel_get_pci_device under igt_deviceMichał Winiarski
It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v2: Use readlinkat rather than string concat, move stuff around, provide a version that does not assert. (Chris) v3: Print addr on failure, avoid assignment in conditionals. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-20lib/igt_device: Introduce igt_device_get_card_indexMichał Winiarski
And use it! But let's start small. Rather than going with "and by the way, here's the card index" from igt_sysfs_path, we're making things more explicit. v2: Drop idx comment. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-08lib: Print other clients when DRM_SET_MASTER failsChris Wilson
It looks like there are some rogue processes running in CI that prevent DRM_MASTER from being obtained. Dump the list of clients on failure to make it more obvious what is being left behind. v2: Fix up gtkdocs, meson build References: https://bugs.freedesktop.org/show_bug.cgi?id=104157 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>