Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit b01f596

Browse files
committed
Merge tag 'drm-intel-fixes-2024-03-28' of https://anongit.freedesktop.org/git/drm/drm-intel into drm-fixes
Core/GT Fixes: - Fix for BUG_ON/BUILD_BUG_ON IN I915_memcpy.c (Joonas) - Update a MTL workaround (Tejas) - Fix locking inversion in hwmon's sysfs (Janusz) - Remove a bogus error message around PXP (Jose) - Fix UAF on VMA (Janusz) - Reset queue_priority_hint on parking (Chris) Display Fixes: - Remove duplicated audio enable/disable on SDVO and DP (Ville) - Disable AuxCCS for Xe driver (Juha-Pekka) - Revert init order of MIPI DSI (Ville) - DRRS debugfs fix with an extra refactor patch (Bhanuprakash) - VRR related fixes (Ville) - Fix a JSL eDP corruption (Jonathon) - Fix the cursor physical dma address (Ville) - BIOS VBT related fix (Ville) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/ZgYaIVgjIs30mIvS@intel.com
2 parents 2f73503 + 32e39ba commit b01f596

22 files changed

+161
-63
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ static void g4x_enable_dp(struct intel_atomic_state *state,
717717
{
718718
intel_enable_dp(state, encoder, pipe_config, conn_state);
719719
intel_edp_backlight_on(pipe_config, conn_state);
720-
encoder->audio_enable(encoder, pipe_config, conn_state);
721720
}
722721

723722
static void vlv_enable_dp(struct intel_atomic_state *state,
@@ -726,7 +725,6 @@ static void vlv_enable_dp(struct intel_atomic_state *state,
726725
const struct drm_connector_state *conn_state)
727726
{
728727
intel_edp_backlight_on(pipe_config, conn_state);
729-
encoder->audio_enable(encoder, pipe_config, conn_state);
730728
}
731729

732730
static void g4x_pre_enable_dp(struct intel_atomic_state *state,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,6 @@ static void gen11_dsi_powerup_panel(struct intel_encoder *encoder)
11551155
}
11561156

11571157
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_INIT_OTP);
1158-
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
11591158

11601159
/* ensure all panel commands dispatched before enabling transcoder */
11611160
wait_for_cmds_dispatched_to_panel(encoder);
@@ -1256,6 +1255,8 @@ static void gen11_dsi_enable(struct intel_atomic_state *state,
12561255
/* step6d: enable dsi transcoder */
12571256
gen11_dsi_enable_transcoder(encoder);
12581257

1258+
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
1259+
12591260
/* step7: enable backlight */
12601261
intel_backlight_enable(crtc_state, conn_state);
12611262
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_ON);

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

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,16 +1955,12 @@ static int get_init_otp_deassert_fragment_len(struct drm_i915_private *i915,
19551955
* these devices we split the init OTP sequence into a deassert sequence and
19561956
* the actual init OTP part.
19571957
*/
1958-
static void fixup_mipi_sequences(struct drm_i915_private *i915,
1959-
struct intel_panel *panel)
1958+
static void vlv_fixup_mipi_sequences(struct drm_i915_private *i915,
1959+
struct intel_panel *panel)
19601960
{
19611961
u8 *init_otp;
19621962
int len;
19631963

1964-
/* Limit this to VLV for now. */
1965-
if (!IS_VALLEYVIEW(i915))
1966-
return;
1967-
19681964
/* Limit this to v1 vid-mode sequences */
19691965
if (panel->vbt.dsi.config->is_cmd_mode ||
19701966
panel->vbt.dsi.seq_version != 1)
@@ -2000,6 +1996,41 @@ static void fixup_mipi_sequences(struct drm_i915_private *i915,
20001996
panel->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP] = init_otp + len - 1;
20011997
}
20021998

1999+
/*
2000+
* Some machines (eg. Lenovo 82TQ) appear to have broken
2001+
* VBT sequences:
2002+
* - INIT_OTP is not present at all
2003+
* - what should be in INIT_OTP is in DISPLAY_ON
2004+
* - what should be in DISPLAY_ON is in BACKLIGHT_ON
2005+
* (along with the actual backlight stuff)
2006+
*
2007+
* To make those work we simply swap DISPLAY_ON and INIT_OTP.
2008+
*
2009+
* TODO: Do we need to limit this to specific machines,
2010+
* or examine the contents of the sequences to
2011+
* avoid false positives?
2012+
*/
2013+
static void icl_fixup_mipi_sequences(struct drm_i915_private *i915,
2014+
struct intel_panel *panel)
2015+
{
2016+
if (!panel->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP] &&
2017+
panel->vbt.dsi.sequence[MIPI_SEQ_DISPLAY_ON]) {
2018+
drm_dbg_kms(&i915->drm, "Broken VBT: Swapping INIT_OTP and DISPLAY_ON sequences\n");
2019+
2020+
swap(panel->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP],
2021+
panel->vbt.dsi.sequence[MIPI_SEQ_DISPLAY_ON]);
2022+
}
2023+
}
2024+
2025+
static void fixup_mipi_sequences(struct drm_i915_private *i915,
2026+
struct intel_panel *panel)
2027+
{
2028+
if (DISPLAY_VER(i915) >= 11)
2029+
icl_fixup_mipi_sequences(i915, panel);
2030+
else if (IS_VALLEYVIEW(i915))
2031+
vlv_fixup_mipi_sequences(i915, panel);
2032+
}
2033+
20032034
static void
20042035
parse_mipi_sequence(struct drm_i915_private *i915,
20052036
struct intel_panel *panel)
@@ -3351,6 +3382,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da
33513382
{
33523383
const struct child_device_config *child = &devdata->child;
33533384

3385+
if (!devdata)
3386+
return false;
3387+
33543388
if (!intel_bios_encoder_supports_dp(devdata) ||
33553389
!intel_bios_encoder_supports_hdmi(devdata))
33563390
return false;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
3636
{
3737
struct drm_i915_private *dev_priv =
3838
to_i915(plane_state->uapi.plane->dev);
39-
const struct drm_framebuffer *fb = plane_state->hw.fb;
40-
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
4139
u32 base;
4240

4341
if (DISPLAY_INFO(dev_priv)->cursor_needs_physical)
44-
base = i915_gem_object_get_dma_address(obj, 0);
42+
base = plane_state->phys_dma_addr;
4543
else
4644
base = intel_plane_ggtt_offset(plane_state);
4745

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ struct intel_plane_state {
727727
#define PLANE_HAS_FENCE BIT(0)
728728

729729
struct intel_fb_view view;
730+
u32 phys_dma_addr; /* for cursor_needs_physical */
730731

731732
/* Plane pxp decryption state */
732733
bool decrypt;

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#include "intel_dp_tunnel.h"
6868
#include "intel_dpio_phy.h"
6969
#include "intel_dpll.h"
70+
#include "intel_drrs.h"
7071
#include "intel_fifo_underrun.h"
7172
#include "intel_hdcp.h"
7273
#include "intel_hdmi.h"
@@ -2683,15 +2684,6 @@ intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp,
26832684
intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA);
26842685
}
26852686

2686-
static bool cpu_transcoder_has_drrs(struct drm_i915_private *i915,
2687-
enum transcoder cpu_transcoder)
2688-
{
2689-
if (HAS_DOUBLE_BUFFERED_M_N(i915))
2690-
return true;
2691-
2692-
return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder);
2693-
}
2694-
26952687
static bool can_enable_drrs(struct intel_connector *connector,
26962688
const struct intel_crtc_state *pipe_config,
26972689
const struct drm_display_mode *downclock_mode)
@@ -2714,7 +2706,7 @@ static bool can_enable_drrs(struct intel_connector *connector,
27142706
if (pipe_config->has_pch_encoder)
27152707
return false;
27162708

2717-
if (!cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder))
2709+
if (!intel_cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder))
27182710
return false;
27192711

27202712
return downclock_mode &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,7 @@ static void icl_wrpll_params_populate(struct skl_wrpll_params *params,
25542554
static bool
25552555
ehl_combo_pll_div_frac_wa_needed(struct drm_i915_private *i915)
25562556
{
2557-
return (((IS_ELKHARTLAKE(i915) || IS_JASPERLAKE(i915)) &&
2557+
return ((IS_ELKHARTLAKE(i915) &&
25582558
IS_DISPLAY_STEP(i915, STEP_B0, STEP_FOREVER)) ||
25592559
IS_TIGERLAKE(i915) || IS_ALDERLAKE_S(i915) || IS_ALDERLAKE_P(i915)) &&
25602560
i915->display.dpll.ref_clks.nssc == 38400;

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ const char *intel_drrs_type_str(enum drrs_type drrs_type)
6363
return str[drrs_type];
6464
}
6565

66+
bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915,
67+
enum transcoder cpu_transcoder)
68+
{
69+
if (HAS_DOUBLE_BUFFERED_M_N(i915))
70+
return true;
71+
72+
return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder);
73+
}
74+
6675
static void
6776
intel_drrs_set_refresh_rate_pipeconf(struct intel_crtc *crtc,
6877
enum drrs_refresh_rate refresh_rate)
@@ -312,9 +321,8 @@ static int intel_drrs_debugfs_status_show(struct seq_file *m, void *unused)
312321
mutex_lock(&crtc->drrs.mutex);
313322

314323
seq_printf(m, "DRRS capable: %s\n",
315-
str_yes_no(crtc_state->has_drrs ||
316-
HAS_DOUBLE_BUFFERED_M_N(i915) ||
317-
intel_cpu_transcoder_has_m2_n2(i915, crtc_state->cpu_transcoder)));
324+
str_yes_no(intel_cpu_transcoder_has_drrs(i915,
325+
crtc_state->cpu_transcoder)));
318326

319327
seq_printf(m, "DRRS enabled: %s\n",
320328
str_yes_no(crtc_state->has_drrs));

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99
#include <linux/types.h>
1010

1111
enum drrs_type;
12+
enum transcoder;
1213
struct drm_i915_private;
1314
struct intel_atomic_state;
1415
struct intel_crtc;
1516
struct intel_crtc_state;
1617
struct intel_connector;
1718

19+
bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915,
20+
enum transcoder cpu_transcoder);
1821
const char *intel_drrs_type_str(enum drrs_type drrs_type);
1922
bool intel_drrs_is_active(struct intel_crtc *crtc);
2023
void intel_drrs_activate(const struct intel_crtc_state *crtc_state);

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ static int intel_dsb_dewake_scanline(const struct intel_crtc_state *crtc_state)
340340
return max(0, vblank_start - intel_usecs_to_scanlines(adjusted_mode, latency));
341341
}
342342

343+
static u32 dsb_chicken(struct intel_crtc *crtc)
344+
{
345+
if (crtc->mode_flags & I915_MODE_FLAG_VRR)
346+
return DSB_CTRL_WAIT_SAFE_WINDOW |
347+
DSB_CTRL_NO_WAIT_VBLANK |
348+
DSB_INST_WAIT_SAFE_WINDOW |
349+
DSB_INST_NO_WAIT_VBLANK;
350+
else
351+
return 0;
352+
}
353+
343354
static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
344355
int dewake_scanline)
345356
{
@@ -361,6 +372,9 @@ static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
361372
intel_de_write_fw(dev_priv, DSB_CTRL(pipe, dsb->id),
362373
ctrl | DSB_ENABLE);
363374

375+
intel_de_write_fw(dev_priv, DSB_CHICKEN(pipe, dsb->id),
376+
dsb_chicken(crtc));
377+
364378
intel_de_write_fw(dev_priv, DSB_HEAD(pipe, dsb->id),
365379
intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf));
366380

0 commit comments

Comments
 (0)