Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/atomic: Unify conflicting encoder handling.

Currently we use a flag to change behavior in atomic commit
whether a conflicting encoder should be enabled or disabled.
This is used for the legacy set_config helper, which disables
connectors that have a conflicting encoder but not part of the
active crtc list.

There's no need for this to be handled in atomic commit, it
could be done in the set_config helper instead. This will
let the atomic check function reject any conflicting encoders,
while set_config can disable conflicting crtc's. This makes it
possible to recalculate the changed flags in 1 loop.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1491477543-31257-2-git-send-email-maarten.lankhorst@linux.intel.com

authored by

Maarten Lankhorst and committed by
Sean Paul
44596b8c 53552d5d

+5 -4
+5 -2
drivers/gpu/drm/drm_atomic_helper.c
··· 517 517 } 518 518 } 519 519 520 - ret = handle_conflicting_encoders(state, state->legacy_set_config); 520 + ret = handle_conflicting_encoders(state, false); 521 521 if (ret) 522 522 return ret; 523 523 ··· 2289 2289 if (!state) 2290 2290 return -ENOMEM; 2291 2291 2292 - state->legacy_set_config = true; 2293 2292 state->acquire_ctx = ctx; 2294 2293 ret = __drm_atomic_helper_set_config(set, state); 2295 2294 if (ret != 0) 2296 2295 goto fail; 2296 + 2297 + ret = handle_conflicting_encoders(state, true); 2298 + if (ret) 2299 + return ret; 2297 2300 2298 2301 ret = drm_atomic_commit(state); 2299 2302
-2
include/drm/drm_atomic.h
··· 160 160 * @dev: parent DRM device 161 161 * @allow_modeset: allow full modeset 162 162 * @legacy_cursor_update: hint to enforce legacy cursor IOCTL semantics 163 - * @legacy_set_config: Disable conflicting encoders instead of failing with -EINVAL. 164 163 * @planes: pointer to array of structures with per-plane data 165 164 * @crtcs: pointer to array of CRTC pointers 166 165 * @num_connector: size of the @connectors and @connector_states arrays ··· 172 173 struct drm_device *dev; 173 174 bool allow_modeset : 1; 174 175 bool legacy_cursor_update : 1; 175 - bool legacy_set_config : 1; 176 176 struct __drm_planes_state *planes; 177 177 struct __drm_crtcs_state *crtcs; 178 178 int num_connector;