Skip to content

Commit e78b1b5

Browse files
author
Ben Skeggs
committed
drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences
Should fix some initial modeset failures on (at least) Ampere boards. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
1 parent 6eaa1f3 commit e78b1b5

3 files changed

Lines changed: 37 additions & 4 deletions

File tree

‎drivers/gpu/drm/nouveau/dispnv50/disp.c‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,6 +2237,33 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
22372237
interlock[NV50_DISP_INTERLOCK_CORE] = 0;
22382238
}
22392239

2240+
/* Finish updating head(s)...
2241+
*
2242+
* NVD is rather picky about both where window assignments can change,
2243+
* *and* about certain core and window channel states matching.
2244+
*
2245+
* The EFI GOP driver on newer GPUs configures window channels with a
2246+
* different output format to what we do, and the core channel update
2247+
* in the assign_windows case above would result in a state mismatch.
2248+
*
2249+
* Delay some of the head update until after that point to workaround
2250+
* the issue. This only affects the initial modeset.
2251+
*
2252+
* TODO: handle this better when adding flexible window mapping
2253+
*/
2254+
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
2255+
struct nv50_head_atom *asyh = nv50_head_atom(new_crtc_state);
2256+
struct nv50_head *head = nv50_head(crtc);
2257+
2258+
NV_ATOMIC(drm, "%s: set %04x (clr %04x)\n", crtc->name,
2259+
asyh->set.mask, asyh->clr.mask);
2260+
2261+
if (asyh->set.mask) {
2262+
nv50_head_flush_set_wndw(head, asyh);
2263+
interlock[NV50_DISP_INTERLOCK_CORE] = 1;
2264+
}
2265+
}
2266+
22402267
/* Update plane(s). */
22412268
for_each_new_plane_in_state(state, plane, new_plane_state, i) {
22422269
struct nv50_wndw_atom *asyw = nv50_wndw_atom(new_plane_state);

‎drivers/gpu/drm/nouveau/dispnv50/head.c‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,23 @@ nv50_head_flush_clr(struct nv50_head *head,
5050
}
5151

5252
void
53-
nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
53+
nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh)
5454
{
55-
if (asyh->set.view ) head->func->view (head, asyh);
56-
if (asyh->set.mode ) head->func->mode (head, asyh);
57-
if (asyh->set.core ) head->func->core_set(head, asyh);
5855
if (asyh->set.olut ) {
5956
asyh->olut.offset = nv50_lut_load(&head->olut,
6057
asyh->olut.buffer,
6158
asyh->state.gamma_lut,
6259
asyh->olut.load);
6360
head->func->olut_set(head, asyh);
6461
}
62+
}
63+
64+
void
65+
nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
66+
{
67+
if (asyh->set.view ) head->func->view (head, asyh);
68+
if (asyh->set.mode ) head->func->mode (head, asyh);
69+
if (asyh->set.core ) head->func->core_set(head, asyh);
6570
if (asyh->set.curs ) head->func->curs_set(head, asyh);
6671
if (asyh->set.base ) head->func->base (head, asyh);
6772
if (asyh->set.ovly ) head->func->ovly (head, asyh);

‎drivers/gpu/drm/nouveau/dispnv50/head.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct nv50_head {
2121

2222
struct nv50_head *nv50_head_create(struct drm_device *, int index);
2323
void nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh);
24+
void nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh);
2425
void nv50_head_flush_clr(struct nv50_head *head,
2526
struct nv50_head_atom *asyh, bool flush);
2627

0 commit comments

Comments
 (0)