Skip to content

Commit 9cc06db

Browse files
committed
Merge tag 'drm-intel-next-2024-12-11' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
Core Changes: - drm/print: add drm_print_hex_dump() Driver Changes: - HDCP fixes and updates for Xe3lpd and for HDCP 1.4 (Suraj) - Add dedicated lock for each sideband (Jani) - New GSC FW for ARL-H and ARL-U (Daniele) - Add support for 3 VDSC engines 12 slices (Ankit) - Sanitize MBUS joining (Ville) - Fixes in DP MST (Imre) - Stop using pixel_format_from_register_bits() to parse VBT (Ville) - Declutter CDCLK code (Ville) - PSR clean up and fixes (Jouni, Jani, Animesh) - DMC wakelock - Fixes and enablement for Xe3_LPD (Gustavo) - Demote source OUI read/write failure logging to debug (Jani) - Potential boot oops fix and some general cleanups (Ville) - Scaler code cleanups (Ville) - More conversion towards struct intel_display and general cleanups (Jani) - Limit max compressed bpp to 18 when forcing DSC (Ankit) - Start to reconcile i915's and xe's display power mgt sequences (Rodrigo) - Some correction in the DP Link Training sequence (Arun) - Avoid setting YUV420_MODE in PIPE_MISC on Xe3lpd (Ankit) - MST and DDI cleanups and refactoring (Jani) - Fixed an typo in i915_gem_gtt.c (Zhang) - Try to make DPT shrinkable again (Ville) - Try to fix CPU MMIO fails during legacy LUT updates (Ville) - Some PPS cleanups (Ville, Jani) - Use seq buf for printing rates (Jani) - Flush DMC wakelock release work at the end of runtime suspend (Gustavo) - Fix NULL pointer dereference in capture_engine (Eugene) - Fix memory leak by correcting cache object name in error handler (Jiasheng) - Small refactor in WM/DPKGC for modifying latency programmed into PKG_C_LATENCY (Suraj) - Add drm_printer based hex dumper and use it (Jani) - Move g4x code to specific g4x functions (Jani) Signed-off-by: Simona Vetter <[email protected]> From: Rodrigo Vivi <[email protected]> [sima: conflict in intel_dp_mst.c due to conversion to drm_connector_dynamic_init that landed through drm-misc] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents d678c63 + e7f0a3a commit 9cc06db

File tree

112 files changed

+4157
-3443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+4157
-3443
lines changed

drivers/gpu/drm/drm_print.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,26 @@ void drm_print_regset32(struct drm_printer *p, struct debugfs_regset32 *regset)
390390
}
391391
}
392392
EXPORT_SYMBOL(drm_print_regset32);
393+
394+
/**
395+
* drm_print_hex_dump - print a hex dump to a &drm_printer stream
396+
* @p: The &drm_printer
397+
* @prefix: Prefix for each line, may be NULL for no prefix
398+
* @buf: Buffer to dump
399+
* @len: Length of buffer
400+
*
401+
* Print hex dump to &drm_printer, with 16 space-separated hex bytes per line,
402+
* optionally with a prefix on each line. No separator is added after prefix.
403+
*/
404+
void drm_print_hex_dump(struct drm_printer *p, const char *prefix,
405+
const u8 *buf, size_t len)
406+
{
407+
int i;
408+
409+
for (i = 0; i < len; i += 16) {
410+
int bytes_per_line = min(16, len - i);
411+
412+
drm_printf(p, "%s%*ph\n", prefix ?: "", bytes_per_line, buf + i);
413+
}
414+
}
415+
EXPORT_SYMBOL(drm_print_hex_dump);

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ i915-y += \
3030
i915_params.o \
3131
i915_pci.o \
3232
i915_scatterlist.o \
33-
i915_suspend.o \
3433
i915_switcheroo.o \
3534
i915_sysfs.o \
3635
i915_utils.o \
@@ -220,6 +219,7 @@ i915-$(CONFIG_HWMON) += \
220219
i915-y += \
221220
display/hsw_ips.o \
222221
display/i9xx_plane.o \
222+
display/i9xx_display_sr.o \
223223
display/i9xx_wm.o \
224224
display/intel_alpm.o \
225225
display/intel_atomic.o \

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const struct dpll *vlv_get_dpll(struct drm_i915_private *i915)
5555
return IS_CHERRYVIEW(i915) ? &chv_dpll[0] : &vlv_dpll[0];
5656
}
5757

