Skip to content

Commit

Permalink
drm/atomic: Unify conflicting encoder handling.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Maarten Lankhorst authored and Sean Paul committed Apr 6, 2017
1 parent 53552d5 commit 44596b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 5 additions & 2 deletions drivers/gpu/drm/drm_atomic_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
}
}

ret = handle_conflicting_encoders(state, state->legacy_set_config);
ret = handle_conflicting_encoders(state, false);
if (ret)
return ret;

Expand Down Expand Up @@ -2289,12 +2289,15 @@ int drm_atomic_helper_set_config(struct drm_mode_set *set,
if (!state)
return -ENOMEM;

state->legacy_set_config = true;
state->acquire_ctx = ctx;
ret = __drm_atomic_helper_set_config(set, state);
if (ret != 0)
goto fail;

ret = handle_conflicting_encoders(state, true);
if (ret)
return ret;

ret = drm_atomic_commit(state);

fail:
Expand Down
2 changes: 0 additions & 2 deletions include/drm/drm_atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ struct __drm_connnectors_state {
* @dev: parent DRM device
* @allow_modeset: allow full modeset
* @legacy_cursor_update: hint to enforce legacy cursor IOCTL semantics
* @legacy_set_config: Disable conflicting encoders instead of failing with -EINVAL.
* @planes: pointer to array of structures with per-plane data
* @crtcs: pointer to array of CRTC pointers
* @num_connector: size of the @connectors and @connector_states arrays
Expand All @@ -173,7 +172,6 @@ struct drm_atomic_state {
struct drm_device *dev;
bool allow_modeset : 1;
bool legacy_cursor_update : 1;
bool legacy_set_config : 1;
struct __drm_planes_state *planes;
struct __drm_crtcs_state *crtcs;
int num_connector;
Expand Down

0 comments on commit 44596b8

Please sign in to comment.