<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="moz-cite-prefix">On 11/19/2024 16:55, Marcin Bernatowicz
wrote:<br>
</div>
<blockquote type="cite" cite="mid:20241119155538.605000-2-marcin.bernatowicz@linux.intel.com">
<pre wrap="" class="moz-quote-pre">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 <a class="moz-txt-link-rfc2396E" href="mailto:marcin.bernatowicz@linux.intel.com"><marcin.bernatowicz@linux.intel.com></a>
Cc: Adam Miszczak <a class="moz-txt-link-rfc2396E" href="mailto:adam.miszczak@linux.intel.com"><adam.miszczak@linux.intel.com></a>
Cc: Jakub Kolakowski <a class="moz-txt-link-rfc2396E" href="mailto:jakub1.kolakowski@intel.com"><jakub1.kolakowski@intel.com></a>
Cc: Kamil Konieczny <a class="moz-txt-link-rfc2396E" href="mailto:kamil.konieczny@linux.intel.com"><kamil.konieczny@linux.intel.com></a>
Cc: Lukasz Laguna <a class="moz-txt-link-rfc2396E" href="mailto:lukasz.laguna@intel.com"><lukasz.laguna@intel.com></a>
Cc: Piotr PiĆ³rkowski <a class="moz-txt-link-rfc2396E" href="mailto:piotr.piorkowski@intel.com"><piotr.piorkowski@intel.com></a>
---
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);
}
/**</pre>
</blockquote>
<br>
<span lang="en-US">Reviewed-by: </span><span lang="pl">L</span><span lang="en-US">ukasz </span><span lang="pl">L</span><span lang="en-US">aguna <</span><a href="mailto:lukasz.laguna@intel.com"><span lang="en-US">lukasz.laguna@intel.com</span></a><span lang="en-US">><br>
<br>
<br>
</span><span style="white-space: pre-wrap">
</span>
</body>
</html>