58-
void g4x_dp_set_clock(struct intel_encoder *encoder,
59-
struct intel_crtc_state *pipe_config)
58+
static void g4x_dp_set_clock(struct intel_encoder *encoder,
59+
struct intel_crtc_state *pipe_config)
6060
{
6161
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
6262
const struct dpll *divisor = NULL;
@@ -1223,6 +1223,25 @@ static bool ilk_digital_port_connected(struct intel_encoder *encoder)
12231223
return intel_de_read(display, DEISR) & bit;
12241224
}
12251225

1226+
static int g4x_dp_compute_config(struct intel_encoder *encoder,
1227+
struct intel_crtc_state *crtc_state,
1228+
struct drm_connector_state *conn_state)
1229+
{
1230+
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1231+
int ret;
1232+
1233+
if (HAS_PCH_SPLIT(i915) && encoder->port != PORT_A)
1234+
crtc_state->has_pch_encoder = true;
1235+
1236+
ret = intel_dp_compute_config(encoder, crtc_state, conn_state);
1237+
if (ret)
1238+
return ret;
1239+
1240+
g4x_dp_set_clock(encoder, crtc_state);
1241+
1242+
return 0;
1243+
}
1244+
12261245
static void g4x_dp_suspend_complete(struct intel_encoder *encoder)
12271246
{
12281247
/*
@@ -1307,7 +1326,7 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv,
13071326
intel_encoder_link_check_init(intel_encoder, intel_dp_link_check);
13081327

13091328
intel_encoder->hotplug = intel_dp_hotplug;
1310-
intel_encoder->compute_config = intel_dp_compute_config;
1329+
intel_encoder->compute_config = g4x_dp_compute_config;
13111330
intel_encoder->get_hw_state = intel_dp_get_hw_state;
13121331
intel_encoder->get_config = intel_dp_get_config;
13131332
intel_encoder->sync_state = intel_dp_sync_state;

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ struct intel_encoder;
1919

2020
#ifdef I915
2121
const struct dpll *vlv_get_dpll(struct drm_i915_private *i915);
22-
void g4x_dp_set_clock(struct intel_encoder *encoder,
23-
struct intel_crtc_state *pipe_config);
2422
bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv,
2523
i915_reg_t dp_reg, enum port port,
2624
enum pipe *pipe);
@@ -31,10 +29,6 @@ static inline const struct dpll *vlv_get_dpll(struct drm_i915_private *i915)
3129
{
3230
return NULL;
3331
}
34-
static inline void g4x_dp_set_clock(struct intel_encoder *encoder,
35-
struct intel_crtc_state *pipe_config)
36-
{
37-
}
3832
static inline bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv,
3933
i915_reg_t dp_reg, int port,
4034
enum pipe *pipe)

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,12 @@ void hsw_ips_post_update(struct intel_atomic_state *state,
185185
/* IPS only exists on ULT machines and is tied to pipe A. */
186186
bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
187187
{
188-
return HAS_IPS(to_i915(crtc->base.dev)) && crtc->pipe == PIPE_A;
188+
struct intel_display *display = to_intel_display(crtc);
189+
190+
return HAS_IPS(display) && crtc->pipe == PIPE_A;
189191
}
190192

191-
bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state)
193+
static bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state)
192194
{
193195
struct intel_display *display = to_intel_display(crtc_state);
194196
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
@@ -218,6 +220,20 @@ bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state)
218220
return true;
219221
}
220222

