Skip to content

Commit 9001b17

Browse files
committed
Merge tag 'drm-intel-next-2020-03-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
UAPI Changes: On i915 we have a new UAPI to allow userspace to specify CS ring buffer size on construction (I915_CONTEXT_PARAM_RINGSIZE) and also new sysfs entries exposing various engine properties GVT Changes: VFIO edid getting expanded to all platforms and a big cleanup around attr group, unused vblank complete, kvmgt, Intel engine and dev_priv usages. i915 Changes: - new UAPI to allow userspace to specify CS ring buffer size on construction (I915_CONTEXT_PARAM_RINGSIZE) - (Chris) - New sysfs entries exposing various engine properties (Chris) - Tiger Lake is out of require_force_probe protection (Jose) - Changes in many places around active requests, reset and heartbeat (Chris) - Stop assigning drm-dev_private pointer (Jani) - Many code refactor in many places, including intel_modeset_init, increasing use of intel_uncore_*, vgpu, and gvt stuff (Jani) - Fixes around display pipe iterators (Anshuman) - Tigerlake enabling work (Matt Ropper, Matt Atwood, Ville, Lucas, Daniele, Jose, Anusha, Vivek, Swathi, Caz. Kai) - Code clean-up like reducing use of drm/i915_drv.h, removing unused registers, removing garbage warns, and some other code polishing (Jani, Lucas, Ville) - Selftests fixes, improvements and additions (Chris, Dan, Aditya, Matt Auld) - Fix plane possible_crtcs bit mask (Anshuman) - Fixes and cleanup on GLK pre production identification and w/a (Ville) - Fix display orientation on few cases (Hans, Ville) - dbuf clean-up and improvements for slice arrays handling (Ville) - Improvement around min cdclk calculation (Stanislav) - Fixes and refactor around display PLLs (Imre) - Other execlists and perf fixes (Chris) - Documentation fixes (Jani, Chris) - Fix build issue (Anshuman) - Many more fixes around the locking mechanisms (Chris) - Other fixes and debugability info around preemption (Chris, Tvrtko) - Add mechanism to submit a context WA on ring submission (Mika) - Clear all Eu/L3 resitual context (Prathap) - More changes around local memory (Abdiel, Matt, Chris) - Fix RPS (Chris) - DP MST fix (Lyude) - Display FBC fixes (Jose, RK) - debugfs cleanup (Tvrtko) - More convertion towards drm_debive based loggin (Wambui, Ram) - Avoid potential buffer overflow (Takashi) - Ice Lake and Elkhart Lake workarounds (Matt Roper) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents bda1fb0 + 217a485 commit 9001b17

File tree

172 files changed

+6992
-4132
lines changed

Some content is hidden

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

172 files changed

+6992
-4132
lines changed

Documentation/gpu/i915.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ DPIO
207207
CSR firmware support for DMC
208208
----------------------------
209209

210-
.. kernel-doc:: drivers/gpu/drm/i915/intel_csr.c
210+
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_csr.c
211211
:doc: csr support for dmc
212212

213-
.. kernel-doc:: drivers/gpu/drm/i915/intel_csr.c
213+
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_csr.c
214214
:internal:
215215

216216
Video BIOS Table (VBT)
@@ -332,7 +332,7 @@ This process is dubbed relocation.
332332
GEM BO Management Implementation Details
333333
----------------------------------------
334334

335-
.. kernel-doc:: drivers/gpu/drm/i915/i915_vma.h
335+
.. kernel-doc:: drivers/gpu/drm/i915/i915_vma_types.h
336336
:doc: Virtual Memory Address
337337

338338
Buffer Object Eviction
@@ -382,7 +382,7 @@ Logical Rings, Logical Ring Contexts and Execlists
382382
Global GTT views
383383
----------------
384384

385-
.. kernel-doc:: drivers/gpu/drm/i915/i915_gem_gtt.c
385+
.. kernel-doc:: drivers/gpu/drm/i915/i915_vma_types.h
386386
:doc: Global GTT views
387387

