]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/xe: Probe for tile count during device info initialization
authorGustavo Sousa <gustavo.sousa@intel.com>
Mon, 18 Aug 2025 18:15:46 +0000 (15:15 -0300)
committerGustavo Sousa <gustavo.sousa@intel.com>
Wed, 20 Aug 2025 21:59:41 +0000 (18:59 -0300)
commit97a18f8349423371650996fc506dfd6cc4d3e1ad
tree8d981eeb82828838cb4b14877f63560ee12b53a2
parent6627be03d3e1195b22172554191365378c3460e7
drm/xe: Probe for tile count during device info initialization

The function mmio_multi_tile_setup() does not look like the proper
location for probing for the number of existing tiles in the hardware.
It should not be that function's responsibility and such information
should instead be already available when it gets called.

The fact that we need to adjust gt_count is a symptom of that.

Move probing of available tile count to a dedicated function named
xe_info_probe_tile_count() and call it from xe_info_init(), which seems
like a more appropriate place for that.

With that move, we no longer need to (and shouldn't) adjust gt_count as
a part of xe_info_probe_tile_count(), as that field will be initialized
later in xe_info_init().

v4:
  - Only probe for tile count if the default tile_count != 1 (just like
    was done in mmio_multi_tile_setup()). (CI)
v3:
  - Unchanged.
v2:
  - Use KUnit static stub so that we do not try to query hardware when
    running KUnit tests. (CI)
  - Tweak last paragraph of commit message to make it clearer.
    (Jonathan)

Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250818-gt_count-improvements-v4-1-ee12870c6f57@intel.com
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
drivers/gpu/drm/xe/tests/xe_pci.c
drivers/gpu/drm/xe/xe_mmio.c
drivers/gpu/drm/xe/xe_pci.c