Skip to content

Commit 8f70f1e

Browse files
bnilawaranshuma1
authored andcommitted
drm/i915/mtl: Add Wa_14017073508 for SAMedia
This workaround is added for Media tile of MTL A step. It is to help pcode workaround which handles the hardware issue seen during package C2/C3 transitions due to RC6 entry/exit transitions on Media tile. As a part of workaround pcode expect kmd to send mailbox message "media busy" when components of Media tile are in use and "media idle" otherwise. As per workaround description gucrc need to be disabled so enabled host based RC for Media tile. v2: - Correct workaround id (Matt) - Fix review comments (Rodrigo) Cc: Rodrigo Vivi <[email protected]> Cc: Radhakrishna Sripada <[email protected]> Cc: Vinay Belgaumkar <[email protected]> Cc: Chris Wilson <[email protected]> Signed-off-by: Badal Nilawar <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Anshuman Gupta <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 733827e commit 8f70f1e

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

drivers/gpu/drm/i915/gt/intel_gt_pm.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,31 @@
1919
#include "intel_rc6.h"
2020
#include "intel_rps.h"
2121
#include "intel_wakeref.h"
22+
#include "intel_pcode.h"
2223
#include "pxp/intel_pxp_pm.h"
2324

2425
#define I915_GT_SUSPEND_IDLE_TIMEOUT (HZ / 2)
2526

27+
static void mtl_media_busy(struct intel_gt *gt)
28+
{
29+
/* Wa_14017073508: mtl */
30+
if (IS_MTL_GRAPHICS_STEP(gt->i915, P, STEP_A0, STEP_B0) &&
31+
gt->type == GT_MEDIA)
32+
snb_pcode_write_p(gt->uncore, PCODE_MBOX_GT_STATE,
33+
PCODE_MBOX_GT_STATE_MEDIA_BUSY,
34+
PCODE_MBOX_GT_STATE_DOMAIN_MEDIA, 0);
35+
}
36+
37+
static void mtl_media_idle(struct intel_gt *gt)
38+
{
39+
/* Wa_14017073508: mtl */
40+
if (IS_MTL_GRAPHICS_STEP(gt->i915, P, STEP_A0, STEP_B0) &&
41+
gt->type == GT_MEDIA)
42+
snb_pcode_write_p(gt->uncore, PCODE_MBOX_GT_STATE,
43+
PCODE_MBOX_GT_STATE_MEDIA_NOT_BUSY,
44+
PCODE_MBOX_GT_STATE_DOMAIN_MEDIA, 0);
45+
}
46+
2647
static void user_forcewake(struct intel_gt *gt, bool suspend)
2748
{
2849
int count = atomic_read(&gt->user_wakeref);
@@ -70,6 +91,9 @@ static int __gt_unpark(struct intel_wakeref *wf)
7091

7192
GT_TRACE(gt, "\n");
7293

94+
/* Wa_14017073508: mtl */
95+
mtl_media_busy(gt);
96+
7397
/*
7498
* It seems that the DMC likes to transition between the DC states a lot
7599
* when there are no connected displays (no active power domains) during
@@ -119,6 +143,9 @@ static int __gt_park(struct intel_wakeref *wf)
119143
GEM_BUG_ON(!wakeref);
120144
intel_display_power_put_async(i915, POWER_DOMAIN_GT_IRQ, wakeref);
121145

146+
/* Wa_14017073508: mtl */
147+
mtl_media_idle(gt);
148+
122149
return 0;
123150
}
124151

drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,20 @@
1111

1212
static bool __guc_rc_supported(struct intel_guc *guc)
1313
{
14+
struct intel_gt *gt = guc_to_gt(guc);
15+
16+
/*
17+
* Wa_14017073508: mtl
18+
* Do not enable gucrc to avoid additional interrupts which
19+
* may disrupt pcode wa.
20+
*/
21+
if (IS_MTL_GRAPHICS_STEP(gt->i915, P, STEP_A0, STEP_B0) &&
22+
gt->type == GT_MEDIA)
23+
return false;
24+
1425
/* GuC RC is unavailable for pre-Gen12 */
1526
return guc->submission_supported &&
16-
GRAPHICS_VER(guc_to_gt(guc)->i915) >= 12;
27+
GRAPHICS_VER(gt->i915) >= 12;
1728
}
1829

1930
static bool __guc_rc_selected(struct intel_guc *guc)

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,10 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
740740
#define IS_XEHPSDV_GRAPHICS_STEP(__i915, since, until) \
741741
(IS_XEHPSDV(__i915) && IS_GRAPHICS_STEP(__i915, since, until))
742742

743+
#define IS_MTL_GRAPHICS_STEP(__i915, variant, since, until) \
744+
(IS_SUBPLATFORM(__i915, INTEL_METEORLAKE, INTEL_SUBPLATFORM_##variant) && \
745+
IS_GRAPHICS_STEP(__i915, since, until))
746+
743747
/*
744748
* DG2 hardware steppings are a bit unusual. The hardware design was forked to
745749
* create three variants (G10, G11, and G12) which each have distinct

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6679,6 +6679,15 @@
66796679
/* XEHP_PCODE_FREQUENCY_CONFIG param2 */
66806680
#define PCODE_MBOX_DOMAIN_NONE 0x0
66816681
#define PCODE_MBOX_DOMAIN_MEDIAFF 0x3
6682+
6683+
/* Wa_14017210380: mtl */
6684+
#define PCODE_MBOX_GT_STATE 0x50
6685+
/* sub-commands (param1) */
6686+
#define PCODE_MBOX_GT_STATE_MEDIA_BUSY 0x1
6687+
#define PCODE_MBOX_GT_STATE_MEDIA_NOT_BUSY 0x2
6688+
/* param2 */
6689+
#define PCODE_MBOX_GT_STATE_DOMAIN_MEDIA 0x1
6690+
66826691
#define GEN6_PCODE_DATA _MMIO(0x138128)
66836692
#define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8
66846693
#define GEN6_PCODE_FREQ_RING_RATIO_SHIFT 16

0 commit comments

Comments
 (0)