Skip to content

Commit e6867ff

Browse files
author
Ben Skeggs
committed
drm/nouveau/disp: modify OR allocation policy to account for HDA requirements
Since GM200, SORs are no longer tied to a specific connector, and we allocate them instead, with the assumption that all SORs are equally capable. However, there's a 1<->1 mapping between SOR and HDA pin widget, and it turns out that it's possible for some widgets to be disabled... In order to avoid picking a SOR without a valid pin widget, some new rules need to be added. Signed-off-by: Ben Skeggs <[email protected]>
1 parent f24b6ae commit e6867ff

File tree

1 file changed

+22
-4
lines changed
  • drivers/gpu/drm/nouveau/nvkm/engine/disp

1 file changed

+22
-4
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ nvkm_outp_acquire_hda(struct nvkm_outp *outp, enum nvkm_ior_type type,
121121
* on HW, if any, in order to prevent unnecessary switching.
122122
*/
123123
list_for_each_entry(ior, &outp->disp->ior, head) {
124-
if (!ior->identity &&
124+
if (!ior->identity && !!ior->func->hda.hpd == hda &&
125125
!ior->asy.outp && ior->arm.outp == outp)
126126
return nvkm_outp_acquire_ior(outp, user, ior);
127127
}
128128

129129
/* Failing that, a completely unused OR is the next best thing. */
130130
list_for_each_entry(ior, &outp->disp->ior, head) {
131-
if (!ior->identity &&
131+
if (!ior->identity && !!ior->func->hda.hpd == hda &&
132132
!ior->asy.outp && ior->type == type && !ior->arm.outp &&
133133
(ior->func->route.set || ior->id == __ffs(outp->info.or)))
134134
return nvkm_outp_acquire_ior(outp, user, ior);
@@ -138,7 +138,7 @@ nvkm_outp_acquire_hda(struct nvkm_outp *outp, enum nvkm_ior_type type,
138138
* but will be released during the next modeset.
139139
*/
140140
list_for_each_entry(ior, &outp->disp->ior, head) {
141-
if (!ior->identity &&
141+
if (!ior->identity && !!ior->func->hda.hpd == hda &&
142142
!ior->asy.outp && ior->type == type &&
143143
(ior->func->route.set || ior->id == __ffs(outp->info.or)))
144144
return nvkm_outp_acquire_ior(outp, user, ior);
@@ -173,7 +173,25 @@ nvkm_outp_acquire(struct nvkm_outp *outp, u8 user, bool hda)
173173
return nvkm_outp_acquire_ior(outp, user, ior);
174174
}
175175

176-
return nvkm_outp_acquire_hda(outp, type, user, true);
176+
/* If we don't need HDA, first try to acquire an OR that doesn't
177+
* support it to leave free the ones that do.
178+
*/
179+
if (!hda) {
180+
if (!nvkm_outp_acquire_hda(outp, type, user, false))
181+
return 0;
182+
183+
/* Use a HDA-supporting SOR anyway. */
184+
return nvkm_outp_acquire_hda(outp, type, user, true);
185+
}
186+
187+
/* We want HDA, try to acquire an OR that supports it. */
188+
if (!nvkm_outp_acquire_hda(outp, type, user, true))
189+
return 0;
190+
191+
/* There weren't any free ORs that support HDA, grab one that
192+
* doesn't and at least allow display to work still.
193+
*/
194+
return nvkm_outp_acquire_hda(outp, type, user, false);
177195
}
178196

179197
void

0 commit comments

Comments
 (0)