[PATCH i-g-t 1/3] lib/xe/xe_mmio: Replace open-coded init/cleanup with existing functions
Marcin Bernatowicz
marcin.bernatowicz at linux.intel.com
Tue Nov 19 15:55:36 UTC 2024
Use intel_register_access_init and intel_register_access_fini to handle
initialization and cleanup, reducing code duplication. This improves
maintainability and ensures consistency, including handling forcewake
for Xe.
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
Cc: Adam Miszczak <adam.miszczak at linux.intel.com>
Cc: Jakub Kolakowski <jakub1.kolakowski at intel.com>
Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
Cc: Lukasz Laguna <lukasz.laguna at intel.com>
Cc: Piotr Piórkowski <piotr.piorkowski at intel.com>
---
lib/xe/xe_mmio.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/lib/xe/xe_mmio.c b/lib/xe/xe_mmio.c
index 0817c12f6..834816133 100644
--- a/lib/xe/xe_mmio.c
+++ b/lib/xe/xe_mmio.c
@@ -23,13 +23,8 @@ void xe_mmio_vf_access_init(int pf_fd, int vf_id, struct xe_mmio *mmio)
igt_assert_f(pci_dev, "No PCI device found for VF%u\n", vf_id);
- intel_mmio_use_pci_bar(&mmio->intel_mmio, pci_dev);
-
- igt_assert(mmio->intel_mmio.igt_mmio);
-
+ intel_register_access_init(&mmio->intel_mmio, pci_dev, false);
mmio->fd = pf_fd;
- mmio->intel_mmio.safe = false;
- mmio->intel_mmio.pci_device_id = pci_dev->device_id;
}
/**
@@ -53,8 +48,7 @@ void xe_mmio_access_init(int pf_fd, struct xe_mmio *mmio)
*/
void xe_mmio_access_fini(struct xe_mmio *mmio)
{
- mmio->intel_mmio.pci_device_id = 0;
- intel_mmio_unmap_pci_bar(&mmio->intel_mmio);
+ intel_register_access_fini(&mmio->intel_mmio);
}
/**
--
2.31.1
More information about the igt-dev
mailing list