From: Matthew Brost <matthew.brost@intel.com>
To: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH] drm/xe/pvc: Disable FPU Residue
Date: Wed, 12 Jul 2023 04:27:32 +0000 [thread overview]
Message-ID: <ZK4rtGVK9+HOyFfl@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20230710214459.14708-1-niranjana.vishwanathapura@intel.com>
On Mon, Jul 10, 2023 at 02:44:59PM -0700, Niranjana Vishwanathapura wrote:
> To reduce the power consumption disable FPU residue on some specific
> devices if total EUs are 1024.
>
> Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
> ---
> drivers/gpu/drm/xe/regs/xe_gt_regs.h | 1 +
> drivers/gpu/drm/xe/xe_gt_topology.c | 3 ---
> drivers/gpu/drm/xe/xe_gt_types.h | 3 +++
> drivers/gpu/drm/xe/xe_wa.c | 34 ++++++++++++++++++++++++++++
> 4 files changed, 38 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> index d654f3311351..16405b16fddf 100644
> --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> @@ -316,6 +316,7 @@
> #define DIS_FIX_EOT1_FLUSH REG_BIT(9)
>
> #define ROW_CHICKEN XE_REG_MCR(0xe4f0, XE_REG_OPTION_MASKED)
> +#define FPU_RESIDUE_DISABLE REG_BIT(14)
> #define UGM_BACKUP_MODE REG_BIT(13)
> #define MDQ_ARBITRATION_MODE REG_BIT(12)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_topology.c b/drivers/gpu/drm/xe/xe_gt_topology.c
> index d4bbd0a835c2..a2da443160ab 100644
> --- a/drivers/gpu/drm/xe/xe_gt_topology.c
> +++ b/drivers/gpu/drm/xe/xe_gt_topology.c
> @@ -11,9 +11,6 @@
> #include "xe_gt.h"
> #include "xe_mmio.h"
>
> -#define XE_MAX_DSS_FUSE_BITS (32 * XE_MAX_DSS_FUSE_REGS)
> -#define XE_MAX_EU_FUSE_BITS (32 * XE_MAX_EU_FUSE_REGS)
> -
> static void
> load_dss_mask(struct xe_gt *gt, xe_dss_mask_t mask, int numregs, ...)
> {
> diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h
> index 7d4de019f9a5..e4b894bd28bc 100644
> --- a/drivers/gpu/drm/xe/xe_gt_types.h
> +++ b/drivers/gpu/drm/xe/xe_gt_types.h
> @@ -25,7 +25,10 @@ enum xe_gt_type {
> };
>
> #define XE_MAX_DSS_FUSE_REGS 2
> +#define XE_MAX_DSS_FUSE_BITS (32 * XE_MAX_DSS_FUSE_REGS)
> +
> #define XE_MAX_EU_FUSE_REGS 1
> +#define XE_MAX_EU_FUSE_BITS (32 * XE_MAX_EU_FUSE_REGS)
>
> typedef unsigned long xe_dss_mask_t[BITS_TO_LONGS(32 * XE_MAX_DSS_FUSE_REGS)];
> typedef unsigned long xe_eu_mask_t[BITS_TO_LONGS(32 * XE_MAX_EU_FUSE_REGS)];
> diff --git a/drivers/gpu/drm/xe/xe_wa.c b/drivers/gpu/drm/xe/xe_wa.c
> index 5eaa9bed9d12..2852eaef6043 100644
> --- a/drivers/gpu/drm/xe/xe_wa.c
> +++ b/drivers/gpu/drm/xe/xe_wa.c
> @@ -13,6 +13,7 @@
> #include "regs/xe_engine_regs.h"
> #include "regs/xe_gt_regs.h"
> #include "regs/xe_regs.h"
> +#include "xe_device.h"
> #include "xe_device_types.h"
> #include "xe_force_wake.h"
> #include "xe_gt.h"
> @@ -256,6 +257,29 @@ static const struct xe_rtp_entry_sr gt_was[] = {
> {}
> };
>
> +static bool xe_wa_match_fpu_disable(const struct xe_gt *gt,
> + const struct xe_hw_engine *hwe)
> +{
> + struct xe_device *xe = gt_to_xe(hwe->gt);
s/hwe->gt/gt
> + struct xe_gt *gti;
Not needed, just use gt.
> + u16 eu_count = 0;
> + u8 gt_id;
> +
> + if (xe->info.devid != 0x0bd6)
Is there a define for 0x0bd6 or another way to test for this?
Matt
> + return false;
> +
> + for_each_gt(gti, xe, gt_id) {
> + u16 n_dss = bitmap_weight(gti->fuse_topo.c_dss_mask,
> + XE_MAX_DSS_FUSE_BITS);
> + u16 n_eu = bitmap_weight(gti->fuse_topo.eu_mask_per_dss,
> + XE_MAX_EU_FUSE_BITS);
> +
> + eu_count += n_dss * n_eu;
> + }
> +
> + return eu_count == 1024;
> +}
> +
> static const struct xe_rtp_entry_sr engine_was[] = {
> { XE_RTP_NAME("22010931296, 18011464164, 14010919138"),
> XE_RTP_RULES(GRAPHICS_VERSION(1200), ENGINE_CLASS(RENDER)),
> @@ -518,6 +542,16 @@ static const struct xe_rtp_entry_sr engine_was[] = {
> GRAPHICS_STEP(B0, C0)),
> XE_RTP_ACTIONS(SET(CACHE_MODE_SS, DISABLE_ECC))
> },
> + /*
> + * Not a workaournd, but for tuning power.
> + * FPU residue disable will lower the power consumption.
> + */
> + { XE_RTP_NAME("WaFPUResidueDisable"),
> + XE_RTP_RULES(PLATFORM(PVC),
> + FUNC(xe_rtp_match_first_render_or_compute),
> + FUNC(xe_wa_match_fpu_disable)),
> + XE_RTP_ACTIONS(SET(ROW_CHICKEN, FPU_RESIDUE_DISABLE)),
> + },
>
> /* Xe_LPG */
> { XE_RTP_NAME("14017856879"),
> --
> 2.21.0.rc0.32.g243a4c7e27
>
next prev parent reply other threads:[~2023-07-12 4:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 21:44 [Intel-xe] [PATCH] drm/xe/pvc: Disable FPU Residue Niranjana Vishwanathapura
2023-07-10 21:47 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe/pvc: Disable FPU Residue (rev2) Patchwork
2023-07-10 21:47 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-07-10 21:48 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-07-10 21:52 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-10 21:53 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-10 21:54 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-10 22:38 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-07-12 4:27 ` Matthew Brost [this message]
2023-07-17 10:28 ` [Intel-xe] [PATCH] drm/xe/pvc: Disable FPU Residue Niranjana Vishwanathapura
-- strict thread matches above, loose matches on Subject: below --
2023-07-18 7:16 Niranjana Vishwanathapura
2023-07-18 15:04 ` Lucas De Marchi
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=ZK4rtGVK9+HOyFfl@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=niranjana.vishwanathapura@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