223+
int hsw_ips_min_cdclk(const struct intel_crtc_state *crtc_state)
224+
{
225+
struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
226+
227+
if (!IS_BROADWELL(i915))
228+
return 0;
229+
230+
if (!hsw_crtc_state_ips_capable(crtc_state))
231+
return 0;
232+
233+
/* pixel rate mustn't exceed 95% of cdclk with IPS on BDW */
234+
return DIV_ROUND_UP(crtc_state->pixel_rate * 100, 95);
235+
}
236+
221237
int hsw_ips_compute_config(struct intel_atomic_state *state,
222238
struct intel_crtc *crtc)
223239
{

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bool hsw_ips_pre_update(struct intel_atomic_state *state,
1919
void hsw_ips_post_update(struct intel_atomic_state *state,
2020
struct intel_crtc *crtc);
2121
bool hsw_crtc_supports_ips(struct intel_crtc *crtc);
22-
bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state);
22+
int hsw_ips_min_cdclk(const struct intel_crtc_state *crtc_state);
2323
int hsw_ips_compute_config(struct intel_atomic_state *state,
2424
struct intel_crtc *crtc);
2525
void hsw_ips_get_config(struct intel_crtc_state *crtc_state);
@@ -42,9 +42,9 @@ static inline bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
4242
{
4343
return false;
4444
}
45-
static inline bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state)
45+
static inline int hsw_ips_min_cdclk(const struct intel_crtc_state *crtc_state)
4646
{
47-
return false;
47+
return 0;
4848
}
4949
static inline int hsw_ips_compute_config(struct intel_atomic_state *state,
5050
struct intel_crtc *crtc)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Copyright © 2024 Intel Corporation
4+
*/
5+
6+
#include "i915_drv.h"
7+
#include "i915_reg.h"
8+
#include "i9xx_display_sr.h"
9+
#include "intel_de.h"
10+
#include "intel_gmbus.h"
11+
#include "intel_pci_config.h"
12+
13+
static void i9xx_display_save_swf(struct intel_display *display)
14+
{
15+
int i;
16+
17+
/* Scratch space */
18+
if (DISPLAY_VER(display) == 2 && display->platform.mobile) {
19+
for (i = 0; i < 7; i++) {
20+
display->restore.saveSWF0[i] = intel_de_read(display, SWF0(display, i));
21+
display->restore.saveSWF1[i] = intel_de_read(display, SWF1(display, i));
22+
}
23+
for (i = 0; i < 3; i++)
24+
display->restore.saveSWF3[i] = intel_de_read(display, SWF3(display, i));
25+
} else if (DISPLAY_VER(display) == 2) {
26+
for (i = 0; i < 7; i++)
27+
display->restore.saveSWF1[i] = intel_de_read(display, SWF1(display, i));
28+
} else if (HAS_GMCH(display)) {
29+
for (i = 0; i < 16; i++) {
30+
display->restore.saveSWF0[i] = intel_de_read(display, SWF0(display, i));
31+
display->restore.saveSWF1[i] = intel_de_read(display, SWF1(display, i));
32+
}
33+
for (i = 0; i < 3; i++)
34+
display->restore.saveSWF3[i] = intel_de_read(display, SWF3(display, i));
35+
}
36+
}
37+
38+
static void i9xx_display_restore_swf(struct intel_display *display)
39+
{
40+
int i;
41+
42+
/* Scratch space */
43+
if (DISPLAY_VER(display) == 2 && display->platform.mobile) {
44+
for (i = 0; i < 7; i++) {
45+
intel_de_write(display, SWF0(display, i), display->restore.saveSWF0[i]);
46+
intel_de_write(display, SWF1(display, i), display->restore.saveSWF1[i]);
47+
}
48+
for (i = 0; i < 3; i++)
49+
intel_de_write(display, SWF3(display, i), display->restore.saveSWF3[i]);
50+
} else if (DISPLAY_VER(display) == 2) {
51+
for (i = 0; i < 7; i++)
52+
intel_de_write(display, SWF1(display, i), display->restore.saveSWF1[i]);
53+
} else if (HAS_GMCH(display)) {
54+
for (i = 0; i < 16; i++) {
55+
intel_de_write(display, SWF0(display, i), display->restore.saveSWF0[i]);
56+
intel_de_write(display, SWF1(display, i), display->restore.saveSWF1[i]);
57+
}
58+
for (i = 0; i < 3; i++)
59+
intel_de_write(display, SWF3(display, i), display->restore.saveSWF3[i]);
60+
}
61+
}
62+
63+
void i9xx_display_sr_save(struct intel_display *display)
64+
{
65+
struct pci_dev *pdev = to_pci_dev(display->drm->dev);
66+
67+
if (!HAS_DISPLAY(display))
68+
return;
69+
70+
/* Display arbitration control */
71+
if (DISPLAY_VER(display) <= 4)
72+
display->restore.saveDSPARB = intel_de_read(display, DSPARB(display));
73+
74+
if (DISPLAY_VER(display) == 4)
75+
pci_read_config_word(pdev, GCDGMBUS, &display->restore.saveGCDGMBUS);
76+
77+
i9xx_display_save_swf(display);
78+
}
79+
80+
void i9xx_display_sr_restore(struct intel_display *display)
81+
{
82+
struct pci_dev *pdev = to_pci_dev(display->drm->dev);
83+
84+
if (!HAS_DISPLAY(display))
85+
return;
86+
87+
i9xx_display_restore_swf(display);
88+
89+
if (DISPLAY_VER(display) == 4)
90+
pci_write_config_word(pdev, GCDGMBUS, display->restore.saveGCDGMBUS);
91+
92+
/* Display arbitration */
93+
if (DISPLAY_VER(display) <= 4)
94+
intel_de_write(display, DSPARB(display), display->restore.saveDSPARB);
95+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/*
3+
* Copyright © 2024 Intel Corporation
4+
*/
5+
6+
#ifndef __I9XX_DISPLAY_SR_H__
7+
#define __I9XX_DISPLAY_SR_H__
8+
9+
struct intel_display;
10+
11+
void i9xx_display_sr_save(struct intel_display *display);
12+
void i9xx_display_sr_restore(struct intel_display *display);
13+
14+
#endif

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,9 @@ static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,
16021602

16031603
/* FIXME: split only when necessary */
16041604
if (crtc_state->dsc.slice_count > 1)
1605-
crtc_state->dsc.dsc_split = true;
1605+
crtc_state->dsc.num_streams = 2;
1606+
else
1607+
crtc_state->dsc.num_streams = 1;
16061608

16071609
/* FIXME: initialize from VBT */
16081610
vdsc_cfg->rc_model_size = DSC_RC_MODEL_SIZE_CONST;

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

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,11 @@ static void ibx_audio_codec_enable(struct intel_encoder *encoder,
681681

682682
void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state)
683683
{
684-
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
685-
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
684+
struct intel_display *display = to_intel_display(crtc_state);
686685
enum transcoder trans = crtc_state->cpu_transcoder;
687686

688-
if (HAS_DP20(i915))
689-
intel_de_rmw(i915, AUD_DP_2DOT0_CTRL(trans), AUD_ENABLE_SDP_SPLIT,
687+
if (HAS_DP20(display))
688+
intel_de_rmw(display, AUD_DP_2DOT0_CTRL(trans), AUD_ENABLE_SDP_SPLIT,
690689
crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0);
691690
}
692691

@@ -981,6 +980,53 @@ static void glk_force_audio_cdclk(struct drm_i915_private *i915,
981980
drm_modeset_acquire_fini(&ctx);
982981
}
983982

983+
int intel_audio_min_cdclk(const struct intel_crtc_state *crtc_state)
984+
{
985+
struct intel_display *display = to_intel_display(crtc_state);
986+
struct drm_i915_private *dev_priv = to_i915(display->drm);
987+
int min_cdclk = 0;
988+
989+
if (!crtc_state->has_audio)
990+
return 0;
991+
992+
/* BSpec says "Do not use DisplayPort with CDCLK less than 432 MHz,
993+
* audio enabled, port width x4, and link rate HBR2 (5.4 GHz), or else
994+
* there may be audio corruption or screen corruption." This cdclk
995+
* restriction for GLK is 316.8 MHz.
996+
*/
997+
if (intel_crtc_has_dp_encoder(crtc_state) &&
998+
crtc_state->port_clock >= 540000 &&
999+
crtc_state->lane_count == 4) {
1000+
if (DISPLAY_VER(display) == 10) {
1001+
/* Display WA #1145: glk */
1002+
min_cdclk = max(min_cdclk, 316800);
1003+
} else if (DISPLAY_VER(display) == 9 || IS_BROADWELL(dev_priv)) {
1004+
/* Display WA #1144: skl,bxt */
1005+
min_cdclk = max(min_cdclk, 432000);
1006+
}
1007+
}
1008+
1009+
/*
1010+
* According to BSpec, "The CD clock frequency must be at least twice
1011+
* the frequency of the Azalia BCLK." and BCLK is 96 MHz by default.
1012+
*/
1013+
if (DISPLAY_VER(display) >= 9)
1014+
min_cdclk = max(min_cdclk, 2 * 96000);
1015+
1016+
/*
1017+
* "For DP audio configuration, cdclk frequency shall be set to
1018+
* meet the following requirements:
1019+
* DP Link Frequency(MHz) | Cdclk frequency(MHz)
1020+
* 270 | 320 or higher
1021+
* 162 | 200 or higher"
1022+
*/
1023+
if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
1024+
intel_crtc_has_dp_encoder(crtc_state))
1025+
min_cdclk = max(min_cdclk, crtc_state->port_clock);
1026+
1027+
return min_cdclk;
1028+
}
1029+
9841030
static unsigned long i915_audio_component_get_power(struct device *kdev)
9851031
{
9861032
struct intel_display *display = to_intel_display(kdev);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ void intel_audio_codec_get_config(struct intel_encoder *encoder,
2727
struct intel_crtc_state *crtc_state);
2828
void intel_audio_cdclk_change_pre(struct drm_i915_private *dev_priv);
2929
void intel_audio_cdclk_change_post(struct drm_i915_private *dev_priv);
30+
int intel_audio_min_cdclk(const struct intel_crtc_state *crtc_state);
3031
void intel_audio_init(struct drm_i915_private *dev_priv);
3132
void intel_audio_register(struct drm_i915_private *i915);
3233
void intel_audio_deinit(struct drm_i915_private *dev_priv);

0 commit comments

Comments
 (0)