Skip to content

Commit 7d80cc7

Browse files
committed
Merge tag 'drm-intel-fixes-2021-10-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v5.15-rc5: - Fix RKL HDMI audio - Fix runtime pm imbalance on i915_gem_shrink() error path - Fix Type-C port access before hw/sw state sync - Fix VBT backlight struct version/size check - Fix VT-d async flip on SKL/BXT with plane stretch workaround Signed-off-by: Dave Airlie <[email protected]> From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 9e1ff30 + b2d73de commit 7d80cc7

File tree

9 files changed

+66
-28
lines changed

9 files changed

+66
-28
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,8 +1577,14 @@ static void gen11_dsi_sync_state(struct intel_encoder *encoder,
15771577
const struct intel_crtc_state *crtc_state)
15781578
{
15791579
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1580-
struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
1581-
enum pipe pipe = intel_crtc->pipe;
1580+
struct intel_crtc *intel_crtc;
1581+
enum pipe pipe;
1582+
1583+
if (!crtc_state)
1584+
return;
1585+
1586+
intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
1587+
pipe = intel_crtc->pipe;
15821588

15831589
/* wa verify 1409054076:icl,jsl,ehl */
15841590
if (DISPLAY_VER(dev_priv) == 11 && pipe == PIPE_B &&

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,8 +1308,9 @@ static void i915_audio_component_init(struct drm_i915_private *dev_priv)
13081308
else
13091309
aud_freq = aud_freq_init;
13101310

1311-
/* use BIOS provided value for TGL unless it is a known bad value */
1312-
if (IS_TIGERLAKE(dev_priv) && aud_freq_init != AUD_FREQ_TGL_BROKEN)
1311+
/* use BIOS provided value for TGL and RKL unless it is a known bad value */
1312+
if ((IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv)) &&
1313+
aud_freq_init != AUD_FREQ_TGL_BROKEN)
13131314
aud_freq = aud_freq_init;
13141315

13151316
drm_dbg_kms(&dev_priv->drm, "use AUD_FREQ_CNTRL of 0x%x (init value 0x%x)\n",

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,23 @@ parse_lfp_backlight(struct drm_i915_private *i915,
451451
}
452452

453453
i915->vbt.backlight.type = INTEL_BACKLIGHT_DISPLAY_DDI;
454-
if (bdb->version >= 191 &&
455-
get_blocksize(backlight_data) >= sizeof(*backlight_data)) {
456-
const struct lfp_backlight_control_method *method;
454+
if (bdb->version >= 191) {
455+
size_t exp_size;
457456

458-
method = &backlight_data->backlight_control[panel_type];
459-
i915->vbt.backlight.type = method->type;
460-
i915->vbt.backlight.controller = method->controller;
457+
if (bdb->version >= 236)
458+
exp_size = sizeof(struct bdb_lfp_backlight_data);
459+
else if (bdb->version >= 234)
460+
exp_size = EXP_BDB_LFP_BL_DATA_SIZE_REV_234;
461+
else
462+
exp_size = EXP_BDB_LFP_BL_DATA_SIZE_REV_191;
463+
464+
if (get_blocksize(backlight_data) >= exp_size) {
465+
const struct lfp_backlight_control_method *method;
466+
467+
method = &backlight_data->backlight_control[panel_type];
468+
i915->vbt.backlight.type = method->type;
469+
i915->vbt.backlight.controller = method->controller;
470+
}
461471
}
462472

463473
i915->vbt.backlight.pwm_freq_hz = entry->pwm_freq_hz;

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3807,7 +3807,13 @@ void hsw_ddi_get_config(struct intel_encoder *encoder,
38073807
static void intel_ddi_sync_state(struct intel_encoder *encoder,
38083808
const struct intel_crtc_state *crtc_state)
38093809
{
3810-
if (intel_crtc_has_dp_encoder(crtc_state))
3810+
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3811+
enum phy phy = intel_port_to_phy(i915, encoder->port);
3812+
3813+
if (intel_phy_is_tc(i915, phy))
3814+
intel_tc_port_sanitize(enc_to_dig_port(encoder));
3815+
3816+
if (crtc_state && intel_crtc_has_dp_encoder(crtc_state))
38113817
intel_dp_sync_state(encoder, crtc_state);
38123818
}
38133819

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

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13082,18 +13082,16 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
1308213082
readout_plane_state(dev_priv);
1308313083

1308413084
for_each_intel_encoder(dev, encoder) {
13085+
struct intel_crtc_state *crtc_state = NULL;
13086+
1308513087
pipe = 0;
1308613088

1308713089
if (encoder->get_hw_state(encoder, &pipe)) {
13088-
struct intel_crtc_state *crtc_state;
13089-
1309013090
crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
1309113091
crtc_state = to_intel_crtc_state(crtc->base.state);
1309213092

1309313093
encoder->base.crtc = &crtc->base;
1309413094
intel_encoder_get_config(encoder, crtc_state);
13095-
if (encoder->sync_state)
13096-
encoder->sync_state(encoder, crtc_state);
1309713095

1309813096
/* read out to slave crtc as well for bigjoiner */
1309913097
if (crtc_state->bigjoiner) {
@@ -13108,6 +13106,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
1310813106
encoder->base.crtc = NULL;
1310913107
}
1311013108

13109+
if (encoder->sync_state)
13110+
encoder->sync_state(encoder, crtc_state);
13111+
1311113112
drm_dbg_kms(&dev_priv->drm,
1311213113
"[ENCODER:%d:%s] hw state readout: %s, pipe %c\n",
1311313114
encoder->base.base.id, encoder->base.name,
@@ -13390,17 +13391,6 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
1339013391
intel_modeset_readout_hw_state(dev);
1339113392

1339213393
/* HW state is read out, now we need to sanitize this mess. */
13393-
13394-
/* Sanitize the TypeC port mode upfront, encoders depend on this */
13395-
for_each_intel_encoder(dev, encoder) {
13396-
enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
13397-
13398-
/* We need to sanitize only the MST primary port. */
13399-
if (encoder->type != INTEL_OUTPUT_DP_MST &&
13400-
intel_phy_is_tc(dev_priv, phy))
13401-
intel_tc_port_sanitize(enc_to_dig_port(encoder));
13402-
}
13403-
1340413394
get_encoder_power_domains(dev_priv);
1340513395

1340613396
if (HAS_PCH_IBX(dev_priv))

drivers/gpu/drm/i915/display/intel_vbt_defs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,11 @@ struct lfp_brightness_level {
814814
u16 reserved;
815815
} __packed;
816816

817+
#define EXP_BDB_LFP_BL_DATA_SIZE_REV_191 \
818+
offsetof(struct bdb_lfp_backlight_data, brightness_level)
819+
#define EXP_BDB_LFP_BL_DATA_SIZE_REV_234 \
820+
offsetof(struct bdb_lfp_backlight_data, brightness_precision_bits)
821+
817822
struct bdb_lfp_backlight_data {
818823
u8 entry_size;
819824
struct lfp_backlight_data_entry data[16];

drivers/gpu/drm/i915/gem/i915_gem_shrinker.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,
118118
intel_wakeref_t wakeref = 0;
119119
unsigned long count = 0;
120120
unsigned long scanned = 0;
121-
int err;
121+
int err = 0;
122122

123123
/* CHV + VTD workaround use stop_machine(); need to trylock vm->mutex */
124124
bool trylock_vm = !ww && intel_vm_no_concurrent_access_wa(i915);
@@ -242,12 +242,15 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,
242242
list_splice_tail(&still_in_list, phase->list);
243243
spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
244244
if (err)
245-
return err;
245+
break;
246246
}
247247

248248
if (shrink & I915_SHRINK_BOUND)
249249
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
250250

251+
if (err)
252+
return err;
253+
251254
if (nr_scanned)
252255
*nr_scanned += scanned;
253256
return count;

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8193,6 +8193,11 @@ enum {
81938193
#define HSW_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 3)
81948194
#define HSW_FBCQ_DIS (1 << 22)
81958195
#define BDW_DPRS_MASK_VBLANK_SRD (1 << 0)
8196+
#define SKL_PLANE1_STRETCH_MAX_MASK REG_GENMASK(1, 0)
8197+
#define SKL_PLANE1_STRETCH_MAX_X8 REG_FIELD_PREP(SKL_PLANE1_STRETCH_MAX_MASK, 0)
8198+
#define SKL_PLANE1_STRETCH_MAX_X4 REG_FIELD_PREP(SKL_PLANE1_STRETCH_MAX_MASK, 1)
8199+
#define SKL_PLANE1_STRETCH_MAX_X2 REG_FIELD_PREP(SKL_PLANE1_STRETCH_MAX_MASK, 2)
8200+
#define SKL_PLANE1_STRETCH_MAX_X1 REG_FIELD_PREP(SKL_PLANE1_STRETCH_MAX_MASK, 3)
81968201
#define CHICKEN_PIPESL_1(pipe) _MMIO_PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B)
81978202

81988203
#define _CHICKEN_TRANS_A 0x420c0

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ struct intel_wm_config {
7676

7777
static void gen9_init_clock_gating(struct drm_i915_private *dev_priv)
7878
{
79+
enum pipe pipe;
80+
7981
if (HAS_LLC(dev_priv)) {
8082
/*
8183
* WaCompressedResourceDisplayNewHashMode:skl,kbl
@@ -89,6 +91,16 @@ static void gen9_init_clock_gating(struct drm_i915_private *dev_priv)
8991
SKL_DE_COMPRESSED_HASH_MODE);
9092
}
9193

94+
for_each_pipe(dev_priv, pipe) {
95+
/*
96+
* "Plane N strech max must be programmed to 11b (x1)
97+
* when Async flips are enabled on that plane."
98+
*/
99+
if (!IS_GEMINILAKE(dev_priv) && intel_vtd_active())
100+
intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe),
101+
SKL_PLANE1_STRETCH_MAX_MASK, SKL_PLANE1_STRETCH_MAX_X1);
102+
}
103+
92104
/* See Bspec note for PSR2_CTL bit 31, Wa#828:skl,bxt,kbl,cfl */
93105
intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1,
94106
intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | SKL_EDP_PSR_FIX_RDWRAP);

0 commit comments

Comments
 (0)