Skip to content

Commit e1e1f4e

Browse files
committed
Merge drm/drm-next into drm-intel-gt-next
In order to get the GSC Support merged on drm-intel-gt-next in a clean fashion we needed this ATS-M patch to avoid conflict in i915_pci.c: commit 412c942 ("drm/i915/ats-m: add ATS-M platform info") -- Fixing a silent conflict on drivers/gpu/drm/i915/gt/intel_gt_gmch.c: - if (!intel_vtd_active(i915)) + if (!i915_vtd_active(i915)) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2 parents 0f9fc0c + c54b39a commit e1e1f4e

File tree

150 files changed

+4340
-3676
lines changed

Some content is hidden

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

150 files changed

+4340
-3676
lines changed

Documentation/gpu/i915.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,7 @@ Display Refresh Rate Switching (DRRS)
187187
:doc: Display Refresh Rate Switching (DRRS)
188188

189189
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_drrs.c
190-
:functions: intel_drrs_enable
191-
192-
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_drrs.c
193-
:functions: intel_drrs_disable
194-
195-
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_drrs.c
196-
:functions: intel_drrs_invalidate
197-
198-
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_drrs.c
199-
:functions: intel_drrs_flush
200-
201-
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_drrs.c
202-
:functions: intel_drrs_init
190+
:internal:
203191

204192
DPIO
205193
----

arch/x86/kernel/early-quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/bcma/bcma_regs.h>
1919
#include <linux/platform_data/x86/apple.h>
2020
#include <drm/i915_drm.h>
21+
#include <drm/i915_pciids.h>
2122
#include <asm/pci-direct.h>
2223
#include <asm/dma.h>
2324
#include <asm/io_apic.h>

drivers/gpu/drm/dp/drm_dp.c

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,35 +2390,56 @@ int drm_dp_dsc_sink_supported_input_bpcs(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_S
23902390
}
23912391
EXPORT_SYMBOL(drm_dp_dsc_sink_supported_input_bpcs);
23922392

2393+
static int drm_dp_read_lttpr_regs(struct drm_dp_aux *aux,
2394+
const u8 dpcd[DP_RECEIVER_CAP_SIZE], int address,
2395+
u8 *buf, int buf_size)
2396+
{
2397+
/*
2398+
* At least the DELL P2715Q monitor with a DPCD_REV < 0x14 returns
2399+
* corrupted values when reading from the 0xF0000- range with a block
2400+
* size bigger than 1.
2401+
*/
2402+
int block_size = dpcd[DP_DPCD_REV] < 0x14 ? 1 : buf_size;
2403+
int offset;
2404+
int ret;
2405+
2406+
for (offset = 0; offset < buf_size; offset += block_size) {
2407+
ret = drm_dp_dpcd_read(aux,
2408+
address + offset,
2409+
&buf[offset], block_size);
2410+
if (ret < 0)
2411+
return ret;
2412+
2413+
WARN_ON(ret != block_size);
2414+
}
2415+
2416+
return 0;
2417+
}
2418+
23932419
/**
23942420
* drm_dp_read_lttpr_common_caps - read the LTTPR common capabilities
23952421
* @aux: DisplayPort AUX channel
2422+
* @dpcd: DisplayPort configuration data
23962423
* @caps: buffer to return the capability info in
23972424
*
23982425
* Read capabilities common to all LTTPRs.
23992426
*
24002427
* Returns 0 on success or a negative error code on failure.
24012428
*/
24022429
int drm_dp_read_lttpr_common_caps(struct drm_dp_aux *aux,
2430+
const u8 dpcd[DP_RECEIVER_CAP_SIZE],
24032431
u8 caps[DP_LTTPR_COMMON_CAP_SIZE])
24042432
{
2405-
int ret;
2406-
2407-
ret = drm_dp_dpcd_read(aux,
2408-
DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV,
2409-
caps, DP_LTTPR_COMMON_CAP_SIZE);
2410-
if (ret < 0)
2411-
return ret;
2412-
2413-
WARN_ON(ret != DP_LTTPR_COMMON_CAP_SIZE);
2414-
2415-
return 0;
2433+
return drm_dp_read_lttpr_regs(aux, dpcd,
2434+
DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV,
2435+
caps, DP_LTTPR_COMMON_CAP_SIZE);
24162436
}
24172437
EXPORT_SYMBOL(drm_dp_read_lttpr_common_caps);
24182438

24192439
/**
24202440
* drm_dp_read_lttpr_phy_caps - read the capabilities for a given LTTPR PHY
24212441
* @aux: DisplayPort AUX channel
2442+
* @dpcd: DisplayPort configuration data
24222443
* @dp_phy: LTTPR PHY to read the capabilities for
24232444
* @caps: buffer to return the capability info in
24242445
*
@@ -2427,20 +2448,13 @@ EXPORT_SYMBOL(drm_dp_read_lttpr_common_caps);
24272448
* Returns 0 on success or a negative error code on failure.
24282449
*/
24292450
int drm_dp_read_lttpr_phy_caps(struct drm_dp_aux *aux,
2451+
const u8 dpcd[DP_RECEIVER_CAP_SIZE],
24302452
enum drm_dp_phy dp_phy,
24312453
u8 caps[DP_LTTPR_PHY_CAP_SIZE])
24322454
{
2433-
int ret;
2434-
2435-
ret = drm_dp_dpcd_read(aux,
2436-
DP_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER(dp_phy),
2437-
caps, DP_LTTPR_PHY_CAP_SIZE);
2438-
if (ret < 0)
2439-
return ret;
2440-
2441-
WARN_ON(ret != DP_LTTPR_PHY_CAP_SIZE);
2442-
2443-
return 0;
2455+
return drm_dp_read_lttpr_regs(aux, dpcd,
2456+
DP_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER(dp_phy),
2457+
caps, DP_LTTPR_PHY_CAP_SIZE);
24442458
}
24452459
EXPORT_SYMBOL(drm_dp_read_lttpr_phy_caps);
24462460

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ i915-y += \
220220
display/intel_cursor.o \
221221
display/intel_display.o \
222222
display/intel_display_power.o \
223+
display/intel_display_power_well.o \
223224
display/intel_dmc.o \
224225
display/intel_dpio_phy.o \
225226
display/intel_dpll.o \

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

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* DisplayPort support for G4x,ILK,SNB,IVB,VLV,CHV (HSW+ handled by the DDI code).
66
*/
77

8+
#include <linux/string_helpers.h>
9+
810
#include "g4x_dp.h"
911
#include "intel_audio.h"
1012
#include "intel_backlight.h"
@@ -22,58 +24,37 @@
2224
#include "intel_pps.h"
2325
#include "vlv_sideband.h"
2426

