Skip to content

Commit

Permalink
drm/xe: Fix arg to pci_iomap()
Browse files Browse the repository at this point in the history
Commit 2d8865b ("drm/xe: Move BAR definitions to dedicated file")
moved the BAR definition to the header, but replaced the wrong arg in
the pci_iomap() function - the last arg is actuall the length, not the
BAR. Luckily GTTMMADR_BAR == 0, so it still works. Fix the argument
to avoid confusion.

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240906032507.2952859-1-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
  • Loading branch information
Lucas De Marchi committed Sep 9, 2024
1 parent 0c841e4 commit ceb2950
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/gpu/drm/xe/xe_mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,14 @@ int xe_mmio_init(struct xe_device *xe)
{
struct xe_tile *root_tile = xe_device_get_root_tile(xe);
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
const int mmio_bar = 0;

/*
* Map the entire BAR.
* The first 16MB of the BAR, belong to the root tile, and include:
* registers (0-4MB), reserved space (4MB-8MB) and GGTT (8MB-16MB).
*/
xe->mmio.size = pci_resource_len(pdev, mmio_bar);
xe->mmio.regs = pci_iomap(pdev, mmio_bar, GTTMMADR_BAR);
xe->mmio.size = pci_resource_len(pdev, GTTMMADR_BAR);
xe->mmio.regs = pci_iomap(pdev, GTTMMADR_BAR, 0);
if (xe->mmio.regs == NULL) {
drm_err(&xe->drm, "failed to map registers\n");
return -EIO;
Expand Down

0 comments on commit ceb2950

Please sign in to comment.