388388
.. kernel-doc:: drivers/gpu/drm/i915/i915_gem_gtt.c

drivers/gpu/drm/drm_dp_helper.c

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,85 @@ drm_dp_get_quirks(const struct drm_dp_dpcd_ident *ident, bool is_branch)
12801280
#undef DEVICE_ID_ANY
12811281
#undef DEVICE_ID
12821282

1283+
struct edid_quirk {
1284+
u8 mfg_id[2];
1285+
u8 prod_id[2];
1286+
u32 quirks;
1287+
};
1288+
1289+
#define MFG(first, second) { (first), (second) }
1290+
#define PROD_ID(first, second) { (first), (second) }
1291+
1292+
/*
1293+
* Some devices have unreliable OUIDs where they don't set the device ID
1294+
* correctly, and as a result we need to use the EDID for finding additional
1295+
* DP quirks in such cases.
1296+
*/
1297+
static const struct edid_quirk edid_quirk_list[] = {
1298+
/* Optional 4K AMOLED panel in the ThinkPad X1 Extreme 2nd Generation
1299+
* only supports DPCD backlight controls
1300+
*/
1301+
{ MFG(0x4c, 0x83), PROD_ID(0x41, 0x41), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
1302+
/*
1303+
* Some Dell CML 2020 systems have panels support both AUX and PWM
1304+
* backlight control, and some only support AUX backlight control. All
1305+
* said panels start up in AUX mode by default, and we don't have any
1306+
* support for disabling HDR mode on these panels which would be
1307+
* required to switch to PWM backlight control mode (plus, I'm not
1308+
* even sure we want PWM backlight controls over DPCD backlight
1309+
* controls anyway...). Until we have a better way of detecting these,
1310+
* force DPCD backlight mode on all of them.
1311+
*/
1312+
{ MFG(0x06, 0xaf), PROD_ID(0x9b, 0x32), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
1313+
{ MFG(0x06, 0xaf), PROD_ID(0xeb, 0x41), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
1314+
{ MFG(0x4d, 0x10), PROD_ID(0xc7, 0x14), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
1315+
{ MFG(0x4d, 0x10), PROD_ID(0xe6, 0x14), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
1316+
};
1317+
1318+
#undef MFG
1319+
#undef PROD_ID
1320+
1321+
/**
1322+
* drm_dp_get_edid_quirks() - Check the EDID of a DP device to find additional
1323+
* DP-specific quirks
1324+
* @edid: The EDID to check
1325+
*
1326+
* While OUIDs are meant to be used to recognize a DisplayPort device, a lot
1327+
* of manufacturers don't seem to like following standards and neglect to fill
1328+
* the dev-ID in, making it impossible to only use OUIDs for determining
1329+
* quirks in some cases. This function can be used to check the EDID and look
1330+
* up any additional DP quirks. The bits returned by this function correspond
1331+
* to the quirk bits in &drm_dp_quirk.
1332+
*
1333+
* Returns: a bitmask of quirks, if any. The driver can check this using
1334+
* drm_dp_has_quirk().
1335+
*/
1336+
u32 drm_dp_get_edid_quirks(const struct edid *edid)
1337+
{
1338+
const struct edid_quirk *quirk;
1339+
u32 quirks = 0;
1340+
int i;
1341+
1342+
if (!edid)
1343+
return 0;
1344+
1345+
for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) {
1346+
quirk = &edid_quirk_list[i];
1347+
if (memcmp(quirk->mfg_id, edid->mfg_id,
1348+
sizeof(edid->mfg_id)) == 0 &&
1349+
memcmp(quirk->prod_id, edid->prod_code,
1350+
sizeof(edid->prod_code)) == 0)
1351+
quirks |= quirk->quirks;
1352+
}
1353+
1354+
DRM_DEBUG_KMS("DP sink: EDID mfg %*phD prod-ID %*phD quirks: 0x%04x\n",
1355+
(int)sizeof(edid->mfg_id), edid->mfg_id,
1356+
(int)sizeof(edid->prod_code), edid->prod_code, quirks);
1357+
1358+
return quirks;
1359+
}
1360+
EXPORT_SYMBOL(drm_dp_get_edid_quirks);
1361+
12831362
/**
12841363
* drm_dp_read_desc - read sink/branch descriptor from DPCD
12851364
* @aux: DisplayPort AUX channel

drivers/gpu/drm/drm_dp_mst_topology.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5472,7 +5472,8 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port)
54725472
if (drm_dp_read_desc(port->mgr->aux, &desc, true))
54735473
return NULL;
54745474

5475-
if (drm_dp_has_quirk(&desc, DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) &&
5475+
if (drm_dp_has_quirk(&desc, 0,
5476+
DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) &&
54765477
port->mgr->dpcd[DP_DPCD_REV] >= DP_DPCD_REV_14 &&
54775478
port->parent == port->mgr->mst_primary) {
54785479
u8 downstreamport;

drivers/gpu/drm/i915/Kconfig.profile

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ config DRM_I915_HEARTBEAT_INTERVAL
2020
check the health of the GPU and undertake regular house-keeping of
2121
internal driver state.
2222

23+
This is adjustable via
24+
/sys/class/drm/card?/engine/*/heartbeat_interval_ms
25+
2326
May be 0 to disable heartbeats and therefore disable automatic GPU
2427
hang detection.
2528

@@ -33,18 +36,28 @@ config DRM_I915_PREEMPT_TIMEOUT
3336
expires, the HW will be reset to allow the more important context
3437
to execute.
3538

39+
This is adjustable via
40+
/sys/class/drm/card?/engine/*/preempt_timeout_ms
41+
3642
May be 0 to disable the timeout.
3743

38-
config DRM_I915_SPIN_REQUEST
39-
int "Busywait for request completion (us)"
40-
default 5 # microseconds
44+
The compiled in default may get overridden at driver probe time on
45+
certain platforms and certain engines which will be reflected in the
46+
sysfs control.
47+
48+
config DRM_I915_MAX_REQUEST_BUSYWAIT
49+
int "Busywait for request completion limit (ns)"
50+
default 8000 # nanoseconds
4151
help
4252
Before sleeping waiting for a request (GPU operation) to complete,
4353
we may spend some time polling for its completion. As the IRQ may
4454
take a non-negligible time to setup, we do a short spin first to
4555
check if the request will complete in the time it would have taken
4656
us to enable the interrupt.
4757

58+
This is adjustable via
59+
/sys/class/drm/card?/engine/*/max_busywait_duration_ns
60+
4861
May be 0 to disable the initial spin. In practice, we estimate
4962
the cost of enabling the interrupt (if currently disabled) to be
5063
a few microseconds.
@@ -60,6 +73,9 @@ config DRM_I915_STOP_TIMEOUT
6073
that the reset itself may take longer and so be more disruptive to
6174
interactive or low latency workloads.
6275

76+
This is adjustable via
77+
/sys/class/drm/card?/engine/*/stop_timeout_ms
78+
6379
config DRM_I915_TIMESLICE_DURATION
6480
int "Scheduling quantum for userspace batches (ms, jiffy granularity)"
6581
default 1 # milliseconds
@@ -73,4 +89,7 @@ config DRM_I915_TIMESLICE_DURATION
7389
is scheduled for execution for the timeslice duration, before
7490
switching to the next context.
7591

92+
This is adjustable via
93+
/sys/class/drm/card?/engine/*/timeslice_duration_ms
94+
7695
May be 0 to disable timeslicing.

drivers/gpu/drm/i915/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ i915-y += i915_drv.o \
4747
i915_sysfs.o \
4848
i915_utils.o \
4949
intel_device_info.o \
50+
intel_dram.o \
5051
intel_memory_region.o \
5152
intel_pch.o \
5253
intel_pm.o \
@@ -79,9 +80,11 @@ gt-y += \
7980
gt/debugfs_gt.o \
8081
gt/debugfs_gt_pm.o \
8182
gt/gen6_ppgtt.o \
83+
gt/gen7_renderclear.o \
8284
gt/gen8_ppgtt.o \
8385
gt/intel_breadcrumbs.o \
8486
gt/intel_context.o \
87+
gt/intel_context_param.o \
8588
gt/intel_context_sseu.o \
8689
gt/intel_engine_cs.o \
8790
gt/intel_engine_heartbeat.o \
@@ -107,7 +110,8 @@ gt-y += \
107110
gt/intel_rps.o \
108111
gt/intel_sseu.o \
109112
gt/intel_timeline.o \
110-
gt/intel_workarounds.o
113+
gt/intel_workarounds.o \
114+
gt/sysfs_engines.o
111115
# autogenerated null render state
112116
gt-y += \
113117
gt/gen6_renderstate.o \

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,13 @@ static void gen11_dsi_gate_clocks(struct intel_encoder *encoder)
599599
u32 tmp;
600600
enum phy phy;
601601

602-
mutex_lock(&dev_priv->dpll_lock);
602+
mutex_lock(&dev_priv->dpll.lock);
603603
tmp = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0);
604604
for_each_dsi_phy(phy, intel_dsi->phys)
605605
tmp |= ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
606606

607607
intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, tmp);
608-
mutex_unlock(&dev_priv->dpll_lock);
608+
mutex_unlock(&dev_priv->dpll.lock);
609609
}
610610

611611
static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder)
@@ -615,13 +615,13 @@ static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder)
615615
u32 tmp;
616616
enum phy phy;
617617

618-
mutex_lock(&dev_priv->dpll_lock);
618+
mutex_lock(&dev_priv->dpll.lock);
619619
tmp = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0);
620620
for_each_dsi_phy(phy, intel_dsi->phys)
621621
tmp &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
622622

623623
intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, tmp);
624-
mutex_unlock(&dev_priv->dpll_lock);
624+
mutex_unlock(&dev_priv->dpll.lock);
625625
}
626626

627627
static void gen11_dsi_map_pll(struct intel_encoder *encoder,
@@ -633,7 +633,7 @@ static void gen11_dsi_map_pll(struct intel_encoder *encoder,
633633
enum phy phy;
634634
u32 val;
635635

636-
mutex_lock(&dev_priv->dpll_lock);
636+
mutex_lock(&dev_priv->dpll.lock);
637637

638638
val = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0);
639639
for_each_dsi_phy(phy, intel_dsi->phys) {
@@ -652,7 +652,7 @@ static void gen11_dsi_map_pll(struct intel_encoder *encoder,
652652

653653
intel_de_posting_read(dev_priv, ICL_DPCLKA_CFGCR0);
654654

655-
mutex_unlock(&dev_priv->dpll_lock);
655+
mutex_unlock(&dev_priv->dpll.lock);
656656
}
657657

658658
static void
@@ -1350,15 +1350,15 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder,
13501350
static void gen11_dsi_get_config(struct intel_encoder *encoder,
13511351
struct intel_crtc_state *pipe_config)
13521352
{
1353-
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1353+
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
13541354
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
13551355
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
13561356

13571357
intel_dsc_get_config(encoder, pipe_config);
13581358

13591359
/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */
1360-
pipe_config->port_clock =
1361-
cnl_calc_wrpll_link(dev_priv, &pipe_config->dpll_hw_state);
1360+
pipe_config->port_clock = intel_dpll_get_freq(i915,
1361+
pipe_config->shared_dpll);
13621362

13631363
pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk;
13641364
if (intel_dsi->dual_link)

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,37 @@ intel_plane_destroy_state(struct drm_plane *plane,
133133
kfree(plane_state);
134134
}
135135

136+
unsigned int intel_plane_pixel_rate(const struct intel_crtc_state *crtc_state,
137+
const struct intel_plane_state *plane_state)
138+
{
139+
unsigned int src_w, src_h, dst_w, dst_h;
140+
unsigned int pixel_rate = crtc_state->pixel_rate;
141+
142+
src_w = drm_rect_width(&plane_state->uapi.src) >> 16;
143+
src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
144+
dst_w = drm_rect_width(&plane_state->uapi.dst);
145+
dst_h = drm_rect_height(&plane_state->uapi.dst);
146+
147+
/* Downscaling limits the maximum pixel rate */
148+
dst_w = min(src_w, dst_w);
149+
dst_h = min(src_h, dst_h);
150+
151+
return DIV_ROUND_UP_ULL(mul_u32_u32(pixel_rate, src_w * src_h),
152+
dst_w * dst_h);
153+
}
154+
136155
unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
137156
const struct intel_plane_state *plane_state)
138157
{
139158
const struct drm_framebuffer *fb = plane_state->hw.fb;
140159
unsigned int cpp;
160+
unsigned int pixel_rate;
141161

142162
if (!plane_state->uapi.visible)
143163
return 0;
144164

165+
pixel_rate = intel_plane_pixel_rate(crtc_state, plane_state);
166+
145167
cpp = fb->format->cpp[0];
146168

147169
/*
@@ -153,7 +175,7 @@ unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
153175
if (fb->format->is_yuv && fb->format->num_planes > 1)
154176
cpp *= 4;
155177

156-
return cpp * crtc_state->pixel_rate;
178+
return pixel_rate * cpp;
157179
}
158180

159181
int intel_plane_calc_min_cdclk(struct intel_atomic_state *state,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ struct intel_plane_state;
1818

1919
extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
2020

21+
unsigned int intel_plane_pixel_rate(const struct intel_crtc_state *crtc_state,
22+
const struct intel_plane_state *plane_state);
23+
2124
unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
2225
const struct intel_plane_state *plane_state);
2326
void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ static const struct {
149149
{ 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },
150150
{ 148352, AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },
151151
{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
152+
{ 296703, AUD_CONFIG_PIXEL_CLOCK_HDMI_296703 },
153+
{ 297000, AUD_CONFIG_PIXEL_CLOCK_HDMI_297000 },
154+
{ 593407, AUD_CONFIG_PIXEL_CLOCK_HDMI_593407 },
155+
{ 594000, AUD_CONFIG_PIXEL_CLOCK_HDMI_594000 },
152156
};
153157

154158
/* HDMI N/CTS table */
@@ -234,6 +238,7 @@ static const struct hdmi_aud_ncts hdmi_aud_ncts_36bpp[] = {
234238
/* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
235239
static u32 audio_config_hdmi_pixel_clock(const struct intel_crtc_state *crtc_state)
236240
{
241+
struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
237242
const struct drm_display_mode *adjusted_mode =
238243
&crtc_state->hw.adjusted_mode;
239244
int i;
@@ -243,6 +248,9 @@ static u32 audio_config_hdmi_pixel_clock(const struct intel_crtc_state *crtc_sta
243248
break;
244249
}
245250

251+
if (INTEL_GEN(dev_priv) < 12 && adjusted_mode->crtc_clock > 148500)
252+
i = ARRAY_SIZE(hdmi_audio_clock);
253+
246254
if (i == ARRAY_SIZE(hdmi_audio_clock)) {
247255
DRM_DEBUG_KMS("HDMI audio pixel clock setting for %d not found, falling back to defaults\n",
248256
adjusted_mode->crtc_clock);
@@ -844,7 +852,7 @@ static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv,
844852
struct intel_crtc *crtc;
845853
int ret;
846854

847-
crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
855+
crtc = intel_get_first_crtc(dev_priv);
848856
if (!crtc)
849857
return;
850858

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
*/
2727

2828
#include <drm/drm_dp_helper.h>
29-
#include <drm/i915_drm.h>
3029

3130
#include "display/intel_display.h"
3231
#include "display/intel_display_types.h"

0 commit comments

Comments
 (0)