drm/nouveau/kms/gv100-: Re-set LUT after clearing for modesets
authorLyude Paul <lyude@redhat.com>
Wed, 12 Feb 2020 23:11:49 +0000 (18:11 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 16:22:21 +0000 (17:22 +0100)
commit3e740fa80cc8124f0c715f24584684f5a9d26f43
tree2ca0d8e8fcb3ecfeb691e2e3f23baa9062e635fd
parent5e7dda6ddad18386be16e75f04eb661ba673ea42
drm/nouveau/kms/gv100-: Re-set LUT after clearing for modesets

commit f287d3d19769b1d22cba4e51fa0487f2697713c9 upstream.

While certain modeset operations on gv100+ need us to temporarily
disable the LUT, we make the mistake of sometimes neglecting to
reprogram the LUT after such modesets. In particular, moving a head from
one encoder to another seems to trigger this quite often. GV100+ is very
picky about having a LUT in most scenarios, so this causes the display
engine to hang with the following error code:

disp: chid 1 stat 00005080 reason 5 [INVALID_STATE] mthd 0200 data
00000001 code 0000002d)

So, fix this by always re-programming the LUT if we're clearing it in a
state where the wndw is still visible, and has a XLUT handle programmed.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: facaed62b4cb ("drm/nouveau/kms/gv100: initial support")
Cc: <stable@vger.kernel.org> # v4.18+
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/dispnv50/wndw.c