[igt-dev] [PATCH i-g-t v4 1/6] lib/igt_device: add igt_device_get_pci_addr by fd

Chris Wilson chris at chris-wilson.co.uk
Fri Apr 26 05:37:21 UTC 2019


Quoting Daniel Mrzyglod (2019-04-25 21:58:17)
> From: Michał Winiarski <michal.winiarski at intel.com>
> 
> 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
> Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Daniel Mrzyglod <daniel.t.mrzyglod at intel.com>
> ---
> diff --git a/lib/igt_device.h b/lib/igt_device.h
> index 9d7dc2c3..860b3a8a 100644
> --- a/lib/igt_device.h
> +++ b/lib/igt_device.h
> @@ -25,6 +25,7 @@
>  #ifndef __IGT_DEVICE_H__
>  #define __IGT_DEVICE_H__
>  
> +#include <stdint.h>

Not required for header compilation.

But it would be clearer to drop a struct pci_device forward decl here as
well.

>  int __igt_device_set_master(int fd);
>  void igt_device_set_master(int fd);
>  
> @@ -32,5 +33,6 @@ int __igt_device_drop_master(int fd);
>  void igt_device_drop_master(int fd);
>  
>  int igt_device_get_card_index(int fd);
> +struct pci_device *igt_device_get_pci_device(int fd);

With that nit,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list