mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-12 09:32:44 +00:00
drm/atomic: Clean up update_output_state.
With the addition of crtc_state->connector_mask other connectors from different crtc's aren't needed any more to determine if a crtc has connectors, so only call add_affected_connectors on the target crtc. This allows a cleanup to first remove all current connectors, then add all set->connectors to the target crtc. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1456303053-28806-2-git-send-email-maarten.lankhorst@linux.intel.com
This commit is contained in:
parent
327097930d
commit
6ab520a2a1
1 changed files with 17 additions and 24 deletions
|
@ -1761,28 +1761,18 @@ static int update_output_state(struct drm_atomic_state *state,
|
||||||
struct drm_crtc_state *crtc_state;
|
struct drm_crtc_state *crtc_state;
|
||||||
struct drm_connector *connector;
|
struct drm_connector *connector;
|
||||||
struct drm_connector_state *conn_state;
|
struct drm_connector_state *conn_state;
|
||||||
int ret, i, j;
|
int ret, i;
|
||||||
|
|
||||||
ret = drm_modeset_lock(&dev->mode_config.connection_mutex,
|
ret = drm_modeset_lock(&dev->mode_config.connection_mutex,
|
||||||
state->acquire_ctx);
|
state->acquire_ctx);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* First grab all affected connector/crtc states. */
|
/* First disable all connectors on the target crtc. */
|
||||||
for (i = 0; i < set->num_connectors; i++) {
|
ret = drm_atomic_add_affected_connectors(state, set->crtc);
|
||||||
conn_state = drm_atomic_get_connector_state(state,
|
|
||||||
set->connectors[i]);
|
|
||||||
if (IS_ERR(conn_state))
|
|
||||||
return PTR_ERR(conn_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
for_each_crtc_in_state(state, crtc, crtc_state, i) {
|
|
||||||
ret = drm_atomic_add_affected_connectors(state, crtc);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
/* Then recompute connector->crtc links and crtc enabling state. */
|
|
||||||
for_each_connector_in_state(state, connector, conn_state, i) {
|
for_each_connector_in_state(state, connector, conn_state, i) {
|
||||||
if (conn_state->crtc == set->crtc) {
|
if (conn_state->crtc == set->crtc) {
|
||||||
ret = drm_atomic_set_crtc_for_connector(conn_state,
|
ret = drm_atomic_set_crtc_for_connector(conn_state,
|
||||||
|
@ -1790,16 +1780,19 @@ static int update_output_state(struct drm_atomic_state *state,
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Then set all connectors from set->connectors on the target crtc */
|
||||||
|
for (i = 0; i < set->num_connectors; i++) {
|
||||||
|
conn_state = drm_atomic_get_connector_state(state,
|
||||||
|
set->connectors[i]);
|
||||||
|
if (IS_ERR(conn_state))
|
||||||
|
return PTR_ERR(conn_state);
|
||||||
|
|
||||||
for (j = 0; j < set->num_connectors; j++) {
|
|
||||||
if (set->connectors[j] == connector) {
|
|
||||||
ret = drm_atomic_set_crtc_for_connector(conn_state,
|
ret = drm_atomic_set_crtc_for_connector(conn_state,
|
||||||
set->crtc);
|
set->crtc);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_crtc_in_state(state, crtc, crtc_state, i) {
|
for_each_crtc_in_state(state, crtc, crtc_state, i) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue