Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v3] drm/xe: Enable media sampler power gating
Date: Thu, 9 Oct 2025 15:50:23 -0400	[thread overview]
Message-ID: <aOgR_x2r9a_L1Pgm@intel.com> (raw)
In-Reply-To: <20251009184235.1929975-1-vinay.belgaumkar@intel.com>

On Thu, Oct 09, 2025 at 11:42:35AM -0700, Vinay Belgaumkar wrote:
> 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
> 
> Fixes: 38e8c4184ea0 ("drm/xe: Enable Coarse Power Gating")
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/regs/xe_gt_regs.h |  1 +
>  drivers/gpu/drm/xe/xe_gt_idle.c      | 11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> index 06cb6b02ec64..51f2a03847f9 100644
> --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> @@ -342,6 +342,7 @@
>  #define POWERGATE_ENABLE			XE_REG(0xa210)
>  #define   RENDER_POWERGATE_ENABLE		REG_BIT(0)
>  #define   MEDIA_POWERGATE_ENABLE		REG_BIT(1)
> +#define   MEDIA_SAMPLERS_POWERGATE_ENABLE	REG_BIT(2)
>  #define   VDN_HCP_POWERGATE_ENABLE(n)		REG_BIT(3 + 2 * (n))
>  #define   VDN_MFXVDENC_POWERGATE_ENABLE(n)	REG_BIT(4 + 2 * (n))
>  
> diff --git a/drivers/gpu/drm/xe/xe_gt_idle.c b/drivers/gpu/drm/xe/xe_gt_idle.c
> index f8950a52d0a4..0a112b8943b9 100644
> --- a/drivers/gpu/drm/xe/xe_gt_idle.c
> +++ b/drivers/gpu/drm/xe/xe_gt_idle.c
> @@ -118,12 +118,16 @@ void xe_gt_idle_enable_pg(struct xe_gt *gt)
>  	vcs_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_VIDEO_DECODE);
>  	vecs_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_VIDEO_ENHANCE);
>  
> -	if (vcs_mask || vecs_mask)
> +	if (vcs_mask || vecs_mask) {
>  		gtidle->powergate_enable = MEDIA_POWERGATE_ENABLE;
> +		if (MEDIA_VERx100(xe) >= 1100 && MEDIA_VERx100(xe) < 1270)
> +			gtidle->powergate_enable |= MEDIA_SAMPLERS_POWERGATE_ENABLE;
> +	}
>  
>  	if (xe_gt_is_main_type(gt))
>  		gtidle->powergate_enable |= RENDER_POWERGATE_ENABLE;
>  
> +
>  	if (xe->info.platform != XE_DG1) {
>  		for (i = XE_HW_ENGINE_VCS0, j = 0; i <= XE_HW_ENGINE_VCS7; ++i, ++j) {
>  			if ((gt->info.engine_mask & BIT(i)))
> @@ -245,7 +249,12 @@ int xe_gt_idle_pg_print(struct xe_gt *gt, struct drm_printer *p)
>  			if (gt->info.engine_mask & media_slices[n].engines)
>  				drm_printf(p, "Media Slice%d Power Gate Status: %s\n", n,
>  					   str_up_down(pg_status & media_slices[n].status_bit));
> +
> +		if (MEDIA_VERx100(xe) >= 1100 && MEDIA_VERx100(xe) < 1270)
> +			drm_printf(p, "Media Samplers Power Gating Enabled: %s\n",
> +				   str_yes_no(pg_enabled & MEDIA_SAMPLERS_POWERGATE_ENABLE));
>  	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.38.1
> 

  parent reply	other threads:[~2025-10-09 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-09 18:42 [PATCH v3] drm/xe: Enable media sampler power gating Vinay Belgaumkar
2025-10-09 18:57 ` ✗ CI.checkpatch: warning for drm/xe: Enable media sampler power gating (rev3) Patchwork
2025-10-09 18:59 ` ✓ CI.KUnit: success " Patchwork
2025-10-09 19:37 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-09 19:50 ` Rodrigo Vivi [this message]
2025-10-10  3:48 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aOgR_x2r9a_L1Pgm@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=vinay.belgaumkar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox