]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/nouveau/kms/nv50-: Use less encoders by making mstos per-head
authorLyude Paul <lyude@redhat.com>
Fri, 13 Sep 2019 22:03:52 +0000 (18:03 -0400)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 15 Jan 2020 00:49:58 +0000 (10:49 +1000)
commit5ff0cb1ce2536321045b5bc33ab8fb2467750f33
treedf1c5f88793c4242765a0786e857f7cc564d313f
parent122c1639185fbb0e8fd33a9e23444de64df44684
drm/nouveau/kms/nv50-: Use less encoders by making mstos per-head

Currently, for every single MST capable DRM connector we create a set of
fake encoders, one for each possible head. Unfortunately this ends up
being a huge waste of encoders. While this currently isn't causing us
any problems, it's extremely close to doing so.

The ThinkPad P71 is a good example of this. Originally when trying to
figure out why nouveau was failing to load on this laptop, I discovered
it was because nouveau was creating too many encoders. This ended up
being because we were mistakenly creating MST encoders for the eDP port,
however we are still extremely close to hitting the encoder limit on
this machine as it exposes 1 eDP port and 5 DP ports, resulting in 31
encoders.

So while this fix didn't end up being necessary to fix the P71, we still
need to implement this so that we avoid hitting the encoder limit for
valid display configurations in the event that some machine with more
connectors then this becomes available. Plus, we don't want to let good
code go to waste :)

So, use less encoders by only creating one MSTO per head. Then, attach
each new MSTC to each MSTO which corresponds to a head that it's parent
DP port is capable of using. This brings the number of encoders we
register on the ThinkPad P71 from 31, down to just 15. Yay!

Signed-off-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/dispnv50/disp.c
drivers/gpu/drm/nouveau/dispnv50/disp.h
drivers/gpu/drm/nouveau/dispnv50/head.c
drivers/gpu/drm/nouveau/dispnv50/head.h