Commit 01c2413a authored by Michał Winiarski's avatar Michał Winiarski Committed by Rodrigo Vivi

drm/xe: Move xe_set_dma_info outside of MMIO setup

MMIO is going to be setup earlier during probe. Move xe_set_dma_info
outside of MMIO setup.
Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20231129214509.1174116-5-michal.winiarski@intel.comSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 604f7e77
......@@ -353,6 +353,28 @@ static void xe_device_sanitize(struct drm_device *drm, void *arg)
xe_gt_sanitize(gt);
}
static int xe_set_dma_info(struct xe_device *xe)
{
unsigned int mask_size = xe->info.dma_mask_size;
int err;
dma_set_max_seg_size(xe->drm.dev, xe_sg_segment_size(xe->drm.dev));
err = dma_set_mask(xe->drm.dev, DMA_BIT_MASK(mask_size));
if (err)
goto mask_err;
err = dma_set_coherent_mask(xe->drm.dev, DMA_BIT_MASK(mask_size));
if (err)
goto mask_err;
return 0;
mask_err:
drm_err(&xe->drm, "Can't set DMA mask/consistent mask (%d)\n", err);
return err;
}
int xe_device_probe(struct xe_device *xe)
{
struct xe_tile *tile;
......@@ -367,6 +389,10 @@ int xe_device_probe(struct xe_device *xe)
if (err)
return err;
err = xe_set_dma_info(xe);
if (err)
return err;
for_each_tile(tile, xe, id) {
err = xe_tile_alloc(tile);
if (err)
......
......@@ -25,28 +25,6 @@
#define BAR_SIZE_SHIFT 20
static int xe_set_dma_info(struct xe_device *xe)
{
unsigned int mask_size = xe->info.dma_mask_size;
int err;
dma_set_max_seg_size(xe->drm.dev, xe_sg_segment_size(xe->drm.dev));
err = dma_set_mask(xe->drm.dev, DMA_BIT_MASK(mask_size));
if (err)
goto mask_err;
err = dma_set_coherent_mask(xe->drm.dev, DMA_BIT_MASK(mask_size));
if (err)
goto mask_err;
return 0;
mask_err:
drm_err(&xe->drm, "Can't set DMA mask/consistent mask (%d)\n", err);
return err;
}
static void
_resize_bar(struct xe_device *xe, int resno, resource_size_t size)
{
......@@ -431,10 +409,6 @@ int xe_mmio_init(struct xe_device *xe)
if (err)
return err;
err = xe_set_dma_info(xe);
if (err)
return err;
xe_mmio_probe_tiles(xe);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment