Skip to content

Commit 023b3b0

Browse files
committed
Merge tag 'drm-intel-fixes-2020-01-09-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Fix GitLab issue #446 causing GPU hangs: Do not restore invalid RS state - Fix GitLab issue #846: Restore coarse power gating that was disabled by initial RC66 context corruption security fixes. - Revert f6ec948 ("drm/i915: extend audio CDCLK>=2*BCLK constraint to more platforms") to avoid screen flicker - Fix to fill in unitialized uabi_instance in virtual engine uAPI - Add two missing W/As for ICL and EHL Signed-off-by: Dave Airlie <[email protected]> From: Joonas Lahtinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents ac0c9d3 + 2b2c4a8 commit 023b3b0

File tree

7 files changed

+38
-31
lines changed

7 files changed

+38
-31
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ static unsigned long i915_audio_component_get_power(struct device *kdev)
856856
}
857857

858858
/* Force CDCLK to 2*BCLK as long as we need audio powered. */
859-
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
859+
if (IS_GEMINILAKE(dev_priv))
860860
glk_force_audio_cdclk(dev_priv, true);
861861

862862
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
@@ -875,7 +875,7 @@ static void i915_audio_component_put_power(struct device *kdev,
875875

876876
/* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */
877877
if (--dev_priv->audio_power_refcount == 0)
878-
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
878+
if (IS_GEMINILAKE(dev_priv))
879879
glk_force_audio_cdclk(dev_priv, false);
880880

881881
intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, cookie);

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4515,19 +4515,14 @@ static void icl_disable_transcoder_port_sync(const struct intel_crtc_state *old_
45154515
{
45164516
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
45174517
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
4518-
i915_reg_t reg;
4519-
u32 trans_ddi_func_ctl2_val;
45204518

45214519
if (old_crtc_state->master_transcoder == INVALID_TRANSCODER)
45224520
return;
45234521

45244522
DRM_DEBUG_KMS("Disabling Transcoder Port Sync on Slave Transcoder %s\n",
45254523
transcoder_name(old_crtc_state->cpu_transcoder));
45264524

4527-
reg = TRANS_DDI_FUNC_CTL2(old_crtc_state->cpu_transcoder);
4528-
trans_ddi_func_ctl2_val = ~(PORT_SYNC_MODE_ENABLE |
4529-
PORT_SYNC_MODE_MASTER_SELECT_MASK);
4530-
I915_WRITE(reg, trans_ddi_func_ctl2_val);
4525+
I915_WRITE(TRANS_DDI_FUNC_CTL2(old_crtc_state->cpu_transcoder), 0);
45314526
}
45324527

45334528
static void intel_fdi_normal_train(struct intel_crtc *crtc)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4416,9 +4416,11 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx,
44164416
ve->base.gt = siblings[0]->gt;
44174417
ve->base.uncore = siblings[0]->uncore;
44184418
ve->base.id = -1;
4419+
44194420
ve->base.class = OTHER_CLASS;
44204421
ve->base.uabi_class = I915_ENGINE_CLASS_INVALID;
44214422
ve->base.instance = I915_ENGINE_CLASS_INVALID_VIRTUAL;
4423+
ve->base.uabi_instance = I915_ENGINE_CLASS_INVALID_VIRTUAL;
44224424

44234425
/*
44244426
* The decision on whether to submit a request using semaphores

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

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,14 +1413,6 @@ static inline int mi_set_context(struct i915_request *rq, u32 flags)
14131413
int len;
14141414
u32 *cs;
14151415

1416-
flags |= MI_MM_SPACE_GTT;
1417-
if (IS_HASWELL(i915))
1418-
/* These flags are for resource streamer on HSW+ */
1419-
flags |= HSW_MI_RS_SAVE_STATE_EN | HSW_MI_RS_RESTORE_STATE_EN;
1420-
else
1421-
/* We need to save the extended state for powersaving modes */
1422-
flags |= MI_SAVE_EXT_STATE_EN | MI_RESTORE_EXT_STATE_EN;
1423-
14241416
len = 4;
14251417
if (IS_GEN(i915, 7))
14261418
len += 2 + (num_engines ? 4 * num_engines + 6 : 0);
@@ -1589,22 +1581,21 @@ static int switch_context(struct i915_request *rq)
15891581
}
15901582

15911583
if (ce->state) {
1592-
u32 hw_flags;
1584+
u32 flags;
15931585

15941586
GEM_BUG_ON(rq->engine->id != RCS0);
15951587

1596-
/*
1597-
* The kernel context(s) is treated as pure scratch and is not
1598-
* expected to retain any state (as we sacrifice it during
1599-
* suspend and on resume it may be corrupted). This is ok,
1600-
* as nothing actually executes using the kernel context; it
1601-
* is purely used for flushing user contexts.
1602-
*/
1603-
hw_flags = 0;
1604-
if (i915_gem_context_is_kernel(rq->gem_context))
1605-
hw_flags = MI_RESTORE_INHIBIT;
1588+
/* For resource streamer on HSW+ and power context elsewhere */
1589+
BUILD_BUG_ON(HSW_MI_RS_SAVE_STATE_EN != MI_SAVE_EXT_STATE_EN);
1590+
BUILD_BUG_ON(HSW_MI_RS_RESTORE_STATE_EN != MI_RESTORE_EXT_STATE_EN);
1591+
1592+
flags = MI_SAVE_EXT_STATE_EN | MI_MM_SPACE_GTT;
1593+
if (!i915_gem_context_is_kernel(rq->gem_context))
1594+
flags |= MI_RESTORE_EXT_STATE_EN;
1595+
else
1596+
flags |= MI_RESTORE_INHIBIT;
16061597

1607-
ret = mi_set_context(rq, hw_flags);
1598+
ret = mi_set_context(rq, flags);
16081599
if (ret)
16091600
return ret;
16101601
}

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,10 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
16601660
(IS_BROADWELL(dev_priv) || IS_GEN(dev_priv, 9))
16611661

16621662
/* WaRsDisableCoarsePowerGating:skl,cnl */
1663-
#define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \
1664-
(IS_CANNONLAKE(dev_priv) || IS_GEN(dev_priv, 9))
1663+
#define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \
1664+
(IS_CANNONLAKE(dev_priv) || \
1665+
IS_SKL_GT3(dev_priv) || \
1666+
IS_SKL_GT4(dev_priv))
16651667

16661668
#define HAS_GMBUS_IRQ(dev_priv) (INTEL_GEN(dev_priv) >= 4)
16671669
#define HAS_GMBUS_BURST_READ(dev_priv) (INTEL_GEN(dev_priv) >= 10 || \

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4177,7 +4177,13 @@ enum {
41774177
#define CPSSUNIT_CLKGATE_DIS REG_BIT(9)
41784178

41794179
#define UNSLICE_UNIT_LEVEL_CLKGATE _MMIO(0x9434)
4180-
#define VFUNIT_CLKGATE_DIS (1 << 20)
4180+
#define VFUNIT_CLKGATE_DIS REG_BIT(20)
4181+
#define HSUNIT_CLKGATE_DIS REG_BIT(8)
4182+
#define VSUNIT_CLKGATE_DIS REG_BIT(3)
4183+
4184+
#define UNSLICE_UNIT_LEVEL_CLKGATE2 _MMIO(0x94e4)
4185+
#define VSUNIT_CLKGATE_DIS_TGL REG_BIT(19)
4186+
#define PSDUNIT_CLKGATE_DIS REG_BIT(5)
41814187

41824188
#define INF_UNIT_LEVEL_CLKGATE _MMIO(0x9560)
41834189
#define CGPSF_CLKGATE_DIS (1 << 3)

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6565,6 +6565,17 @@ static void icl_init_clock_gating(struct drm_i915_private *dev_priv)
65656565
/* WaEnable32PlaneMode:icl */
65666566
I915_WRITE(GEN9_CSFE_CHICKEN1_RCS,
65676567
_MASKED_BIT_ENABLE(GEN11_ENABLE_32_PLANE_MODE));
6568+
6569+
/*
6570+
* Wa_1408615072:icl,ehl (vsunit)
6571+
* Wa_1407596294:icl,ehl (hsunit)
6572+
*/
6573+
intel_uncore_rmw(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE,
6574+
0, VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS);
6575+
6576+
/* Wa_1407352427:icl,ehl */
6577+
intel_uncore_rmw(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE2,
6578+
0, PSDUNIT_CLKGATE_DIS);
65686579
}
65696580

65706581
static void tgl_init_clock_gating(struct drm_i915_private *dev_priv)

0 commit comments

Comments
 (0)