Skip to content

Commit 498c178

Browse files
vsbelgaumgregkh
authored andcommitted
drm/xe: Enable media sampler power gating
[ Upstream commit 1852d27 ] Where applicable, enable media sampler power gating. Also, add it to the powergate_info debugfs. v2: Remove the sampler powergate status since it is cleared quickly anyway. v3: Use vcs mask (Rodrigo) and fix the version check for media v4: Remove extra spaces v5: Media samplers are independent of vcs mask, use Media version 1255 (Matt Roper) Fixes: 38e8c41 ("drm/xe: Enable Coarse Power Gating") Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Link: https://lore.kernel.org/r/20251010011047.2047584-1-vinay.belgaumkar@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (cherry picked from commit 4cbc086) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8db8d64 commit 498c178

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/gpu/drm/xe/regs/xe_gt_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@
342342
#define POWERGATE_ENABLE XE_REG(0xa210)
343343
#define RENDER_POWERGATE_ENABLE REG_BIT(0)
344344
#define MEDIA_POWERGATE_ENABLE REG_BIT(1)
345+
#define MEDIA_SAMPLERS_POWERGATE_ENABLE REG_BIT(2)
345346
#define VDN_HCP_POWERGATE_ENABLE(n) REG_BIT(3 + 2 * (n))
346347
#define VDN_MFXVDENC_POWERGATE_ENABLE(n) REG_BIT(4 + 2 * (n))
347348

drivers/gpu/drm/xe/xe_gt_idle.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ void xe_gt_idle_enable_pg(struct xe_gt *gt)
124124
if (xe_gt_is_main_type(gt))
125125
gtidle->powergate_enable |= RENDER_POWERGATE_ENABLE;
126126

127+
if (MEDIA_VERx100(xe) >= 1100 && MEDIA_VERx100(xe) < 1255)
128+
gtidle->powergate_enable |= MEDIA_SAMPLERS_POWERGATE_ENABLE;
129+
127130
if (xe->info.platform != XE_DG1) {
128131
for (i = XE_HW_ENGINE_VCS0, j = 0; i <= XE_HW_ENGINE_VCS7; ++i, ++j) {
129132
if ((gt->info.engine_mask & BIT(i)))
@@ -246,6 +249,11 @@ int xe_gt_idle_pg_print(struct xe_gt *gt, struct drm_printer *p)
246249
drm_printf(p, "Media Slice%d Power Gate Status: %s\n", n,
247250
str_up_down(pg_status & media_slices[n].status_bit));
248251
}
252+
253+
if (MEDIA_VERx100(xe) >= 1100 && MEDIA_VERx100(xe) < 1255)
254+
drm_printf(p, "Media Samplers Power Gating Enabled: %s\n",
255+
str_yes_no(pg_enabled & MEDIA_SAMPLERS_POWERGATE_ENABLE));
256+
249257
return 0;
250258
}
251259

0 commit comments

Comments
 (0)