Skip to content

Commit d4b6e7f

Browse files
committed
Merge tag 'drm-intel-fixes-2023-12-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v6.7-rc7: - Fix state readout and check for DSC and bigjoiner combo - Fix a potential integer overflow - Reject async flips with bigjoiner - Fix MTL HDMI/DP PLL clock selection - Fix various issues by disabling pipe DMC events Signed-off-by: Dave Airlie <airlied@redhat.com> From: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/87plyzsnxi.fsf@intel.com
2 parents b7ef7ca + 49e0a85 commit d4b6e7f

File tree

4 files changed

+57
-6
lines changed

4 files changed

+57
-6
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2465,7 +2465,8 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder,
24652465

24662466
val |= XELPDP_FORWARD_CLOCK_UNGATE;
24672467

2468-
if (is_hdmi_frl(crtc_state->port_clock))
2468+
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) &&
2469+
is_hdmi_frl(crtc_state->port_clock))
24692470
val |= XELPDP_DDI_CLOCK_SELECT(XELPDP_DDI_CLOCK_SELECT_DIV18CLK);
24702471
else
24712472
val |= XELPDP_DDI_CLOCK_SELECT(XELPDP_DDI_CLOCK_SELECT_MAXPCLK);

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3747,8 +3747,8 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,
37473747
if (!active)
37483748
goto out;
37493749

3750-
intel_dsc_get_config(pipe_config);
37513750
intel_bigjoiner_get_config(pipe_config);
3751+
intel_dsc_get_config(pipe_config);
37523752

37533753
if (!transcoder_is_dsi(pipe_config->cpu_transcoder) ||
37543754
DISPLAY_VER(dev_priv) >= 11)
@@ -6033,6 +6033,17 @@ static int intel_async_flip_check_uapi(struct intel_atomic_state *state,
60336033
return -EINVAL;
60346034
}
60356035

6036+
/*
6037+
* FIXME: Bigjoiner+async flip is busted currently.
6038+
* Remove this check once the issues are fixed.
6039+
*/
6040+
if (new_crtc_state->bigjoiner_pipes) {
6041+
drm_dbg_kms(&i915->drm,
6042+
"[CRTC:%d:%s] async flip disallowed with bigjoiner\n",
6043+
crtc->base.base.id, crtc->base.name);
6044+
return -EINVAL;
6045+
}
6046+
60366047
for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
60376048
new_plane_state, i) {
60386049
if (plane->pipe != crtc->pipe)

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

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ disable_all_flip_queue_events(struct drm_i915_private *i915)
389389
enum intel_dmc_id dmc_id;
390390

391391
/* TODO: check if the following applies to all D13+ platforms. */
392-
if (!IS_DG2(i915) && !IS_TIGERLAKE(i915))
392+
if (!IS_TIGERLAKE(i915))
393393
return;
394394

395395
for_each_dmc_id(dmc_id) {
@@ -493,6 +493,45 @@ void intel_dmc_disable_pipe(struct drm_i915_private *i915, enum pipe pipe)
493493
intel_de_rmw(i915, PIPEDMC_CONTROL(pipe), PIPEDMC_ENABLE, 0);
494494
}
495495

496+
static bool is_dmc_evt_ctl_reg(struct drm_i915_private *i915,
497+
enum intel_dmc_id dmc_id, i915_reg_t reg)
498+
{
499+
u32 offset = i915_mmio_reg_offset(reg);
500+
u32 start = i915_mmio_reg_offset(DMC_EVT_CTL(i915, dmc_id, 0));
501+
u32 end = i915_mmio_reg_offset(DMC_EVT_CTL(i915, dmc_id, DMC_EVENT_HANDLER_COUNT_GEN12));
502+
503+
return offset >= start && offset < end;
504+
}
505+
506+
static bool disable_dmc_evt(struct drm_i915_private *i915,
507+
enum intel_dmc_id dmc_id,
508+
i915_reg_t reg, u32 data)
509+
{
510+
if (!is_dmc_evt_ctl_reg(i915, dmc_id, reg))
511+
return false;
512+
513+
/* keep all pipe DMC events disabled by default */
514+
if (dmc_id != DMC_FW_MAIN)
515+
return true;
516+
517+
return false;
518+
}
519+
520+
static u32 dmc_mmiodata(struct drm_i915_private *i915,
521+
struct intel_dmc *dmc,
522+
enum intel_dmc_id dmc_id, int i)
523+
{
524+
if (disable_dmc_evt(i915, dmc_id,
525+
dmc->dmc_info[dmc_id].mmioaddr[i],
526+
dmc->dmc_info[dmc_id].mmiodata[i]))
527+
return REG_FIELD_PREP(DMC_EVT_CTL_TYPE_MASK,
528+
DMC_EVT_CTL_TYPE_EDGE_0_1) |
529+
REG_FIELD_PREP(DMC_EVT_CTL_EVENT_ID_MASK,
530+
DMC_EVT_CTL_EVENT_ID_FALSE);
531+
else
532+
return dmc->dmc_info[dmc_id].mmiodata[i];
533+
}
534+
496535
/**
497536
* intel_dmc_load_program() - write the firmware from memory to register.
498537
* @i915: i915 drm device.
@@ -532,7 +571,7 @@ void intel_dmc_load_program(struct drm_i915_private *i915)
532571
for_each_dmc_id(dmc_id) {
533572
for (i = 0; i < dmc->dmc_info[dmc_id].mmio_count; i++) {
534573
intel_de_write(i915, dmc->dmc_info[dmc_id].mmioaddr[i],
535-
dmc->dmc_info[dmc_id].mmiodata[i]);
574+
dmc_mmiodata(i915, dmc, dmc_id, i));
536575
}
537576
}
538577

drivers/gpu/drm/i915/i915_hwmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ hwm_power1_max_interval_show(struct device *dev, struct device_attribute *attr,
175175
* tau4 = (4 | x) << y
176176
* but add 2 when doing the final right shift to account for units
177177
*/
178-
tau4 = ((1 << x_w) | x) << y;
178+
tau4 = (u64)((1 << x_w) | x) << y;
179179
/* val in hwmon interface units (millisec) */
180180
out = mul_u64_u32_shr(tau4, SF_TIME, hwmon->scl_shift_time + x_w);
181181

@@ -211,7 +211,7 @@ hwm_power1_max_interval_store(struct device *dev,
211211
r = FIELD_PREP(PKG_MAX_WIN, PKG_MAX_WIN_DEFAULT);
212212
x = REG_FIELD_GET(PKG_MAX_WIN_X, r);
213213
y = REG_FIELD_GET(PKG_MAX_WIN_Y, r);
214-
tau4 = ((1 << x_w) | x) << y;
214+
tau4 = (u64)((1 << x_w) | x) << y;
215215
max_win = mul_u64_u32_shr(tau4, SF_TIME, hwmon->scl_shift_time + x_w);
216216

217217
if (val > max_win)

0 commit comments

Comments
 (0)