drm/xe: Add tile_count to xe_probed_info

On multi-tile platforms, we need to probe the hardware for the number
of tiles that are present in the platform.  That means that we should
do that as part of xe_probe_info() instead of xe_info_init().  Do
that.

Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Violet Monti <violet.monti@intel.com>
Link: https://patch.msgid.link/20260609-xe-probe-info-v1-9-21e83e188e60@intel.com
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
This commit is contained in:
Gustavo Sousa 2026-06-09 17:17:41 -03:00
parent 723c3407fb
commit 820de07bba
2 changed files with 15 additions and 23 deletions

View File

@ -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 @@ int xe_pci_fake_device_init(struct xe_device *xe)
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;

View File

@ -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;