]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/atomic: Handle funcs->best_encoder == NULL case
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Wed, 1 Jun 2016 16:03:37 +0000 (18:03 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 2 Jun 2016 06:27:39 +0000 (08:27 +0200)
Fallback drm_atomic_helper_best_encoder() is funcs->best_encoder() is NULL
so that DRM drivers can leave this hook unassigned if they know they want
to use drm_atomic_helper_best_encoder().

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160601180337.28e0917b@bbrezillon
drivers/gpu/drm/drm_atomic_helper.c

index 939df900dcaa0adadee6a4f48b791f30fcf4ad7a..599842ca0c649707c22d397f152ce4d64d4f5745 100644 (file)
@@ -110,8 +110,10 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,
 
                if (funcs->atomic_best_encoder)
                        new_encoder = funcs->atomic_best_encoder(connector, conn_state);
-               else
+               else if (funcs->best_encoder)
                        new_encoder = funcs->best_encoder(connector);
+               else
+                       new_encoder = drm_atomic_helper_best_encoder(connector);
 
                if (new_encoder) {
                        if (encoder_mask & (1 << drm_encoder_index(new_encoder))) {