feat/hints a471fa4

reacquire.go RawHistoryFolder

1package drm
2
3import "time"
4
5// masterRetry retries an enable modeset that the kernel refused because
6// DRM master was not back yet. The seat can report the session active
7// before the kernel hands master back; without a retry the output stays
8// dark until the next VT switch.
9//
10// The retry has a fixed deadline: the output loop wakes for many other
11// events (pings, cursor, reports) and must not push it back on each one.
12type masterRetry struct {
13	pending  bool
14	due      time.Time
15	attempts int
16}
17
18const (
19	masterRetryFirst = 20 * time.Millisecond
20	masterRetryMax   = time.Second
21	// masterRetryLimit bounds the retries of one enable (about 35 s).
22	masterRetryLimit = 40
23)
24
25// refused records an enable refused with err at now; only a lost master
26// is retried, and enabled stays false until a retry succeeds. It reports
27// that the retries are exhausted.
28func (m *masterRetry) refused(err error, enabled bool, now time.Time) (gaveUp bool) {
29	if !lostMaster(err) || enabled {
30		return false
31	}
32	if m.attempts >= masterRetryLimit {
33		m.pending = false
34		return true
35	}
36	m.pending = true
37	m.due = now.Add(min(masterRetryFirst<<min(m.attempts, 6), masterRetryMax))
38	return false
39}
40
41// fire starts an attempt: the retry is pending again only if it is refused.
42func (m *masterRetry) fire() {
43	m.pending = false
44	m.attempts++
45}
46
47// done ends the retry: the enable succeeded or the seat changed.
48func (m *masterRetry) done() { *m = masterRetry{} }
49
50// next is the time left before the next attempt, if one is due.
51func (m *masterRetry) next(now time.Time) (time.Duration, bool) {
52	if !m.pending {
53		return 0, false
54	}
55	return max(0, m.due.Sub(now)), true
56}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 26

Tags 10

↑↓ moveenter openesc close