diff options
| author | Piotr Piórkowski <piotr.piorkowski@intel.com> | 2025-07-14 20:48:14 +0200 |
|---|---|---|
| committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2025-07-16 12:06:25 -0700 |
| commit | 922ae875230be91c7f05f2aa90d176b6693e2601 (patch) | |
| tree | 0adba35d062ffcb69f83c98a5f77f3fec2319b08 /drivers/gpu/drm | |
| parent | drm/xe: Move debugfs GT attributes under tile directory (diff) | |
| download | linux-922ae875230be91c7f05f2aa90d176b6693e2601.tar.gz linux-922ae875230be91c7f05f2aa90d176b6693e2601.zip | |
drm/xe: Use devm_ioremap_wc for VRAM mapping and drop manual unmap
Let's replace the manual call to ioremap_wc function with devm_ioremap_wc
function, ensuring that VRAM mappings are automatically released when
the driver is detached.
Since devm_ioremap_wc registers the mapping with the device's managed
resources, the explicit iounmap call in vram_fini is no longer needed,
so let's remove it.
Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Suggested-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20250714184818.89201-2-piotr.piorkowski@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/xe/xe_vram.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/xe_vram.c b/drivers/gpu/drm/xe/xe_vram.c index e421a74fb87c..3a4c84e9efc6 100644 --- a/drivers/gpu/drm/xe/xe_vram.c +++ b/drivers/gpu/drm/xe/xe_vram.c @@ -156,7 +156,8 @@ static int determine_lmem_bar_size(struct xe_device *xe) xe->mem.vram.dpa_base = 0; /* set up a map to the total memory area. */ - xe->mem.vram.mapping = ioremap_wc(xe->mem.vram.io_start, xe->mem.vram.io_size); + xe->mem.vram.mapping = devm_ioremap_wc(&pdev->dev, xe->mem.vram.io_start, + xe->mem.vram.io_size); return 0; } @@ -278,9 +279,6 @@ static void vram_fini(void *arg) struct xe_tile *tile; int id; - if (xe->mem.vram.mapping) - iounmap(xe->mem.vram.mapping); - xe->mem.vram.mapping = NULL; for_each_tile(tile, xe, id) |
