summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_mmio.c
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2023-12-05 04:32:59 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:45:11 +0300
commit4f122766f9043c30b879b44f7dc2ca540b5422cd (patch)
treeb9792350f229d9cb1108452e99ed5e9fd4aa213d /drivers/gpu/drm/xe/xe_mmio.c
parent99e4b1aa8dbe2e23c73229ac1bbd9dc3e6b30c80 (diff)
downloadlinux-4f122766f9043c30b879b44f7dc2ca540b5422cd.tar.xz
drm/xe/device: Introduce xe_device_probe_early
SR-IOV VF doesn't have access to MMIO registers used to determine graphics/media ID. It can however communicate with GuC. Introduce xe_device_probe_early, which initializes enough HW to use MMIO GuC communication. This will allow both VF and PF/native driver to have unified probe ordering. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_mmio.c')
-rw-r--r--drivers/gpu/drm/xe/xe_mmio.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
index 2e6c94731a5a..35aeb50b7158 100644
--- a/drivers/gpu/drm/xe/xe_mmio.c
+++ b/drivers/gpu/drm/xe/xe_mmio.c
@@ -15,10 +15,12 @@
#include "regs/xe_regs.h"
#include "xe_bo.h"
#include "xe_device.h"
+#include "xe_ggtt.h"
#include "xe_gt.h"
#include "xe_gt_mcr.h"
#include "xe_macros.h"
#include "xe_module.h"
+#include "xe_tile.h"
#define XEHP_MTCFG_ADDR XE_REG(0x101800)
#define TILE_COUNT REG_GENMASK(15, 8)
@@ -376,10 +378,8 @@ static int xe_verify_lmem_ready(struct xe_device *xe)
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;
- int err;
/*
* Map the entire BAR.
@@ -393,12 +393,16 @@ int xe_mmio_init(struct xe_device *xe)
return -EIO;
}
- err = drmm_add_action_or_reset(&xe->drm, mmio_fini, xe);
- if (err)
- return err;
+ return drmm_add_action_or_reset(&xe->drm, mmio_fini, xe);
+}
+
+int xe_mmio_root_tile_init(struct xe_device *xe)
+{
+ struct xe_tile *root_tile = xe_device_get_root_tile(xe);
+ int err;
/* Setup first tile; other tiles (if present) will be setup later. */
- root_tile->mmio.size = xe->mmio.size;
+ root_tile->mmio.size = SZ_16M;
root_tile->mmio.regs = xe->mmio.regs;
err = xe_verify_lmem_ready(xe);