Skip to content

Commit 244091e

Browse files
mattropejunxiaoc
authored andcommitted
drm/xe: Remove unused "mmio_ext" code
The "mmio_ext" and 'REG_EXT" code is currently unused on any existing platform. Going forward, this also isn't the design we want to use for any future platforms/features either, so we should just go ahead and remove the dead code to avoid confusion. mmio_ext was originally added in an attempt to hack around the early (mis)design of the Xe driver, which used xe_gt as the target for all register MMIO access, even those completely unrelated to the GT subunit of the hardware. With the introduction of commit 34953ee ("drm/xe: Create dedicated xe_mmio structure") and its follow-up patches, that misdesign has been corrected and access to register MMIO regions specific to hardware units is now done through xe_mmio structures which encapsulate an iomap, region size, and some other metadata. Although all of the registers used by the driver today happen to fall within one specific PCI BAR region, and thus re-use a single device-wide iomap, there's no requirement that this stay true for future platforms or features. I.e., if a future platform adds a new 'foo' hardware unit that exists at a different area in the BAR, or even in a completely different BAR, then that would be handled by doing a separate iomap of that unit's register region and wrapping it in its own 'struct xe_mmio foo_regs' structure. The pointer to the new 'foo_regs' could be placed within the xe_device, xe_tile, xe_gt, etc., according to where the new hardware unit falls within the current hardware hierarchy. This effectively reverts the following commits, although parts of these commits had already vanished or changed with the earlier xe_mmio refactor work: - commit 399a133 ("drm/xe: add 28-bit address support in struct xe_reg") - commit fdef72e ("drm/xe: add a flag to bypass multi-tile config from MTCFG reg") - commit 866b2b1 ("drm/xe: add MMIO extension support flags") - commit ef29b39 ("drm/xe: map MMIO BAR according to the num of tiles in device desc") - commit a4e2f3a ("drm/xe: refactor xe_mmio_probe_tiles to support MMIO extension") Cc: Lucas De Marchi <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Koby Elbaz <[email protected]> Acked-by: Maciej Patelczyk <[email protected]> Reviewed-by: Reviewed-by: Lucas De Marchi <[email protected]> Reviewed-by: Stuart Summers <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Matt Roper <[email protected]>
1 parent a4e1951 commit 244091e

File tree

5 files changed

+1
-70
lines changed

5 files changed

+1
-70
lines changed

