]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe: Standardize power gate registers
authorRiana Tauro <riana.tauro@intel.com>
Fri, 24 May 2024 07:09:15 +0000 (12:39 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 28 May 2024 16:29:42 +0000 (12:29 -0400)
Standardize power gate registers

No functional changes

v2: change commit message (Rodrigo)

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240524070916.143022-2-riana.tauro@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/regs/xe_gt_regs.h
drivers/gpu/drm/xe/xe_gt_idle.c
drivers/gpu/drm/xe/xe_wa.c

index 9cacdcfe27ffe36b76eb04dfd1eea58f4713dbdd..7c173db7d585daf29c64bdbd420088000e8a7962 100644 (file)
 
 #define FORCEWAKE_GT                           XE_REG(0xa188)
 
-#define PG_ENABLE                              XE_REG(0xa210)
-#define   VD2_MFXVDENC_POWERGATE_ENABLE                REG_BIT(8)
-#define   VD2_HCP_POWERGATE_ENABLE             REG_BIT(7)
-#define   VD0_MFXVDENC_POWERGATE_ENABLE                REG_BIT(4)
-#define   VD0_HCP_POWERGATE_ENABLE             REG_BIT(3)
+#define POWERGATE_ENABLE                       XE_REG(0xa210)
+#define   VDN_HCP_POWERGATE_ENABLE(n)          REG_BIT(3 + 2 * (n))
+#define   VDN_MFXVDENC_POWERGATE_ENABLE(n)     REG_BIT(4 + 2 * (n))
 
 #define CTC_MODE                               XE_REG(0xa26c)
 #define   CTC_SHIFT_PARAMETER_MASK             REG_GENMASK(2, 1)
index 749b7f4b688faac2d8909772a677867eadb86620..6790b567496515520ff07d640c924efcb9adab60 100644 (file)
@@ -202,7 +202,7 @@ void xe_gt_idle_disable_c6(struct xe_gt *gt)
        xe_device_assert_mem_access(gt_to_xe(gt));
        xe_force_wake_assert_held(gt_to_fw(gt), XE_FORCEWAKE_ALL);
 
-       xe_mmio_write32(gt, PG_ENABLE, 0);
+       xe_mmio_write32(gt, POWERGATE_ENABLE, 0);
        xe_mmio_write32(gt, RC_CONTROL, 0);
        xe_mmio_write32(gt, RC_STATE, 0);
 }
index 05db53c1448c5acc945d2d1643cc409365c189cc..64bc595fc727a2dfaf8cc50b9bac9b6cfbebf263 100644 (file)
@@ -238,11 +238,11 @@ static const struct xe_rtp_entry_sr gt_was[] = {
        },
        { XE_RTP_NAME("14020316580"),
          XE_RTP_RULES(MEDIA_VERSION(1301)),
-         XE_RTP_ACTIONS(CLR(PG_ENABLE,
-                            VD0_HCP_POWERGATE_ENABLE |
-                            VD0_MFXVDENC_POWERGATE_ENABLE |
-                            VD2_HCP_POWERGATE_ENABLE |
-                            VD2_MFXVDENC_POWERGATE_ENABLE)),
+         XE_RTP_ACTIONS(CLR(POWERGATE_ENABLE,
+                            VDN_HCP_POWERGATE_ENABLE(0) |
+                            VDN_MFXVDENC_POWERGATE_ENABLE(0) |
+                            VDN_HCP_POWERGATE_ENABLE(2) |
+                            VDN_MFXVDENC_POWERGATE_ENABLE(2))),
        },
        { XE_RTP_NAME("14019449301"),
          XE_RTP_RULES(MEDIA_VERSION(1301), ENGINE_CLASS(VIDEO_DECODE)),