]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
drm/nouveau: Set DRIVER_ATOMIC cap earlier to fix debugfs
authorLyude Paul <lyude@redhat.com>
Tue, 3 Jul 2018 20:31:41 +0000 (16:31 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 1 Mar 2019 13:20:20 +0000 (14:20 +0100)
commitb0111db8cce69454724306cbdb9046457ca4a5c5
treebb5c3fab2cd8492dffa7eef96213584f0e9ba7fb
parentc413f74feec99278fd50a79d46b360c6472da109
drm/nouveau: Set DRIVER_ATOMIC cap earlier to fix debugfs

BugLink: http://bugs.launchpad.net/bugs/1814813
commit eb493fbc150f4a28151ae1ee84f24395989f3600 upstream.

Currently nouveau doesn't actually expose the state debugfs file that's
usually provided for any modesetting driver that supports atomic, even
if nouveau is loaded with atomic=1. This is due to the fact that the
standard debugfs files that DRM creates for atomic drivers is called
when drm_get_pci_dev() is called from nouveau_drm.c. This happens well
before we've initialized the display core, which is currently
responsible for setting the DRIVER_ATOMIC cap.

So, move the atomic option into nouveau_drm.c and just add the
DRIVER_ATOMIC cap whenever it's enabled on the kernel commandline. This
shouldn't cause any actual issues, as the atomic ioctl will still fail
as expected even if the display core doesn't disable it until later in
the init sequence. This also provides the added benefit of being able to
use the state debugfs file to check the current display state even if
clients aren't allowed to modify it through anything other than the
legacy ioctls.

Additionally, disable the DRIVER_ATOMIC cap in nv04's display core, as
this was already disabled there previously.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/nouveau/dispnv04/disp.c
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/nouveau/nv50_display.c