Skip to content

Commit 2ef4144

Browse files
committed
Merge tag 'drm-intel-next-2019-11-01-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
UAPI Changes: - Make context persistence optional Allow userspace to tie the context lifetime to FD lifetime, effectively allowing Ctrl-C killing of a process to also clean up the hardware immediately. Compute changes: intel/compute-runtime#228 The compute driver is shipping in Ubuntu. uAPI acked by Mesa folks. - Put future HW and their uAPIs under STAGING & BROKEN Introduces DRM_I915_UNSTABLE Kconfig menu for working on the new uAPI for future HW in upstream. We already disable driver loading by default the platform is deemed ready. This is a second level of protection based on compile time switch (STAGING & BROKEN). - Under DRM_I915_UNSTABLE: Add the fake lmem region on iGFX Fake local memory region on integrated GPU through cmdline: memmap=2G$16G i915.fake_lmem_start=0x400000000 Currently allows testing non-mappable GGTT behavior and running kernel selftest for local memory. Driver Changes: - Fix Bugzilla #112084: VGA external monitor not working (Ville) - Add support for half float framebuffers (Ville) - Add perf support on TGL (Lionel) - Replace hangcheck by heartbeats (Chris) - Allow SPT PCH on all AML devices (James) - Add new CNL PCH for CML platform (Imre) - Allow 100 ms (Kconfig) for workloads to exit before reset (Chris, Jon, Joonas) - Forcibly pre-empt a context after 100 ms (Kconfig) of delay (Chris) - Make timeslice duration Kconfig configurable (Chris) - Whitelist PS_(DEPTH|INVOCATION)_COUNT for Tigerlake (Tapani) - Support creating LMEM objects in kernel (Matt A) - Adjust the location of RING_MI_MODE in the context image for TGL (Chris) - Handle AUX interrupts for TC ports (Matt R) - Add support for devices without mappable GGTT aperture (Daniele) - Rename "inject_load_failure" module parameter to "inject_probe_failure" (Janusz) - Handle fused off HDCP, FBC, DMC and DSC (Jose) - Add support to one DP-MST stream on Tigerlake (Lucas) - Add HuC firmware (and GuC) for TGL (Daniele) - Allow ICL+ DSI on any pipe (Ville) - Check some transcoder timing minimum limits (Ville) - Don't set queue_priority_hint if we don't kick the submission (Chris) - Introduce barrier pulses along engines to flush idle/in-flight requests (Chris) - Drop assertion that ce->pin_mutex guards state updates (Chris) - Cancel banned contexts on schedule-out (Chris) - Cancel contexts when hangchecking is disabled (Chris) - Catch GTT fault errors for gen11+ planes (Matt R) - Print in debugfs if PSR is not enabled because of sink (Jose) - Do not set MOCS control values on dgfx (Lucas) - Setup io-mapping for LMEM (Abdiel) - Support kernel mapping of LMEM objects (Abdiel) - Add LMEM selftests (Matt A) - Initialise PMU spinlock before registering (Chris) - Clear DKL_TX_PMD_LANE_SUS before program TC voltage swing (Jose) - Flip interpretation of ips fmin/fmax to max rps (Chris) - Add VBT compression parameter block definition (Jani) - Limit the blitter sizes to ensure low preemption latency (Chris) - Fixup block_size rounding on BLT (Matt A) - Don't try to place HWS in non-existing mappable region (Michal Wa) - Don't allocate the ring in stolen if we lack aperture (Matt A) - Add AUX B & C to DC_OFF_POWER_DOMAINS for Tigerlake (Matt R) - Avoid HPD poll detect triggering a new detect cycle (Imre) - Document the userspace fail with possible_crtcs (Ville) - Drop lrc header page now unused by GuC (Daniele) - Do not switch aux to TBT mode for non-TC ports (Jose) - Restructure code to avoid depending on i915 but smaller structs (Chris, Tvrtko, Andi) - Remove pm park/unpark notifications (Chris) - Avoid lockdep cross-contamination between object types (Chris) - Restructure DSC code (Jani) - Fix dead locking in early workload shadow (Zhenyu) - Split the legacy submission backend from the common CS ring buffer (Chris) - Move intel_engine_context_in/out into intel_lrc.c (Tvrtko) - Describe perf/wakeref structure members in documentation (Anna) - Update renamed header files names in documentation (Anna) - Add debugs to distingiush a cd2x update from a full cdclk pll update (Ville) - Rework atomic global state locking (Ville) - Allow planes to declare their minimum acceptable cdclk (Ville) - Eliminate skl_check_pipe_max_pixel_rate() and simplify skl_max_scale() (Ville) - Making loglevel of PSR2/SU logs same (Ap) - Capture aux page table error register (Lionel) - Add is_dgfx to device info (Jose) - Split gen11_irq_handler to make it shareable (Lucas) - Encapsulate kconfig constant values inside boolean predicates (Chris) - Split memory_region initialisation into its own file (Chris) - Use _PICK() for CHICKEN_TRANS() and add CHICKEN_TRANS_D (Ville) - Add perf helper macros for comparing with whitelisted registers (Umesh) - Fix i915_inject_load_error() name to read *_probe_* (Janusz) - Drop unused AUX register offsets (Matt R) - Provide more information on DP AUX failures (Matt R) - Add GAM/SFC instdone to error state (Mika) - Always track callers to intel_rps_mark_interactive() (Chris) - Nuke 'mode' argument to intel_get_load_detect_pipe() (Ville) - Simplify LVDS crtc_mask and pipe_mask setup (Ville) - Stop frobbing crtc->base.mode (Ville) - Do s/crtc_mask/pipe_mask/ (Ville) - Split detaching and removing the vma (Chris) - Selftest improvements (Chris, Tvrtko, Mika, Matt A, Lionel) - GuC code improvements (Rob, Andi, Daniele) - Check against i915_selftest only under CONFIG_SELFTEST (Chris) - Refine occupancy test in kill_context() (Chris) - Start kthreads before stopping (Chris) Signed-off-by: Dave Airlie <[email protected]> From: Joonas Lahtinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 904ce19 + 1883e29 commit 2ef4144

File tree

172 files changed

+8936
-5163
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

+8936
-5163
lines changed

Documentation/gpu/i915.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,9 @@ i915 Perf Stream
550550
This section covers the stream-semantics-agnostic structures and functions
551551
for representing an i915 perf stream FD and associated file operations.
552552

553-
.. kernel-doc:: drivers/gpu/drm/i915/i915_drv.h
553+
.. kernel-doc:: drivers/gpu/drm/i915/i915_perf_types.h
554554
:functions: i915_perf_stream
555-
.. kernel-doc:: drivers/gpu/drm/i915/i915_drv.h
555+
.. kernel-doc:: drivers/gpu/drm/i915/i915_perf_types.h
556556
:functions: i915_perf_stream_ops
557557

558558
.. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
@@ -577,7 +577,7 @@ for representing an i915 perf stream FD and associated file operations.
577577
i915 Perf Observation Architecture Stream
578578
-----------------------------------------
579579

580-
.. kernel-doc:: drivers/gpu/drm/i915/i915_drv.h
580+
.. kernel-doc:: drivers/gpu/drm/i915/i915_perf_types.h
581581
:functions: i915_oa_ops
582582

583583
.. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c

drivers/gpu/drm/i915/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,9 @@ menu "drm/i915 Profile Guided Optimisation"
148148
depends on DRM_I915
149149
source "drivers/gpu/drm/i915/Kconfig.profile"
150150
endmenu
151+
152+
menu "drm/i915 Unstable Evolution"
153+
visible if EXPERT && STAGING && BROKEN
154+
depends on DRM_I915
155+
source "drivers/gpu/drm/i915/Kconfig.unstable"
156+
endmenu

drivers/gpu/drm/i915/Kconfig.debug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ config DRM_I915_DEBUG
3636
select DRM_I915_SELFTEST
3737
select DRM_I915_DEBUG_RUNTIME_PM
3838
select DRM_I915_DEBUG_MMIO
39+
select BROKEN # for prototype uAPI
3940
default n
4041
help
4142
Choose this option to turn on extra driver debugging that may affect

drivers/gpu/drm/i915/Kconfig.profile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@ config DRM_I915_USERFAULT_AUTOSUSPEND
1212
May be 0 to disable the extra delay and solely use the device level
1313
runtime pm autosuspend delay tunable.
1414

15+
config DRM_I915_HEARTBEAT_INTERVAL
16+
int "Interval between heartbeat pulses (ms)"
17+
default 2500 # milliseconds
18+
help
19+
The driver sends a periodic heartbeat down all active engines to
20+
check the health of the GPU and undertake regular house-keeping of
21+
internal driver state.
22+
23+
May be 0 to disable heartbeats and therefore disable automatic GPU
24+
hang detection.
25+
26+
config DRM_I915_PREEMPT_TIMEOUT
27+
int "Preempt timeout (ms, jiffy granularity)"
28+
default 100 # milliseconds
29+
help
30+
How long to wait (in milliseconds) for a preemption event to occur
31+
when submitting a new context via execlists. If the current context
32+
does not hit an arbitration point and yield to HW before the timer
33+
expires, the HW will be reset to allow the more important context
34+
to execute.
35+
36+
May be 0 to disable the timeout.
37+
1538
config DRM_I915_SPIN_REQUEST
1639
int "Busywait for request completion (us)"
1740
default 5 # microseconds
@@ -25,3 +48,29 @@ config DRM_I915_SPIN_REQUEST
2548
May be 0 to disable the initial spin. In practice, we estimate
2649
the cost of enabling the interrupt (if currently disabled) to be
2750
a few microseconds.
51+
52+
config DRM_I915_STOP_TIMEOUT
53+
int "How long to wait for an engine to quiesce gracefully before reset (ms)"
54+
default 100 # milliseconds
55+
help
56+
By stopping submission and sleeping for a short time before resetting
57+
the GPU, we allow the innocent contexts also on the system to quiesce.
58+
It is then less likely for a hanging context to cause collateral
59+
damage as the system is reset in order to recover. The corollary is
60+
that the reset itself may take longer and so be more disruptive to
61+
interactive or low latency workloads.
62+
63+
config DRM_I915_TIMESLICE_DURATION
64+
int "Scheduling quantum for userspace batches (ms, jiffy granularity)"
65+
default 1 # milliseconds
66+
help
67+
When two user batches of equal priority are executing, we will
68+
alternate execution of each batch to ensure forward progress of
69+
all users. This is necessary in some cases where there may be
70+
an implicit dependency between those batches that requires
71+
concurrent execution in order for them to proceed, e.g. they
72+
interact with each other via userspace semaphores. Each context
73+
is scheduled for execution for the timeslice duration, before
74+
switching to the next context.
75+
76+
May be 0 to disable timeslicing.

drivers/gpu/drm/i915/Kconfig.unstable

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
config DRM_I915_UNSTABLE
3+
bool "Enable unstable API for early prototype development"
4+
depends on EXPERT
5+
depends on STAGING
6+
depends on BROKEN # should never be enabled by distros!
7+
# We use the dependency on !COMPILE_TEST to not be enabled in
8+
# allmodconfig or allyesconfig configurations
9+
depends on !COMPILE_TEST
10+
default n
11+
help
12+
Enable prototype uAPI under general discussion before they are
13+
finalized. Such prototypes may be withdrawn or substantially
14+
changed before release. They are only enabled here so that a wide
15+
number of interested parties (userspace driver developers) can
16+
verify that the uAPI meet their expectations. These uAPI should
17+
never be used in production.
18+
19+
Recommended for driver developers _only_.
20+
21+
If in the slightest bit of doubt, say "N".
22+
23+
config DRM_I915_UNSTABLE_FAKE_LMEM
24+
bool "Enable the experimental fake lmem"
25+
depends on DRM_I915_UNSTABLE
26+
default n
27+
help
28+
Convert some system memory into a fake local memory region for
29+
testing.

drivers/gpu/drm/i915/Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,24 @@ gt-y += \
7878
gt/intel_breadcrumbs.o \
7979
gt/intel_context.o \
8080
gt/intel_engine_cs.o \
81-
gt/intel_engine_pool.o \
81+
gt/intel_engine_heartbeat.o \
8282
gt/intel_engine_pm.o \
83+
gt/intel_engine_pool.o \
8384
gt/intel_engine_user.o \
8485
gt/intel_gt.o \
8586
gt/intel_gt_irq.o \
8687
gt/intel_gt_pm.o \
8788
gt/intel_gt_pm_irq.o \
8889
gt/intel_gt_requests.o \
89-
gt/intel_hangcheck.o \
9090
gt/intel_llc.o \
9191
gt/intel_lrc.o \
92+
gt/intel_mocs.o \
9293
gt/intel_rc6.o \
9394
gt/intel_renderstate.o \
9495
gt/intel_reset.o \
95-
gt/intel_ringbuffer.o \
96-
gt/intel_mocs.o \
96+
gt/intel_ring.o \
97+
gt/intel_ring_submission.o \
98+
gt/intel_rps.o \
9799
gt/intel_sseu.o \
98100
gt/intel_timeline.o \
99101
gt/intel_workarounds.o
@@ -119,6 +121,7 @@ gem-y += \
119121
gem/i915_gem_internal.o \
120122
gem/i915_gem_object.o \
121123
gem/i915_gem_object_blt.o \
124+
gem/i915_gem_lmem.o \
122125
gem/i915_gem_mman.o \
123126
gem/i915_gem_pages.o \
124127
gem/i915_gem_phys.o \
@@ -147,6 +150,7 @@ i915-y += \
147150
i915_scheduler.o \
148151
i915_trace_points.o \
149152
i915_vma.o \
153+
intel_region_lmem.o \
150154
intel_wopcm.o
151155

152156
# general-purpose microcontroller (GuC) support
@@ -243,7 +247,8 @@ i915-y += \
243247
oa/i915_oa_cflgt2.o \
244248
oa/i915_oa_cflgt3.o \
245249
oa/i915_oa_cnl.o \
246-
oa/i915_oa_icl.o
250+
oa/i915_oa_icl.o \
251+
oa/i915_oa_tgl.o
247252
i915-y += i915_perf.o
248253

249254
# Post-mortem debug and GPU hang state capture

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
15841584
encoder->get_hw_state = gen11_dsi_get_hw_state;
15851585
encoder->type = INTEL_OUTPUT_DSI;
15861586
encoder->cloneable = 0;
1587-
encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
1587+
encoder->pipe_mask = ~0;
15881588
encoder->power_domain = POWER_DOMAIN_PORT_DSI;
15891589
encoder->get_power_domains = gen11_dsi_get_power_domains;
15901590

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,13 @@ void intel_atomic_state_clear(struct drm_atomic_state *s)
429429
struct intel_atomic_state *state = to_intel_atomic_state(s);
430430
drm_atomic_state_default_clear(&state->base);
431431
state->dpll_set = state->modeset = false;
432+
state->global_state_changed = false;
433+
state->active_pipes = 0;
434+
memset(&state->min_cdclk, 0, sizeof(state->min_cdclk));
435+
memset(&state->min_voltage_level, 0, sizeof(state->min_voltage_level));
436+
memset(&state->cdclk.logical, 0, sizeof(state->cdclk.logical));
437+
memset(&state->cdclk.actual, 0, sizeof(state->cdclk.actual));
438+
state->cdclk.pipe = INVALID_PIPE;
432439
}
433440

434441
struct intel_crtc_state *
@@ -442,3 +449,40 @@ intel_atomic_get_crtc_state(struct drm_atomic_state *state,
442449

443450
return to_intel_crtc_state(crtc_state);
444451
}
452+
453+
int intel_atomic_lock_global_state(struct intel_atomic_state *state)
454+
{
455+
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
456+
struct intel_crtc *crtc;
457+
458+
state->global_state_changed = true;
459+
460+
for_each_intel_crtc(&dev_priv->drm, crtc) {
461+
int ret;
462+
463+
ret = drm_modeset_lock(&crtc->base.mutex,
464+
state->base.acquire_ctx);
465+
if (ret)
466+
return ret;
467+
}
468+
469+
return 0;
470+
}
471+
472+
int intel_atomic_serialize_global_state(struct intel_atomic_state *state)
473+
{
474+
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
475+
struct intel_crtc *crtc;
476+
477+
state->global_state_changed = true;
478+
479+
for_each_intel_crtc(&dev_priv->drm, crtc) {
480+
struct intel_crtc_state *crtc_state;
481+
482+
crtc_state = intel_atomic_get_crtc_state(&state->base, crtc);
483+
if (IS_ERR(crtc_state))
484+
return PTR_ERR(crtc_state);
485+
}
486+
487+
return 0;
488+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct drm_crtc_state;
1616
struct drm_device;
1717
struct drm_i915_private;
1818
struct drm_property;
19+
struct intel_atomic_state;
1920
struct intel_crtc;
2021
struct intel_crtc_state;
2122

@@ -46,4 +47,8 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
4647
struct intel_crtc *intel_crtc,
4748
struct intel_crtc_state *crtc_state);
4849

50+
int intel_atomic_lock_global_state(struct intel_atomic_state *state);
51+
52+
int intel_atomic_serialize_global_state(struct intel_atomic_state *state);
53+
4954
#endif /* __INTEL_ATOMIC_H__ */

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,44 @@ unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
138138
return cpp * crtc_state->pixel_rate;
139139
}
140140

141+
bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
142+
struct intel_plane *plane)
143+
{
144+
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
145+
const struct intel_plane_state *plane_state =
146+
intel_atomic_get_new_plane_state(state, plane);
147+
struct intel_crtc *crtc = to_intel_crtc(plane_state->base.crtc);
148+
struct intel_crtc_state *crtc_state;
149+
150+
if (!plane_state->base.visible || !plane->min_cdclk)
151+
return false;
152+
153+
crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
154+
155+
crtc_state->min_cdclk[plane->id] =
156+
plane->min_cdclk(crtc_state, plane_state);
157+
158+
/*
159+
* Does the cdclk need to be bumbed up?
160+
*
161+
* Note: we obviously need to be called before the new
162+
* cdclk frequency is calculated so state->cdclk.logical
163+
* hasn't been populated yet. Hence we look at the old
164+
* cdclk state under dev_priv->cdclk.logical. This is
165+
* safe as long we hold at least one crtc mutex (which
166+
* must be true since we have crtc_state).
167+
*/
168+
if (crtc_state->min_cdclk[plane->id] > dev_priv->cdclk.logical.cdclk) {
169+
DRM_DEBUG_KMS("[PLANE:%d:%s] min_cdclk (%d kHz) > logical cdclk (%d kHz)\n",
170+
plane->base.base.id, plane->base.name,
171+
crtc_state->min_cdclk[plane->id],
172+
dev_priv->cdclk.logical.cdclk);
173+
return true;
174+
}
175+
176+
return false;
177+
}
178+
141179
int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
142180
struct intel_crtc_state *new_crtc_state,
143181
const struct intel_plane_state *old_plane_state,
@@ -151,6 +189,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
151189
new_crtc_state->nv12_planes &= ~BIT(plane->id);
152190
new_crtc_state->c8_planes &= ~BIT(plane->id);
153191
new_crtc_state->data_rate[plane->id] = 0;
192+
new_crtc_state->min_cdclk[plane->id] = 0;
154193
new_plane_state->base.visible = false;
155194

156195
if (!new_plane_state->base.crtc && !old_plane_state->base.crtc)

0 commit comments

Comments
 (0)