25-
struct dp_link_dpll {
26-
int clock;
27-
struct dpll dpll;
27+
static const struct dpll g4x_dpll[] = {
28+
{ .dot = 162000, .p1 = 2, .p2 = 10, .n = 2, .m1 = 23, .m2 = 8, },
29+
{ .dot = 270000, .p1 = 1, .p2 = 10, .n = 1, .m1 = 14, .m2 = 2, },
2830
};
2931

30-
static const struct dp_link_dpll g4x_dpll[] = {
31-
{ 162000,
32-
{ .p1 = 2, .p2 = 10, .n = 2, .m1 = 23, .m2 = 8 } },
33-
{ 270000,
34-
{ .p1 = 1, .p2 = 10, .n = 1, .m1 = 14, .m2 = 2 } }
32+
static const struct dpll pch_dpll[] = {
33+
{ .dot = 162000, .p1 = 2, .p2 = 10, .n = 1, .m1 = 12, .m2 = 9, },
34+
{ .dot = 270000, .p1 = 1, .p2 = 10, .n = 2, .m1 = 14, .m2 = 8, },
3535
};
3636

37-
static const struct dp_link_dpll pch_dpll[] = {
38-
{ 162000,
39-
{ .p1 = 2, .p2 = 10, .n = 1, .m1 = 12, .m2 = 9 } },
40-
{ 270000,
41-
{ .p1 = 1, .p2 = 10, .n = 2, .m1 = 14, .m2 = 8 } }
37+
static const struct dpll vlv_dpll[] = {
38+
{ .dot = 162000, .p1 = 3, .p2 = 2, .n = 5, .m1 = 3, .m2 = 81, },
39+
{ .dot = 270000, .p1 = 2, .p2 = 2, .n = 1, .m1 = 2, .m2 = 27, },
4240
};
4341

44-
static const struct dp_link_dpll vlv_dpll[] = {
45-
{ 162000,
46-
{ .p1 = 3, .p2 = 2, .n = 5, .m1 = 3, .m2 = 81 } },
47-
{ 270000,
48-
{ .p1 = 2, .p2 = 2, .n = 1, .m1 = 2, .m2 = 27 } }
49-
};
50-
51-
/*
52-
* CHV supports eDP 1.4 that have more link rates.
53-
* Below only provides the fixed rate but exclude variable rate.
54-
*/
55-
static const struct dp_link_dpll chv_dpll[] = {
56-
/*
57-
* CHV requires to program fractional division for m2.
58-
* m2 is stored in fixed point format using formula below
59-
* (m2_int << 22) | m2_fraction
60-
*/
61-
{ 162000, /* m2_int = 32, m2_fraction = 1677722 */
62-
{ .p1 = 4, .p2 = 2, .n = 1, .m1 = 2, .m2 = 0x819999a } },
63-
{ 270000, /* m2_int = 27, m2_fraction = 0 */
64-
{ .p1 = 4, .p2 = 1, .n = 1, .m1 = 2, .m2 = 0x6c00000 } },
42+
static const struct dpll chv_dpll[] = {
43+
/* m2 is .22 binary fixed point */
44+
{ .dot = 162000, .p1 = 4, .p2 = 2, .n = 1, .m1 = 2, .m2 = 0x819999a /* 32.4 */ },
45+
{ .dot = 270000, .p1 = 4, .p2 = 1, .n = 1, .m1 = 2, .m2 = 0x6c00000 /* 27.0 */ },
6546
};
6647

6748
const struct dpll *vlv_get_dpll(struct drm_i915_private *i915)
6849
{
69-
return IS_CHERRYVIEW(i915) ? &chv_dpll[0].dpll : &vlv_dpll[0].dpll;
50+
return IS_CHERRYVIEW(i915) ? &chv_dpll[0] : &vlv_dpll[0];
7051
}
7152

7253
void g4x_dp_set_clock(struct intel_encoder *encoder,
7354
struct intel_crtc_state *pipe_config)
7455
{
7556
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
76-
const struct dp_link_dpll *divisor = NULL;
57+
const struct dpll *divisor = NULL;
7758
int i, count = 0;
7859

7960
if (IS_G4X(dev_priv)) {
@@ -92,8 +73,8 @@ void g4x_dp_set_clock(struct intel_encoder *encoder,
9273

9374
if (divisor && count) {
9475
for (i = 0; i < count; i++) {
95-
if (pipe_config->port_clock == divisor[i].clock) {
96-
pipe_config->dpll = divisor[i].dpll;
76+
if (pipe_config->port_clock == divisor[i].dot) {
77+
pipe_config->dpll = divisor[i];
9778
pipe_config->clock_set = true;
9879
break;
9980
}
@@ -192,7 +173,7 @@ static void assert_dp_port(struct intel_dp *intel_dp, bool state)
192173
I915_STATE_WARN(cur_state != state,
193174
"[ENCODER:%d:%s] state assertion failure (expected %s, current %s)\n",
194175
dig_port->base.base.base.id, dig_port->base.base.name,
195-
onoff(state), onoff(cur_state));
176+
str_on_off(state), str_on_off(cur_state));
196177
}
197178
#define assert_dp_port_disabled(d) assert_dp_port((d), false)
198179

@@ -202,7 +183,7 @@ static void assert_edp_pll(struct drm_i915_private *dev_priv, bool state)
202183

203184
I915_STATE_WARN(cur_state != state,
204185
"eDP PLL state assertion failure (expected %s, current %s)\n",
205-
onoff(state), onoff(cur_state));
186+
str_on_off(state), str_on_off(cur_state));
206187
}
207188
#define assert_edp_pll_enabled(d) assert_edp_pll((d), true)
208189
#define assert_edp_pll_disabled(d) assert_edp_pll((d), false)
@@ -514,9 +495,7 @@ static void intel_disable_dp(struct intel_atomic_state *state,
514495

515496
intel_dp->link_trained = false;
516497

517-
if (old_crtc_state->has_audio)
518-
intel_audio_codec_disable(encoder,
519-
old_crtc_state, old_conn_state);
498+
intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state);
520499

521500
/*
522501
* Make sure the panel is off before trying to change the mode.
@@ -677,9 +656,7 @@ static void intel_enable_dp(struct intel_atomic_state *state,
677656
{
678657
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
679658
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
680-
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
681659
u32 dp_reg = intel_de_read(dev_priv, intel_dp->output_reg);
682-
enum pipe pipe = crtc->pipe;
683660
intel_wakeref_t wakeref;
684661

685662
if (drm_WARN_ON(&dev_priv->drm, dp_reg & DP_PORT_EN))
@@ -713,11 +690,7 @@ static void intel_enable_dp(struct intel_atomic_state *state,
713690
intel_dp_start_link_train(intel_dp, pipe_config);
714691
intel_dp_stop_link_train(intel_dp, pipe_config);
715692

716-
if (pipe_config->has_audio) {
717-
drm_dbg(&dev_priv->drm, "Enabling DP audio on pipe %c\n",
718-
pipe_name(pipe));
719-
intel_audio_codec_enable(encoder, pipe_config, conn_state);
720-
}
693+
intel_audio_codec_enable(encoder, pipe_config, conn_state);
721694
}
722695

723696
static void g4x_enable_dp(struct intel_atomic_state *state,

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

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,6 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
143143
&pipe_config->infoframes.hdmi);
144144
}
145145

146-
static void intel_enable_hdmi_audio(struct intel_encoder *encoder,
147-
const struct intel_crtc_state *pipe_config,
148-
const struct drm_connector_state *conn_state)
149-
{
150-
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
151-
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
152-
153-
drm_WARN_ON(&i915->drm, !pipe_config->has_hdmi_sink);
154-
drm_dbg_kms(&i915->drm, "Enabling HDMI audio on pipe %c\n",
155-
pipe_name(crtc->pipe));
156-
intel_audio_codec_enable(encoder, pipe_config, conn_state);
157-
}
158-
159146
static void g4x_enable_hdmi(struct intel_atomic_state *state,
160147
struct intel_encoder *encoder,
161148
const struct intel_crtc_state *pipe_config,
@@ -175,8 +162,9 @@ static void g4x_enable_hdmi(struct intel_atomic_state *state,
175162
intel_de_write(dev_priv, intel_hdmi->hdmi_reg, temp);
176163
intel_de_posting_read(dev_priv, intel_hdmi->hdmi_reg);
177164

178-
if (pipe_config->has_audio)
179-
intel_enable_hdmi_audio(encoder, pipe_config, conn_state);
165+
drm_WARN_ON(&dev_priv->drm, pipe_config->has_audio &&
166+
!pipe_config->has_hdmi_sink);
167+
intel_audio_codec_enable(encoder, pipe_config, conn_state);
180168
}
181169

182170
static void ibx_enable_hdmi(struct intel_atomic_state *state,
@@ -227,8 +215,9 @@ static void ibx_enable_hdmi(struct intel_atomic_state *state,
227215
intel_de_posting_read(dev_priv, intel_hdmi->hdmi_reg);
228216
}
229217

230-
if (pipe_config->has_audio)
231-
intel_enable_hdmi_audio(encoder, pipe_config, conn_state);
218+
drm_WARN_ON(&dev_priv->drm, pipe_config->has_audio &&
219+
!pipe_config->has_hdmi_sink);
220+
intel_audio_codec_enable(encoder, pipe_config, conn_state);
232221
}
233222

234223
static void cpt_enable_hdmi(struct intel_atomic_state *state,
@@ -281,8 +270,9 @@ static void cpt_enable_hdmi(struct intel_atomic_state *state,
281270
intel_de_read(dev_priv, TRANS_CHICKEN1(pipe)) & ~TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE);
282271
}
283272

284-
if (pipe_config->has_audio)
285-
intel_enable_hdmi_audio(encoder, pipe_config, conn_state);
273+
drm_WARN_ON(&dev_priv->drm, pipe_config->has_audio &&
274+
!pipe_config->has_hdmi_sink);
275+
intel_audio_codec_enable(encoder, pipe_config, conn_state);
286276
}
287277

288278
static void vlv_enable_hdmi(struct intel_atomic_state *state,
@@ -356,9 +346,7 @@ static void g4x_disable_hdmi(struct intel_atomic_state *state,
356346
const struct intel_crtc_state *old_crtc_state,
357347
const struct drm_connector_state *old_conn_state)
358348
{
359-
if (old_crtc_state->has_audio)
360-
intel_audio_codec_disable(encoder,
361-
old_crtc_state, old_conn_state);
349+
intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state);
362350

363351
intel_disable_hdmi(state, encoder, old_crtc_state, old_conn_state);
364352
}
@@ -368,9 +356,7 @@ static void pch_disable_hdmi(struct intel_atomic_state *state,
368356
const struct intel_crtc_state *old_crtc_state,
369357
const struct drm_connector_state *old_conn_state)
370358
{
371-
if (old_crtc_state->has_audio)
372-
intel_audio_codec_disable(encoder,
373-
old_crtc_state, old_conn_state);
359+
intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state);
374360
}
375361

376362
static void pch_post_disable_hdmi(struct intel_atomic_state *state,

0 commit comments

Comments
 (0)