Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/gt: Use CLASS() for forcewake in xe_gt_enable_comp_1wcoh

Adopt the scoped forcewake management using CLASS(xe_force_wake, ...)
to simplify the code and ensure proper resource release.

Cc: Xin Wang <x.wang@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Xin Wang <x.wang@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/20260123180425.3262944-2-shuicheng.lin@intel.com

authored by

Shuicheng Lin and committed by
Ashutosh Dixit
6edeabac d043b959

+2 -5
+2 -5
drivers/gpu/drm/xe/xe_gt.c
··· 141 141 static void xe_gt_enable_comp_1wcoh(struct xe_gt *gt) 142 142 { 143 143 struct xe_device *xe = gt_to_xe(gt); 144 - unsigned int fw_ref; 145 144 u32 reg; 146 145 147 146 if (IS_SRIOV_VF(xe)) 148 147 return; 149 148 150 149 if (GRAPHICS_VER(xe) >= 30 && xe->info.has_flat_ccs) { 151 - fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT); 152 - if (!fw_ref) 150 + CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT); 151 + if (!fw_ref.domains) 153 152 return; 154 153 155 154 reg = xe_gt_mcr_unicast_read_any(gt, XE2_GAMREQSTRM_CTRL); ··· 162 163 reg |= EN_CMP_1WCOH_GW; 163 164 xe_gt_mcr_multicast_write(gt, XE2_GAMWALK_CTRL_3D, reg); 164 165 } 165 - 166 - xe_force_wake_put(gt_to_fw(gt), fw_ref); 167 166 } 168 167 } 169 168