Commit 72e8d73b authored by Francois Dugast's avatar Francois Dugast Committed by Rodrigo Vivi

drm/xe: Cleanup style warnings and errors

Fix 6 errors and 20 warnings reported by checkpatch.pl.
Signed-off-by: default avatarFrancois Dugast <francois.dugast@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent ea82d5aa
...@@ -1831,7 +1831,7 @@ int xe_bo_lock(struct xe_bo *bo, struct ww_acquire_ctx *ww, ...@@ -1831,7 +1831,7 @@ int xe_bo_lock(struct xe_bo *bo, struct ww_acquire_ctx *ww,
XE_BUG_ON(!ww); XE_BUG_ON(!ww);
tv_bo.num_shared = num_resv; tv_bo.num_shared = num_resv;
tv_bo.bo = &bo->ttm;; tv_bo.bo = &bo->ttm;
list_add_tail(&tv_bo.head, &objs); list_add_tail(&tv_bo.head, &objs);
return ttm_eu_reserve_buffers(ww, &objs, intr, &dups); return ttm_eu_reserve_buffers(ww, &objs, intr, &dups);
......
...@@ -273,7 +273,7 @@ static void init_steering_inst0(struct xe_gt *gt) ...@@ -273,7 +273,7 @@ static void init_steering_inst0(struct xe_gt *gt)
static const struct { static const struct {
const char *name; const char *name;
void (*init)(struct xe_gt *); void (*init)(struct xe_gt *gt);
} xe_steering_types[] = { } xe_steering_types[] = {
[L3BANK] = { "L3BANK", init_steering_l3bank }, [L3BANK] = { "L3BANK", init_steering_l3bank },
[MSLICE] = { "MSLICE", init_steering_mslice }, [MSLICE] = { "MSLICE", init_steering_mslice },
......
...@@ -37,10 +37,8 @@ void xe_gt_sysfs_init(struct xe_gt *gt) ...@@ -37,10 +37,8 @@ void xe_gt_sysfs_init(struct xe_gt *gt)
int err; int err;
kg = kzalloc(sizeof(*kg), GFP_KERNEL); kg = kzalloc(sizeof(*kg), GFP_KERNEL);
if (!kg) { if (!kg)
drm_warn(&xe->drm, "Allocating kobject failed.\n");
return; return;
}
kobject_init(&kg->base, &xe_gt_sysfs_kobj_type); kobject_init(&kg->base, &xe_gt_sysfs_kobj_type);
kg->gt = gt; kg->gt = gt;
......
...@@ -396,14 +396,12 @@ static int guc_wait_ucode(struct xe_guc *guc) ...@@ -396,14 +396,12 @@ static int guc_wait_ucode(struct xe_guc *guc)
struct drm_printer p = drm_info_printer(drm->dev); struct drm_printer p = drm_info_printer(drm->dev);
drm_info(drm, "GuC load failed: status = 0x%08X\n", status); drm_info(drm, "GuC load failed: status = 0x%08X\n", status);
drm_info(drm, "GuC load failed: status: Reset = %d, " drm_info(drm, "GuC load failed: status: Reset = %d, BootROM = 0x%02X, UKernel = 0x%02X, MIA = 0x%02X, Auth = 0x%02X\n",
"BootROM = 0x%02X, UKernel = 0x%02X, " REG_FIELD_GET(GS_MIA_IN_RESET, status),
"MIA = 0x%02X, Auth = 0x%02X\n", REG_FIELD_GET(GS_BOOTROM_MASK, status),
REG_FIELD_GET(GS_MIA_IN_RESET, status), REG_FIELD_GET(GS_UKERNEL_MASK, status),
REG_FIELD_GET(GS_BOOTROM_MASK, status), REG_FIELD_GET(GS_MIA_MASK, status),
REG_FIELD_GET(GS_UKERNEL_MASK, status), REG_FIELD_GET(GS_AUTH_STATUS_MASK, status));
REG_FIELD_GET(GS_MIA_MASK, status),
REG_FIELD_GET(GS_AUTH_STATUS_MASK, status));
if ((status & GS_BOOTROM_MASK) == GS_BOOTROM_RSA_FAILED) { if ((status & GS_BOOTROM_MASK) == GS_BOOTROM_RSA_FAILED) {
drm_info(drm, "GuC firmware signature verification failed\n"); drm_info(drm, "GuC firmware signature verification failed\n");
......
...@@ -104,7 +104,7 @@ struct xe_hw_engine { ...@@ -104,7 +104,7 @@ struct xe_hw_engine {
/** @fence_irq: fence IRQ to run when a hw engine IRQ is received */ /** @fence_irq: fence IRQ to run when a hw engine IRQ is received */
struct xe_hw_fence_irq *fence_irq; struct xe_hw_fence_irq *fence_irq;
/** @irq_handler: IRQ handler to run when hw engine IRQ is received */ /** @irq_handler: IRQ handler to run when hw engine IRQ is received */
void (*irq_handler)(struct xe_hw_engine *, u16); void (*irq_handler)(struct xe_hw_engine *hwe, u16 intr_vec);
/** @engine_id: id for this hw engine */ /** @engine_id: id for this hw engine */
enum xe_hw_engine_id engine_id; enum xe_hw_engine_id engine_id;
}; };
......
// SPDX-License-Identifier: MIT /* SPDX-License-Identifier: MIT */
/* /*
* Copyright © 2022 Intel Corporation * Copyright © 2022 Intel Corporation
*/ */
......
...@@ -475,7 +475,7 @@ static void emit_pte(struct xe_migrate *m, ...@@ -475,7 +475,7 @@ static void emit_pte(struct xe_migrate *m,
bb->cs[bb->len++] = lower_32_bits(addr); bb->cs[bb->len++] = lower_32_bits(addr);
bb->cs[bb->len++] = upper_32_bits(addr); bb->cs[bb->len++] = upper_32_bits(addr);
xe_res_next(cur, min(size, (u32)PAGE_SIZE)); xe_res_next(cur, min_t(u32, size, PAGE_SIZE));
cur_ofs += 8; cur_ofs += 8;
} }
} }
......
...@@ -89,18 +89,30 @@ void xe_reg_whitelist_print_entry(struct drm_printer *p, unsigned int indent, ...@@ -89,18 +89,30 @@ void xe_reg_whitelist_print_entry(struct drm_printer *p, unsigned int indent,
deny = val & RING_FORCE_TO_NONPRIV_DENY; deny = val & RING_FORCE_TO_NONPRIV_DENY;
switch (val & RING_FORCE_TO_NONPRIV_RANGE_MASK) { switch (val & RING_FORCE_TO_NONPRIV_RANGE_MASK) {
case RING_FORCE_TO_NONPRIV_RANGE_4: range_bit = 4; break; case RING_FORCE_TO_NONPRIV_RANGE_4:
case RING_FORCE_TO_NONPRIV_RANGE_16: range_bit = 6; break; range_bit = 4;
case RING_FORCE_TO_NONPRIV_RANGE_64: range_bit = 8; break; break;
case RING_FORCE_TO_NONPRIV_RANGE_16:
range_bit = 6;
break;
case RING_FORCE_TO_NONPRIV_RANGE_64:
range_bit = 8;
break;
} }
range_start = reg & REG_GENMASK(25, range_bit); range_start = reg & REG_GENMASK(25, range_bit);
range_end = range_start | REG_GENMASK(range_bit, 0); range_end = range_start | REG_GENMASK(range_bit, 0);
switch (val & RING_FORCE_TO_NONPRIV_ACCESS_MASK) { switch (val & RING_FORCE_TO_NONPRIV_ACCESS_MASK) {
case RING_FORCE_TO_NONPRIV_ACCESS_RW: access_str = "rw"; break; case RING_FORCE_TO_NONPRIV_ACCESS_RW:
case RING_FORCE_TO_NONPRIV_ACCESS_RD: access_str = "read"; break; access_str = "rw";
case RING_FORCE_TO_NONPRIV_ACCESS_WR: access_str = "write"; break; break;
case RING_FORCE_TO_NONPRIV_ACCESS_RD:
access_str = "read";
break;
case RING_FORCE_TO_NONPRIV_ACCESS_WR:
access_str = "write";
break;
} }
drm_printf_indent(p, indent, "REG[0x%x-0x%x]: %s %s access\n", drm_printf_indent(p, indent, "REG[0x%x-0x%x]: %s %s access\n",
......
...@@ -51,15 +51,14 @@ struct xe_res_cursor { ...@@ -51,15 +51,14 @@ struct xe_res_cursor {
static struct drm_buddy *xe_res_get_buddy(struct ttm_resource *res) static struct drm_buddy *xe_res_get_buddy(struct ttm_resource *res)
{ {
struct xe_device *xe = ttm_to_xe_device(res->bo->bdev); struct xe_device *xe = ttm_to_xe_device(res->bo->bdev);
struct ttm_resource_manager *mgr;
if (res->mem_type != XE_PL_STOLEN) { if (res->mem_type != XE_PL_STOLEN)
return &xe->tiles[res->mem_type - XE_PL_VRAM0].mem.vram_mgr->mm; return &xe->tiles[res->mem_type - XE_PL_VRAM0].mem.vram_mgr->mm;
} else {
struct ttm_resource_manager *mgr =
ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
return &to_xe_ttm_vram_mgr(mgr)->mm; mgr = ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
}
return &to_xe_ttm_vram_mgr(mgr)->mm;
} }
/** /**
......
...@@ -47,12 +47,10 @@ ...@@ -47,12 +47,10 @@
*/ */
/* Default WOPCM size is 2MB from Gen11, 1MB on previous platforms */ /* Default WOPCM size is 2MB from Gen11, 1MB on previous platforms */
#define DGFX_WOPCM_SIZE SZ_4M /* FIXME: Larger size require /* FIXME: Larger size require for 2 tile PVC, do a proper probe sooner or later */
for 2 tile PVC, do a proper #define DGFX_WOPCM_SIZE SZ_4M
probe sooner or later */ /* FIXME: Larger size require for MTL, do a proper probe sooner or later */
#define MTL_WOPCM_SIZE SZ_4M /* FIXME: Larger size require #define MTL_WOPCM_SIZE SZ_4M
for MTL, do a proper probe
sooner or later */
#define GEN11_WOPCM_SIZE SZ_2M #define GEN11_WOPCM_SIZE SZ_2M
#define GEN12_MAX_WOPCM_SIZE SZ_8M #define GEN12_MAX_WOPCM_SIZE SZ_8M
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment