Skip to content

Commit a2098e8

Browse files
committed
Merge tag 'drm-intel-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
Cross-subsystem Changes: - x86/gpu: add JasperLake to gen11 early quirks (Although the patch lacks the Ack info, it has been Acked by Borislav) Driver Changes: - General DMC improves (Anusha) - More ADL-P enabling (Vandita, Matt, Jose, Mika, Anusha, Imre, Lucas, Jani, Manasi, Ville, Stanislav) - Introduce MBUS relative dbuf offset (Ville) - PSR fixes and improvements (Gwan, Jose, Ville) - Re-enable LTTPR non-transparent LT mode for DPCD_REV < 1.4 (Ville) - Remove duplicated declarations (Shaokun, Wan) - Check HDMI sink deep color capabilities during .mode_valid (Ville) - Fix display flicker screan related to console and FBC (Chris) - Remaining conversions of GRAPHICS_VER (Lucas) - Drop invalid FIXME (Jose) - Fix bigjoiner check in dsc_disable (Vandita) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/YMEy2Ew82BeL/[email protected]
2 parents 691cf8c + 0d6695b commit a2098e8

Some content is hidden

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

76 files changed

+2421
-888
lines changed

Documentation/gpu/i915.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ DPIO
210210
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_dpio_phy.c
211211
:doc: DPIO
212212

213-
CSR firmware support for DMC
214-
----------------------------
213+
DMC Firmware Support
214+
--------------------
215215

216-
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_csr.c
217-
:doc: csr support for dmc
216+
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_dmc.c
217+
:doc: DMC Firmware Support
218218

219-
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_csr.c
219+
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_dmc.c
220220
:internal:
221221

222222
Video BIOS Table (VBT)
@@ -537,7 +537,7 @@ The HuC FW layout is the same as the GuC one, see `GuC Firmware Layout`_
537537

538538
DMC
539539
---
540-
See `CSR firmware support for DMC`_
540+
See `DMC Firmware Support`_
541541

542542
Tracing
543543
=======

arch/x86/kernel/early-quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ static const struct pci_device_id intel_early_ids[] __initconst = {
549549
INTEL_CNL_IDS(&gen9_early_ops),
550550
INTEL_ICL_11_IDS(&gen11_early_ops),
551551
INTEL_EHL_IDS(&gen11_early_ops),
552+
INTEL_JSL_IDS(&gen11_early_ops),
552553
INTEL_TGL_12_IDS(&gen11_early_ops),
553554
INTEL_RKL_IDS(&gen11_early_ops),
554555
INTEL_ADLS_IDS(&gen11_early_ops),

drivers/gpu/drm/i915/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ i915-y += \
201201
display/intel_combo_phy.o \
202202
display/intel_connector.o \
203203
display/intel_crtc.o \
204-
display/intel_csr.o \
205204
display/intel_cursor.o \
206205
display/intel_display.o \
207206
display/intel_display_power.o \
207+
display/intel_dmc.o \
208208
display/intel_dpio_phy.o \
209209
display/intel_dpll.o \
210210
display/intel_dpll_mgr.o \
@@ -263,6 +263,7 @@ i915-y += \
263263
display/intel_lvds.o \
264264
display/intel_panel.o \
265265
display/intel_pps.o \
266+
display/intel_qp_tables.o \
266267
display/intel_sdvo.o \
267268
display/intel_tv.o \
268269
display/intel_vdsc.o \

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,19 @@ static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder,
363363
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
364364
enum port port;
365365
int afe_clk_khz;
366-
u32 esc_clk_div_m;
366+
int theo_word_clk, act_word_clk;
367+
u32 esc_clk_div_m, esc_clk_div_m_phy;
367368

368369
afe_clk_khz = afe_clk(encoder, crtc_state);
369-
esc_clk_div_m = DIV_ROUND_UP(afe_clk_khz, DSI_MAX_ESC_CLK);
370+
371+
if (IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv)) {
372+
theo_word_clk = DIV_ROUND_UP(afe_clk_khz, 8 * DSI_MAX_ESC_CLK);
373+
act_word_clk = max(3, theo_word_clk + (theo_word_clk + 1) % 2);
374+
esc_clk_div_m = act_word_clk * 8;
375+
esc_clk_div_m_phy = (act_word_clk - 1) / 2;
376+
} else {
377+
esc_clk_div_m = DIV_ROUND_UP(afe_clk_khz, DSI_MAX_ESC_CLK);
378+
}
370379

371380
for_each_dsi_port(port, intel_dsi->ports) {
372381
intel_de_write(dev_priv, ICL_DSI_ESC_CLK_DIV(port),
@@ -379,6 +388,14 @@ static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder,
379388
esc_clk_div_m & ICL_ESC_CLK_DIV_MASK);
380389
intel_de_posting_read(dev_priv, ICL_DPHY_ESC_CLK_DIV(port));
381390
}
391+
392+
if (IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv)) {
393+
for_each_dsi_port(port, intel_dsi->ports) {
394+
intel_de_write(dev_priv, ADL_MIPIO_DW(port, 8),
395+
esc_clk_div_m_phy & TX_ESC_CLK_DIV_PHY);
396+
intel_de_posting_read(dev_priv, ADL_MIPIO_DW(port, 8));
397+
}
398+
}
382399
}
383400

384401
static void get_dsi_io_power_domains(struct drm_i915_private *dev_priv,

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,26 @@ intel_connector_needs_modeset(struct intel_atomic_state *state,
187187
new_conn_state->crtc)));
188188
}
189189

190+
/**
191+
* intel_any_crtc_needs_modeset - check if any CRTC needs a modeset
192+
* @state: the atomic state corresponding to this modeset
193+
*
194+
* Returns true if any CRTC in @state needs a modeset.
195+
*/
196+
bool intel_any_crtc_needs_modeset(struct intel_atomic_state *state)
197+
{
198+
struct intel_crtc *crtc;
199+
struct intel_crtc_state *crtc_state;
200+
int i;
201+
202+
for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
203+
if (intel_crtc_needs_modeset(crtc_state))
204+
return true;
205+
}
206+
207+
return false;
208+
}
209+
190210
struct intel_digital_connector_state *
191211
intel_atomic_get_digital_connector_state(struct intel_atomic_state *state,
192212
struct intel_connector *connector)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct drm_connector_state *
3535
intel_digital_connector_duplicate_state(struct drm_connector *connector);
3636
bool intel_connector_needs_modeset(struct intel_atomic_state *state,
3737
struct drm_connector *connector);
38+
bool intel_any_crtc_needs_modeset(struct intel_atomic_state *state);
3839
struct intel_digital_connector_state *
3940
intel_atomic_get_digital_connector_state(struct intel_atomic_state *state,
4041
struct intel_connector *connector);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel
162162
{
163163
struct intel_qgv_info qi = {};
164164
bool is_y_tile = true; /* assume y tile may be used */
165-
int num_channels = dev_priv->dram_info.num_channels;
165+
int num_channels = max_t(u8, 1, dev_priv->dram_info.num_channels);
166166
int deinterleave;
167167
int ipqdepth, ipqdepthpch;
168168
int dclk_max;
@@ -267,7 +267,7 @@ void intel_bw_init_hw(struct drm_i915_private *dev_priv)
267267
if (!HAS_DISPLAY(dev_priv))
268268
return;
269269

270-
if (IS_ALDERLAKE_S(dev_priv))
270+
if (IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv))
271271
icl_get_bw_info(dev_priv, &adls_sa_info);
272272
else if (IS_ROCKETLAKE(dev_priv))
273273
icl_get_bw_info(dev_priv, &rkl_sa_info);

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

