Skip to content

Commit 364ac78

Browse files
Radhakrishna Sripadajnikula
authored andcommitted
drm/i915/mtl: Fix Wa_16015201720 implementation
The commit 2357f2b ("drm/i915/mtl: Initial display workarounds") extended the workaround Wa_16015201720 to MTL. However the registers that the original WA implemented moved for MTL. Implement the workaround with the correct register. v3: Skip clock gating for pipe C, D DMC's and fix the title Fixes: 2357f2b ("drm/i915/mtl: Initial display workarounds") Cc: Matt Atwood <[email protected]> Cc: Lucas De Marchi <[email protected]> Signed-off-by: Radhakrishna Sripada <[email protected]> Reviewed-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 0188be5) Signed-off-by: Jani Nikula <[email protected]>
1 parent e8d018d commit 364ac78

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

drivers/gpu/drm/i915/display/intel_dmc.c

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,12 @@ static void disable_all_event_handlers(struct drm_i915_private *i915)
384384
}
385385
}
386386

387-
static void pipedmc_clock_gating_wa(struct drm_i915_private *i915, bool enable)
387+
static void adlp_pipedmc_clock_gating_wa(struct drm_i915_private *i915, bool enable)
388388
{
389389
enum pipe pipe;
390390

391-
if (DISPLAY_VER(i915) < 13)
392-
return;
393-
394391
/*
395-
* Wa_16015201720:adl-p,dg2, mtl
392+
* Wa_16015201720:adl-p,dg2
396393
* The WA requires clock gating to be disabled all the time
397394
* for pipe A and B.
398395
* For pipe C and D clock gating needs to be disabled only
@@ -408,6 +405,25 @@ static void pipedmc_clock_gating_wa(struct drm_i915_private *i915, bool enable)
408405
PIPEDMC_GATING_DIS, 0);
409406
}
410407

408+
static void mtl_pipedmc_clock_gating_wa(struct drm_i915_private *i915)
409+
{
410+
/*
411+
* Wa_16015201720
412+
* The WA requires clock gating to be disabled all the time
413+
* for pipe A and B.
414+
*/
415+
intel_de_rmw(i915, GEN9_CLKGATE_DIS_0, 0,
416+
MTL_PIPEDMC_GATING_DIS_A | MTL_PIPEDMC_GATING_DIS_B);
417+
}
418+
419+
static void pipedmc_clock_gating_wa(struct drm_i915_private *i915, bool enable)
420+
{
421+
if (DISPLAY_VER(i915) >= 14 && enable)
422+
mtl_pipedmc_clock_gating_wa(i915);
423+
else if (DISPLAY_VER(i915) == 13)
424+
adlp_pipedmc_clock_gating_wa(i915, enable);
425+
}
426+
411427
void intel_dmc_enable_pipe(struct drm_i915_private *i915, enum pipe pipe)
412428
{
413429
if (!has_dmc_id_fw(i915, PIPE_TO_DMC_ID(pipe)))

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,9 +1786,11 @@
17861786
* GEN9 clock gating regs
17871787
*/
17881788
#define GEN9_CLKGATE_DIS_0 _MMIO(0x46530)
1789-
#define DARBF_GATING_DIS (1 << 27)
1790-
#define PWM2_GATING_DIS (1 << 14)
1791-
#define PWM1_GATING_DIS (1 << 13)
1789+
#define DARBF_GATING_DIS REG_BIT(27)
1790+
#define MTL_PIPEDMC_GATING_DIS_A REG_BIT(15)
1791+
#define MTL_PIPEDMC_GATING_DIS_B REG_BIT(14)
1792+
#define PWM2_GATING_DIS REG_BIT(14)
1793+
#define PWM1_GATING_DIS REG_BIT(13)
17921794

17931795
#define GEN9_CLKGATE_DIS_3 _MMIO(0x46538)
17941796
#define TGL_VRH_GATING_DIS REG_BIT(31)

0 commit comments

Comments
 (0)