Skip to content
  • Marcin Bernatowicz's avatar
    lib/igt_core: Refactor libpciaccess init/cleanup wrappers · 98173eea
    Marcin Bernatowicz authored
    
    
    Enable reinitialization of the libpciaccess global state, necessary
    to correctly handle dynamic add/remove of PCI devices, such as the
    creation/removal of Virtual Functions (VFs). Update
    igt_pci_system_cleanup() to conditionally call pci_system_cleanup()
    based on the initialization state. Introduce igt_pci_system_reinit()
    for explicit reinitialization of the libpciaccess global state,
    particularly useful after PCI device changes, to be used in
    subsequent patches.
    
    v2:
    - Change pci_system_initialized type from int to bool for consistency
      with install_handler (Peter)
    - Simplify conditional logic in igt_pci_system_init by removing
      redundant assignments
    
    Signed-off-by: default avatarMarcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
    Reviewed-by: default avatarPeter Senna Tschudin <peter.senna@linux.intel.com>
    Cc: Adam Miszczak <adam.miszczak@linux.intel.com>
    Cc: Lukasz Laguna <lukasz.laguna@intel.com>
    Cc: Jakub Kolakowski <jakub1.kolakowski@intel.com>
    Cc: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
    Cc: Chris Wilson <chris.p.wilson@intel.com>
    Cc: Peter Senna Tschudin <peter.senna@linux.intel.com>
    98173eea
Loading