Lines changed: 76 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "intel_cdclk.h"
2929
#include "intel_de.h"
3030
#include "intel_display_types.h"
31+
#include "intel_psr.h"
3132
#include "intel_sideband.h"
3233

3334
/**
@@ -1547,6 +1548,35 @@ static void cnl_cdclk_pll_enable(struct drm_i915_private *dev_priv, int vco)
15471548
dev_priv->cdclk.hw.vco = vco;
15481549
}
15491550

1551+
static bool has_cdclk_crawl(struct drm_i915_private *i915)
1552+
{
1553+
return INTEL_INFO(i915)->has_cdclk_crawl;
1554+
}
1555+
1556+
static void adlp_cdclk_pll_crawl(struct drm_i915_private *dev_priv, int vco)
1557+
{
1558+
int ratio = DIV_ROUND_CLOSEST(vco, dev_priv->cdclk.hw.ref);
1559+
u32 val;
1560+
1561+
/* Write PLL ratio without disabling */
1562+
val = CNL_CDCLK_PLL_RATIO(ratio) | BXT_DE_PLL_PLL_ENABLE;
1563+
intel_de_write(dev_priv, BXT_DE_PLL_ENABLE, val);
1564+
1565+
/* Submit freq change request */
1566+
val |= BXT_DE_PLL_FREQ_REQ;
1567+
intel_de_write(dev_priv, BXT_DE_PLL_ENABLE, val);
1568+
1569+
/* Timeout 200us */
1570+
if (intel_de_wait_for_set(dev_priv, BXT_DE_PLL_ENABLE,
1571+
BXT_DE_PLL_LOCK | BXT_DE_PLL_FREQ_REQ_ACK, 1))
1572+
DRM_ERROR("timeout waiting for FREQ change request ack\n");
1573+
1574+
val &= ~BXT_DE_PLL_FREQ_REQ;
1575+
intel_de_write(dev_priv, BXT_DE_PLL_ENABLE, val);
1576+
1577+
dev_priv->cdclk.hw.vco = vco;
1578+
}
1579+
15501580
static u32 bxt_cdclk_cd2x_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
15511581
{
15521582
if (DISPLAY_VER(dev_priv) >= 12) {
@@ -1619,14 +1649,16 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
16191649
return;
16201650
}
16211651

1622-
if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) {
1652+
if (has_cdclk_crawl(dev_priv) && dev_priv->cdclk.hw.vco > 0 && vco > 0) {
1653+
if (dev_priv->cdclk.hw.vco != vco)
1654+
adlp_cdclk_pll_crawl(dev_priv, vco);
1655+
} else if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) {
16231656
if (dev_priv->cdclk.hw.vco != 0 &&
16241657
dev_priv->cdclk.hw.vco != vco)
16251658
cnl_cdclk_pll_disable(dev_priv);
16261659

16271660
if (dev_priv->cdclk.hw.vco != vco)
16281661
cnl_cdclk_pll_enable(dev_priv, vco);
1629-
16301662
} else {
16311663
if (dev_priv->cdclk.hw.vco != 0 &&
16321664
dev_priv->cdclk.hw.vco != vco)
@@ -1819,6 +1851,28 @@ void intel_cdclk_uninit_hw(struct drm_i915_private *i915)
18191851
skl_cdclk_uninit_hw(i915);
18201852
}
18211853

