diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-06-01 19:03:37 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-06-02 09:27:39 +0300 |
commit | a0909cc574a94213423d45ffa12df2564e78679f (patch) | |
tree | 436dfe6d6a2fb987a2df60923798a4cc39f92d6f /drivers/gpu | |
parent | 66fd7a66e8b9e11e49f46ea77910f935c4dee5c3 (diff) | |
download | linux-a0909cc574a94213423d45ffa12df2564e78679f.tar.xz |
drm/atomic: Handle funcs->best_encoder == NULL case
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
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 939df900dcaa..599842ca0c64 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -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))) { |