drivers/gpu/drm/xe/regs/xe_reg_defs.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct xe_reg {
2121
union {
2222
struct {
2323
/** @addr: address */
24-
u32 addr:28;
24+
u32 addr:22;
2525
/**
2626
* @masked: register is "masked", with upper 16bits used
2727
* to identify the bits that are updated on the lower
@@ -41,10 +41,6 @@ struct xe_reg {
4141
* @vf: register is accessible from the Virtual Function.
4242
*/
4343
u32 vf:1;
44-
/**
45-
* @ext: access MMIO extension space for current register.
46-
*/
47-
u32 ext:1;
4844
};
4945
/** @raw: Raw value with both address and options */
5046
u32 raw;
@@ -111,16 +107,6 @@ struct xe_reg_mcr {
111107
*/
112108
#define XE_REG(r_, ...) ((const struct xe_reg)XE_REG_INITIALIZER(r_, ##__VA_ARGS__))
113109

114-
/**
115-
* XE_REG_EXT - Create a struct xe_reg from extension offset and additional
116-
* flags
117-
* @r_: Register extension offset
118-
* @...: Additional options like access mode. See struct xe_reg for available
119-
* options.
120-
*/
121-
#define XE_REG_EXT(r_, ...) \
122-
((const struct xe_reg)XE_REG_INITIALIZER(r_, ##__VA_ARGS__, .ext = 1))
123-
124110
/**
125111
* XE_REG_MCR - Create a struct xe_reg_mcr from offset and additional flags
126112
* @r_: Register offset

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,6 @@ struct xe_tile {
186186
*/
187187
struct xe_mmio mmio;
188188

189-
/**
190-
* @mmio_ext: MMIO-extension info for a tile.
191-
*
192-
* Each tile has its own additional 256MB (28-bit) MMIO-extension space.
193-
*/
194-
struct xe_mmio mmio_ext;
195-
196189
/** @mem: memory management info for tile */
197190
struct {
198191
/**
@@ -263,8 +256,6 @@ struct xe_device {
263256
const char *graphics_name;
264257
/** @info.media_name: media IP name */
265258
const char *media_name;
266-
/** @info.tile_mmio_ext_size: size of MMIO extension space, per-tile */
267-
u32 tile_mmio_ext_size;
268259
/** @info.graphics_verx100: graphics IP version */
269260
u32 graphics_verx100;
270261
/** @info.media_verx100: media IP version */
@@ -314,8 +305,6 @@ struct xe_device {
314305
u8 has_heci_gscfi:1;
315306
/** @info.has_llc: Device has a shared CPU+GPU last level cache */
316307
u8 has_llc:1;
317-
/** @info.has_mmio_ext: Device has extra MMIO address range */
318-
u8 has_mmio_ext:1;
319308
/** @info.has_range_tlb_invalidation: Has range based TLB invalidations */
320309
u8 has_range_tlb_invalidation:1;
321310
/** @info.has_sriov: Supports SR-IOV */

drivers/gpu/drm/xe/xe_mmio.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -103,50 +103,11 @@ static void mmio_multi_tile_setup(struct xe_device *xe, size_t tile_mmio_size)
103103
}
104104
}
105105

106-
/*
107-
* On top of all the multi-tile MMIO space there can be a platform-dependent
108-
* extension for each tile, resulting in a layout like below:
109-
*
110-
* .----------------------. <- ext_base + tile_count * tile_mmio_ext_size
111-
* | .... |
112-
* |----------------------| <- ext_base + 2 * tile_mmio_ext_size
113-
* | tile1->mmio_ext.regs |
114-
* |----------------------| <- ext_base + 1 * tile_mmio_ext_size
115-
* | tile0->mmio_ext.regs |
116-
* |======================| <- ext_base = tile_count * tile_mmio_size
117-
* | |
118-
* | mmio.regs |
119-
* | |
120-
* '----------------------' <- 0MB
121-
*
122-
* Set up the tile[]->mmio_ext pointers/sizes.
123-
*/
124-
static void mmio_extension_setup(struct xe_device *xe, size_t tile_mmio_size,
125-
size_t tile_mmio_ext_size)
126-
{
127-
struct xe_tile *tile;
128-
void __iomem *regs;
129-
u8 id;
130-
131-
if (!xe->info.has_mmio_ext)
132-
return;
133-
134-
regs = xe->mmio.regs + tile_mmio_size * xe->info.tile_count;
135-
for_each_tile(tile, xe, id) {
136-
tile->mmio_ext.regs_size = tile_mmio_ext_size;
137-
tile->mmio_ext.regs = regs;
138-
tile->mmio_ext.tile = tile;
139-
regs += tile_mmio_ext_size;
140-
}
141-
}
142-
143106
int xe_mmio_probe_tiles(struct xe_device *xe)
144107
{
145108
size_t tile_mmio_size = SZ_16M;
146-
size_t tile_mmio_ext_size = xe->info.tile_mmio_ext_size;
147109

148110
mmio_multi_tile_setup(xe, tile_mmio_size);
149-
mmio_extension_setup(xe, tile_mmio_size, tile_mmio_ext_size);
150111

151112
return devm_add_action_or_reset(xe->drm.dev, tiles_fini, xe);
152113
}

drivers/gpu/drm/xe/xe_pci.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ struct xe_device_desc {
6161
u8 has_heci_gscfi:1;
6262
u8 has_heci_cscfi:1;
6363
u8 has_llc:1;
64-
u8 has_mmio_ext:1;
6564
u8 has_sriov:1;
6665
u8 skip_guc_pc:1;
6766
u8 skip_mtcfg:1;
@@ -619,7 +618,6 @@ static int xe_info_init_early(struct xe_device *xe,
619618
xe->info.has_heci_gscfi = desc->has_heci_gscfi;
620619
xe->info.has_heci_cscfi = desc->has_heci_cscfi;
621620
xe->info.has_llc = desc->has_llc;
622-
xe->info.has_mmio_ext = desc->has_mmio_ext;
623621
xe->info.has_sriov = desc->has_sriov;
624622
xe->info.skip_guc_pc = desc->skip_guc_pc;
625623
xe->info.skip_mtcfg = desc->skip_mtcfg;
@@ -679,7 +677,6 @@ static int xe_info_init(struct xe_device *xe,
679677

680678
xe->info.graphics_name = graphics_desc->name;
681679
xe->info.media_name = media_desc ? media_desc->name : "none";
682-
xe->info.tile_mmio_ext_size = graphics_desc->tile_mmio_ext_size;
683680

684681
xe->info.dma_mask_size = graphics_desc->dma_mask_size;
685682
xe->info.vram_flags = graphics_desc->vram_flags;

drivers/gpu/drm/xe/xe_pci_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ struct xe_graphics_desc {
2020

2121
u64 hw_engine_mask; /* hardware engines provided by graphics IP */
2222

23-
u32 tile_mmio_ext_size; /* size of MMIO extension space, per-tile */
24-
2523
u8 max_remote_tiles:2;
2624

2725
u8 has_asid:1;

0 commit comments

Comments
 (0)