Commit 7ecea18e authored by Himal Prasad Ghimiray's avatar Himal Prasad Ghimiray Committed by Rodrigo Vivi

drm/xe: Cleanup force wake registers bit definitions

- Remove unused bit definitions.
- Driver uses BIT(0) for waking/sleeping the domain and since the
registers are masked respective mask bit BIT(16) needs to be set. Use
defines for these bits and use them in domain initialization.

v3
- Use defines within domain_init

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>
Suggested-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: default avatarBadal Nilawar <badal.nilawar@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240606085720.1327152-1-himal.prasad.ghimiray@intel.comSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 3d420e9f
...@@ -487,9 +487,11 @@ ...@@ -487,9 +487,11 @@
((ccs) << ((cslice) * CCS_MODE_CSLICE_WIDTH)) ((ccs) << ((cslice) * CCS_MODE_CSLICE_WIDTH))
#define FORCEWAKE_ACK_GT XE_REG(0x130044) #define FORCEWAKE_ACK_GT XE_REG(0x130044)
#define FORCEWAKE_KERNEL BIT(0)
#define FORCEWAKE_USER BIT(1) /* Applicable for all FORCEWAKE_DOMAIN and FORCEWAKE_ACK_DOMAIN regs */
#define FORCEWAKE_KERNEL_FALLBACK BIT(15) #define FORCEWAKE_KERNEL 0
#define FORCEWAKE_MT(bit) BIT(bit)
#define FORCEWAKE_MT_MASK(bit) BIT((bit) + 16)
#define MTL_MEDIA_PERF_LIMIT_REASONS XE_REG(0x138030) #define MTL_MEDIA_PERF_LIMIT_REASONS XE_REG(0x138030)
#define MTL_MEDIA_MC6 XE_REG(0x138048) #define MTL_MEDIA_MC6 XE_REG(0x138048)
......
...@@ -28,13 +28,13 @@ fw_to_xe(struct xe_force_wake *fw) ...@@ -28,13 +28,13 @@ fw_to_xe(struct xe_force_wake *fw)
static void domain_init(struct xe_force_wake_domain *domain, static void domain_init(struct xe_force_wake_domain *domain,
enum xe_force_wake_domain_id id, enum xe_force_wake_domain_id id,
struct xe_reg reg, struct xe_reg ack, u32 val, u32 mask) struct xe_reg reg, struct xe_reg ack)
{ {
domain->id = id; domain->id = id;
domain->reg_ctl = reg; domain->reg_ctl = reg;
domain->reg_ack = ack; domain->reg_ack = ack;
domain->val = val; domain->val = FORCEWAKE_MT(FORCEWAKE_KERNEL);
domain->mask = mask; domain->mask = FORCEWAKE_MT_MASK(FORCEWAKE_KERNEL);
} }
void xe_force_wake_init_gt(struct xe_gt *gt, struct xe_force_wake *fw) void xe_force_wake_init_gt(struct xe_gt *gt, struct xe_force_wake *fw)
...@@ -51,14 +51,12 @@ void xe_force_wake_init_gt(struct xe_gt *gt, struct xe_force_wake *fw) ...@@ -51,14 +51,12 @@ void xe_force_wake_init_gt(struct xe_gt *gt, struct xe_force_wake *fw)
domain_init(&fw->domains[XE_FW_DOMAIN_ID_GT], domain_init(&fw->domains[XE_FW_DOMAIN_ID_GT],
XE_FW_DOMAIN_ID_GT, XE_FW_DOMAIN_ID_GT,
FORCEWAKE_GT, FORCEWAKE_GT,
FORCEWAKE_ACK_GT_MTL, FORCEWAKE_ACK_GT_MTL);
BIT(0), BIT(16));
} else { } else {
domain_init(&fw->domains[XE_FW_DOMAIN_ID_GT], domain_init(&fw->domains[XE_FW_DOMAIN_ID_GT],
XE_FW_DOMAIN_ID_GT, XE_FW_DOMAIN_ID_GT,
FORCEWAKE_GT, FORCEWAKE_GT,
FORCEWAKE_ACK_GT, FORCEWAKE_ACK_GT);
BIT(0), BIT(16));
} }
} }
...@@ -73,8 +71,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw) ...@@ -73,8 +71,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)
domain_init(&fw->domains[XE_FW_DOMAIN_ID_RENDER], domain_init(&fw->domains[XE_FW_DOMAIN_ID_RENDER],
XE_FW_DOMAIN_ID_RENDER, XE_FW_DOMAIN_ID_RENDER,
FORCEWAKE_RENDER, FORCEWAKE_RENDER,
FORCEWAKE_ACK_RENDER, FORCEWAKE_ACK_RENDER);
BIT(0), BIT(16));
for (i = XE_HW_ENGINE_VCS0, j = 0; i <= XE_HW_ENGINE_VCS7; ++i, ++j) { for (i = XE_HW_ENGINE_VCS0, j = 0; i <= XE_HW_ENGINE_VCS7; ++i, ++j) {
if (!(gt->info.engine_mask & BIT(i))) if (!(gt->info.engine_mask & BIT(i)))
...@@ -83,8 +80,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw) ...@@ -83,8 +80,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)
domain_init(&fw->domains[XE_FW_DOMAIN_ID_MEDIA_VDBOX0 + j], domain_init(&fw->domains[XE_FW_DOMAIN_ID_MEDIA_VDBOX0 + j],
XE_FW_DOMAIN_ID_MEDIA_VDBOX0 + j, XE_FW_DOMAIN_ID_MEDIA_VDBOX0 + j,
FORCEWAKE_MEDIA_VDBOX(j), FORCEWAKE_MEDIA_VDBOX(j),
FORCEWAKE_ACK_MEDIA_VDBOX(j), FORCEWAKE_ACK_MEDIA_VDBOX(j));
BIT(0), BIT(16));
} }
for (i = XE_HW_ENGINE_VECS0, j = 0; i <= XE_HW_ENGINE_VECS3; ++i, ++j) { for (i = XE_HW_ENGINE_VECS0, j = 0; i <= XE_HW_ENGINE_VECS3; ++i, ++j) {
...@@ -94,16 +90,14 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw) ...@@ -94,16 +90,14 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)
domain_init(&fw->domains[XE_FW_DOMAIN_ID_MEDIA_VEBOX0 + j], domain_init(&fw->domains[XE_FW_DOMAIN_ID_MEDIA_VEBOX0 + j],
XE_FW_DOMAIN_ID_MEDIA_VEBOX0 + j, XE_FW_DOMAIN_ID_MEDIA_VEBOX0 + j,
FORCEWAKE_MEDIA_VEBOX(j), FORCEWAKE_MEDIA_VEBOX(j),
FORCEWAKE_ACK_MEDIA_VEBOX(j), FORCEWAKE_ACK_MEDIA_VEBOX(j));
BIT(0), BIT(16));
} }
if (gt->info.engine_mask & BIT(XE_HW_ENGINE_GSCCS0)) if (gt->info.engine_mask & BIT(XE_HW_ENGINE_GSCCS0))
domain_init(&fw->domains[XE_FW_DOMAIN_ID_GSC], domain_init(&fw->domains[XE_FW_DOMAIN_ID_GSC],
XE_FW_DOMAIN_ID_GSC, XE_FW_DOMAIN_ID_GSC,
FORCEWAKE_GSC, FORCEWAKE_GSC,
FORCEWAKE_ACK_GSC, FORCEWAKE_ACK_GSC);
BIT(0), BIT(16));
} }
static void domain_wake(struct xe_gt *gt, struct xe_force_wake_domain *domain) static void domain_wake(struct xe_gt *gt, struct xe_force_wake_domain *domain)
......
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