1854+
static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
1855+
const struct intel_cdclk_config *a,
1856+
const struct intel_cdclk_config *b)
1857+
{
1858+
int a_div, b_div;
1859+
1860+
if (!has_cdclk_crawl(dev_priv))
1861+
return false;
1862+
1863+
/*
1864+
* The vco and cd2x divider will change independently
1865+
* from each, so we disallow cd2x change when crawling.
1866+
*/
1867+
a_div = DIV_ROUND_CLOSEST(a->vco, a->cdclk);
1868+
b_div = DIV_ROUND_CLOSEST(b->vco, b->cdclk);
1869+
1870+
return a->vco != 0 && b->vco != 0 &&
1871+
a->vco != b->vco &&
1872+
a_div == b_div &&
1873+
a->ref == b->ref;
1874+
}
1875+
18221876
/**
18231877
* intel_cdclk_needs_modeset - Determine if changong between the CDCLK
18241878
* configurations requires a modeset on all pipes
@@ -1908,6 +1962,12 @@ static void intel_set_cdclk(struct drm_i915_private *dev_priv,
19081962

19091963
intel_dump_cdclk_config(cdclk_config, "Changing CDCLK to");
19101964

1965+
for_each_intel_encoder_with_psr(&dev_priv->drm, encoder) {
1966+
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
1967+
1968+
intel_psr_pause(intel_dp);
1969+
}
1970+
19111971
/*
19121972
* Lock aux/gmbus while we change cdclk in case those
19131973
* functions use cdclk. Not all platforms/ports do,
@@ -1930,6 +1990,12 @@ static void intel_set_cdclk(struct drm_i915_private *dev_priv,
19301990
}
19311991
mutex_unlock(&dev_priv->gmbus_mutex);
19321992

1993+
for_each_intel_encoder_with_psr(&dev_priv->drm, encoder) {
1994+
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
1995+
1996+
intel_psr_resume(intel_dp);
1997+
}
1998+
19331999
if (drm_WARN(&dev_priv->drm,
19342000
intel_cdclk_changed(&dev_priv->cdclk.hw, cdclk_config),
19352001
"cdclk state doesn't match!\n")) {
@@ -2462,7 +2528,7 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
24622528
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
24632529
const struct intel_cdclk_state *old_cdclk_state;
24642530
struct intel_cdclk_state *new_cdclk_state;
2465-
enum pipe pipe;
2531+
enum pipe pipe = INVALID_PIPE;
24662532
int ret;
24672533

24682534
new_cdclk_state = intel_atomic_get_cdclk_state(state);
@@ -2514,15 +2580,18 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
25142580

25152581
if (drm_atomic_crtc_needs_modeset(&crtc_state->uapi))
25162582
pipe = INVALID_PIPE;
2517-
} else {
2518-
pipe = INVALID_PIPE;
25192583
}
25202584

2521-
if (pipe != INVALID_PIPE) {
2585+
if (intel_cdclk_can_crawl(dev_priv,
2586+
&old_cdclk_state->actual,
2587+
&new_cdclk_state->actual)) {
2588+
drm_dbg_kms(&dev_priv->drm,
2589+
"Can change cdclk via crawl\n");
2590+
} else if (pipe != INVALID_PIPE) {
25222591
new_cdclk_state->pipe = pipe;
25232592

25242593
drm_dbg_kms(&dev_priv->drm,
2525-
"Can change cdclk with pipe %c active\n",
2594+
"Can change cdclk cd2x divider with pipe %c active\n",
25262595
pipe_name(pipe));
25272596
} else if (intel_cdclk_needs_modeset(&old_cdclk_state->actual,
25282597
&new_cdclk_state->actual)) {
@@ -2531,8 +2600,6 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
25312600
if (ret)
25322601
return ret;
25332602

2534-
new_cdclk_state->pipe = INVALID_PIPE;
2535-
25362603
drm_dbg_kms(&dev_priv->drm,
25372604
"Modeset required for cdclk change\n");
25382605
}

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

Lines changed: 0 additions & 21 deletions
This file was deleted.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ static u32 i9xx_cursor_ctl(const struct intel_crtc_state *crtc_state,
383383
if (plane_state->hw.rotation & DRM_MODE_ROTATE_180)
384384
cntl |= MCURSOR_ROTATE_180;
385385

386+
/* Wa_22012358565:adlp */
387+
if (DISPLAY_VER(dev_priv) == 13)
388+
cntl |= MCURSOR_ARB_SLOTS(1);
389+
386390
return cntl;
387391
}
388392

0 commit comments

Comments
 (0)