summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/xe/tests/xe_pci.c11
-rw-r--r--drivers/gpu/drm/xe/xe_pci.c27
2 files changed, 15 insertions, 23 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_pci.c b/drivers/gpu/drm/xe/tests/xe_pci.c
index 31ec41aa997d..8df9029afcd3 100644
--- a/drivers/gpu/drm/xe/tests/xe_pci.c
+++ b/drivers/gpu/drm/xe/tests/xe_pci.c
@@ -311,17 +311,13 @@ const void *xe_pci_id_gen_param(struct kunit *test, const void *prev, char *desc
}
EXPORT_SYMBOL_IF_KUNIT(xe_pci_id_gen_param);
-static void fake_xe_info_probe_tile_count(struct xe_device *xe,
- const struct xe_device_desc *desc)
-{
- xe->info.tile_count = 1 + desc->max_remote_tiles;
-}
-
static int fake_probe_info(struct xe_device *xe,
const struct xe_device_desc *desc,
struct xe_pci_fake_data *data,
struct xe_probed_info *probed_info)
{
+ probed_info->tile_count = 1 + desc->max_remote_tiles;
+
if (!data || desc->pre_gmdid_graphics_ip) {
probed_info->graphics_ip = desc->pre_gmdid_graphics_ip;
probed_info->media_ip = desc->pre_gmdid_media_ip;
@@ -382,9 +378,6 @@ done:
xe->sriov.__mode = data && data->sriov_mode ?
data->sriov_mode : XE_SRIOV_MODE_NONE;
- kunit_activate_static_stub(test, xe_info_probe_tile_count,
- fake_xe_info_probe_tile_count);
-
err = fake_probe_info(xe, desc, data, &probed_info);
if (err)
return err;
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 674948f55d51..91af603e9431 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -730,6 +730,7 @@ static int handle_gmdid(struct xe_device *xe,
struct xe_probed_info {
u16 devid;
u8 revid;
+ u8 tile_count;
struct xe_step_info step;
const struct xe_ip *graphics_ip;
const struct xe_ip *media_ip;
@@ -821,25 +822,21 @@ static int xe_info_init_early(struct xe_device *xe,
return 0;
}
-/*
- * Possibly override number of tile based on configuration register.
- */
-static void xe_info_probe_tile_count(struct xe_device *xe,
- const struct xe_device_desc *desc)
+static void xe_probe_tile_count(struct xe_device *xe,
+ const struct xe_device_desc *desc,
+ struct xe_probed_info *probed_info)
{
struct xe_mmio *mmio;
u8 tile_count;
u32 mtcfg;
- KUNIT_STATIC_STUB_REDIRECT(xe_info_probe_tile_count, xe, desc);
-
- xe->info.tile_count = 1 + desc->max_remote_tiles;
+ probed_info->tile_count = 1 + desc->max_remote_tiles;
/*
* Probe for tile count only for platforms that support multiple
* tiles.
*/
- if (xe->info.tile_count == 1)
+ if (probed_info->tile_count == 1)
return;
mmio = xe_root_tile_mmio(xe);
@@ -852,10 +849,10 @@ static void xe_info_probe_tile_count(struct xe_device *xe,
mtcfg = xe_mmio_read32(mmio, XEHP_MTCFG_ADDR);
tile_count = REG_FIELD_GET(TILE_COUNT, mtcfg) + 1;
- if (tile_count < xe->info.tile_count) {
+ if (tile_count < probed_info->tile_count) {
drm_info(&xe->drm, "tile_count: %d, reduced_tile_count %d\n",
- xe->info.tile_count, tile_count);
- xe->info.tile_count = tile_count;
+ probed_info->tile_count, tile_count);
+ probed_info->tile_count = tile_count;
}
}
@@ -977,6 +974,8 @@ static int xe_probe_info(struct xe_device *xe,
{
int err;
+ xe_probe_tile_count(xe, desc, probed_info);
+
err = xe_probe_ips(xe, desc, probed_info);
if (err)
return err;
@@ -1004,6 +1003,8 @@ static int xe_info_init(struct xe_device *xe,
graphics_ip = probed_info->graphics_ip;
media_ip = probed_info->media_ip;
+
+ xe->info.tile_count = probed_info->tile_count;
xe->info.step.basedie = probed_info->step.basedie;
xe->info.step.graphics = probed_info->step.graphics;
xe->info.step.media = probed_info->step.media;
@@ -1039,8 +1040,6 @@ static int xe_info_init(struct xe_device *xe,
xe->info.has_soc_remapper_telem = 0;
}
- xe_info_probe_tile_count(xe, desc);
-
for_each_remote_tile(tile, xe, id) {
int err;