Skip to content

Commit 84b6f85

Browse files
ShuichengLinlucasdemarchi
authored andcommitted
drm/xe: Use xe_mmio_read32() to read mtcfg register
The mtcfg register is a 32-bit register and should therefore be accessed using xe_mmio_read32(). Other 3 changes per codestyle suggestion: " xe_mmio.c:83: CHECK: Alignment should match open parenthesis xe_mmio.c:131: CHECK: Comparison to NULL could be written "!xe->mmio.regs" xe_mmio.c:315: CHECK: line length of 103 exceeds 100 columns " Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Reviewed-by: Tejas Upadhyay <[email protected]> Cc: Matt Roper <[email protected]> Signed-off-by: Shuicheng Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matt Roper <[email protected]> (cherry picked from commit d2662cf) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 57b34cb commit 84b6f85

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/xe/xe_mmio.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ static void mmio_multi_tile_setup(struct xe_device *xe, size_t tile_mmio_size)
7575
* is fine as it's going to the root tile's mmio, that's
7676
* guaranteed to be initialized earlier in xe_mmio_probe_early()
7777
*/
78-
mtcfg = xe_mmio_read64_2x32(mmio, XEHP_MTCFG_ADDR);
78+
mtcfg = xe_mmio_read32(mmio, XEHP_MTCFG_ADDR);
7979
tile_count = REG_FIELD_GET(TILE_COUNT, mtcfg) + 1;
8080

8181
if (tile_count < xe->info.tile_count) {
8282
drm_info(&xe->drm, "tile_count: %d, reduced_tile_count %d\n",
83-
xe->info.tile_count, tile_count);
83+
xe->info.tile_count, tile_count);
8484
xe->info.tile_count = tile_count;
8585

8686
/*
@@ -128,7 +128,7 @@ int xe_mmio_probe_early(struct xe_device *xe)
128128
*/
129129
xe->mmio.size = pci_resource_len(pdev, GTTMMADR_BAR);
130130
xe->mmio.regs = pci_iomap(pdev, GTTMMADR_BAR, 0);
131-
if (xe->mmio.regs == NULL) {
131+
if (!xe->mmio.regs) {
132132
drm_err(&xe->drm, "failed to map registers\n");
133133
return -EIO;
134134
}
@@ -309,8 +309,8 @@ u64 xe_mmio_read64_2x32(struct xe_mmio *mmio, struct xe_reg reg)
309309
return (u64)udw << 32 | ldw;
310310
}
311311

312-
static int __xe_mmio_wait32(struct xe_mmio *mmio, struct xe_reg reg, u32 mask, u32 val, u32 timeout_us,
313-
u32 *out_val, bool atomic, bool expect_match)
312+
static int __xe_mmio_wait32(struct xe_mmio *mmio, struct xe_reg reg, u32 mask, u32 val,
313+
u32 timeout_us, u32 *out_val, bool atomic, bool expect_match)
314314
{
315315
ktime_t cur = ktime_get_raw();
316316
const ktime_t end = ktime_add_us(cur, timeout_us);

0 commit comments

Comments
 (0)