]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/vram: Use scope-based forcewake
authorMatt Roper <matthew.d.roper@intel.com>
Tue, 18 Nov 2025 16:43:59 +0000 (08:43 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Wed, 19 Nov 2025 19:58:58 +0000 (11:58 -0800)
Switch VRAM code to use scope-based forcewake for consistency with other
parts of the driver.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patch.msgid.link/20251118164338.3572146-49-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_vram.c

index 0e10da790cc5dbe5e390988b5db5a021561fbc61..0a645e76e5faf39fbbc239cfbb2cafda428da3f3 100644 (file)
@@ -186,12 +186,11 @@ static int determine_lmem_bar_size(struct xe_device *xe, struct xe_vram_region *
 static int get_flat_ccs_offset(struct xe_gt *gt, u64 tile_size, u64 *poffset)
 {
        struct xe_device *xe = gt_to_xe(gt);
-       unsigned int fw_ref;
        u64 offset;
        u32 reg;
 
-       fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
-       if (!fw_ref)
+       CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT);
+       if (!fw_ref.domains)
                return -ETIMEDOUT;
 
        if (GRAPHICS_VER(xe) >= 20) {
@@ -223,7 +222,6 @@ static int get_flat_ccs_offset(struct xe_gt *gt, u64 tile_size, u64 *poffset)
                offset = (u64)REG_FIELD_GET(XEHP_FLAT_CCS_PTR, reg) * SZ_64K;
        }
 
-       xe_force_wake_put(gt_to_fw(gt), fw_ref);
        *poffset = offset;
 
        return 0;