drm_atomic.c (020a218f95bd3ceff7dd1022ff7ebc0497bc7bf9) drm_atomic.c (ad09360750afa18a0a0ce0253d6ea6033abc22e7)
1/*
2 * Copyright (C) 2014 Red Hat
3 * Copyright (C) 2014 Intel Corp.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,

--- 136 unchanged lines hidden (view full) ---

145
146 if (!connector)
147 continue;
148
149 connector->funcs->atomic_destroy_state(connector,
150 state->connectors[i].state);
151 state->connectors[i].ptr = NULL;
152 state->connectors[i].state = NULL;
1/*
2 * Copyright (C) 2014 Red Hat
3 * Copyright (C) 2014 Intel Corp.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,

--- 136 unchanged lines hidden (view full) ---

145
146 if (!connector)
147 continue;
148
149 connector->funcs->atomic_destroy_state(connector,
150 state->connectors[i].state);
151 state->connectors[i].ptr = NULL;
152 state->connectors[i].state = NULL;
153 drm_connector_unreference(connector);
153 drm_connector_put(connector);
154 }
155
156 for (i = 0; i < config->num_crtc; i++) {
157 struct drm_crtc *crtc = state->crtcs[i].ptr;
158
159 if (!crtc)
160 continue;
161

--- 863 unchanged lines hidden (view full) ---

1025
1026 if (state->connectors[index].state)
1027 return state->connectors[index].state;
1028
1029 connector_state = connector->funcs->atomic_duplicate_state(connector);
1030 if (!connector_state)
1031 return ERR_PTR(-ENOMEM);
1032
154 }
155
156 for (i = 0; i < config->num_crtc; i++) {
157 struct drm_crtc *crtc = state->crtcs[i].ptr;
158
159 if (!crtc)
160 continue;
161

--- 863 unchanged lines hidden (view full) ---

1025
1026 if (state->connectors[index].state)
1027 return state->connectors[index].state;
1028
1029 connector_state = connector->funcs->atomic_duplicate_state(connector);
1030 if (!connector_state)
1031 return ERR_PTR(-ENOMEM);
1032
1033 drm_connector_reference(connector);
1033 drm_connector_get(connector);
1034 state->connectors[index].state = connector_state;
1035 state->connectors[index].old_state = connector->state;
1036 state->connectors[index].new_state = connector_state;
1037 state->connectors[index].ptr = connector;
1038 connector_state->state = state;
1039
1040 DRM_DEBUG_ATOMIC("Added [CONNECTOR:%d:%s] %p state to %p\n",
1041 connector->base.id, connector->name,

--- 333 unchanged lines hidden (view full) ---

1375
1376 if (conn_state->crtc) {
1377 crtc_state = drm_atomic_get_existing_crtc_state(conn_state->state,
1378 conn_state->crtc);
1379
1380 crtc_state->connector_mask &=
1381 ~(1 << drm_connector_index(conn_state->connector));
1382
1034 state->connectors[index].state = connector_state;
1035 state->connectors[index].old_state = connector->state;
1036 state->connectors[index].new_state = connector_state;
1037 state->connectors[index].ptr = connector;
1038 connector_state->state = state;
1039
1040 DRM_DEBUG_ATOMIC("Added [CONNECTOR:%d:%s] %p state to %p\n",
1041 connector->base.id, connector->name,

--- 333 unchanged lines hidden (view full) ---

1375
1376 if (conn_state->crtc) {
1377 crtc_state = drm_atomic_get_existing_crtc_state(conn_state->state,
1378 conn_state->crtc);
1379
1380 crtc_state->connector_mask &=
1381 ~(1 << drm_connector_index(conn_state->connector));
1382
1383 drm_connector_unreference(conn_state->connector);
1383 drm_connector_put(conn_state->connector);
1384 conn_state->crtc = NULL;
1385 }
1386
1387 if (crtc) {
1388 crtc_state = drm_atomic_get_crtc_state(conn_state->state, crtc);
1389 if (IS_ERR(crtc_state))
1390 return PTR_ERR(crtc_state);
1391
1392 crtc_state->connector_mask |=
1393 1 << drm_connector_index(conn_state->connector);
1394
1384 conn_state->crtc = NULL;
1385 }
1386
1387 if (crtc) {
1388 crtc_state = drm_atomic_get_crtc_state(conn_state->state, crtc);
1389 if (IS_ERR(crtc_state))
1390 return PTR_ERR(crtc_state);
1391
1392 crtc_state->connector_mask |=
1393 1 << drm_connector_index(conn_state->connector);
1394
1395 drm_connector_reference(conn_state->connector);
1395 drm_connector_get(conn_state->connector);
1396 conn_state->crtc = crtc;
1397
1398 DRM_DEBUG_ATOMIC("Link connector state %p to [CRTC:%d:%s]\n",
1399 conn_state, crtc->base.id, crtc->name);
1400 } else {
1401 DRM_DEBUG_ATOMIC("Link connector state %p to [NOCRTC]\n",
1402 conn_state);
1403 }

--- 928 unchanged lines hidden ---
1396 conn_state->crtc = crtc;
1397
1398 DRM_DEBUG_ATOMIC("Link connector state %p to [CRTC:%d:%s]\n",
1399 conn_state, crtc->base.id, crtc->name);
1400 } else {
1401 DRM_DEBUG_ATOMIC("Link connector state %p to [NOCRTC]\n",
1402 conn_state);
1403 }

--- 928 unchanged lines hidden ---