]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/nouveau: Fix drm-core using atomic code-paths on pre-nv50 hardware
authorHans de Goede <hdegoede@redhat.com>
Thu, 24 Oct 2019 08:52:53 +0000 (10:52 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 10 Dec 2019 11:34:52 +0000 (21:34 +1000)
commit64d17f25dcad518461ccf0c260544e1e379c5b35
tree6d584d5dd7d10386dd546dc0640929fbec7561db
parent37a68eab4cd92b507c9e8afd760fdc18e4fecac6
drm/nouveau: Fix drm-core using atomic code-paths on pre-nv50 hardware

We do not support atomic modesetting on pre-nv50 hardware, but until now
our connector code was setting drm_connector->state on pre-nv50 hardware.

This causes the core to enter atomic modesetting paths in at least:

1. drm_connector_get_encoder(), returning connector->state->best_encoder
which is always 0, causing us to always report 0 as encoder_id in
the drmModeConnector struct returned by drmModeGetConnector().

2. drm_encoder_get_crtc(), returning NULL because uses_atomic get set,
causing us to always report 0 as crtc_id in the drmModeEncoder struct
returned by drmModeGetEncoder()

Which in turn confuses userspace, at least plymouth thinks that the pipe
has changed because of this and tries to reconfigure it unnecessarily.

More in general we should not set drm_connector->state in the non-atomic
code as this violates the drm-core's expectations.

This commit fixes this by using a nouveau_conn_atom struct embedded in the
nouveau_connector struct for property handling in the non-atomic case.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1706557
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.h