aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c39
-rw-r--r--drivers/gpu/drm/i915/intel_display.c2
2 files changed, 31 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 99656815641d..10bcdd554501 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -124,7 +124,7 @@ steal_encoder(struct drm_atomic_state *state,
124 if (IS_ERR(crtc_state)) 124 if (IS_ERR(crtc_state))
125 return PTR_ERR(crtc_state); 125 return PTR_ERR(crtc_state);
126 126
127 crtc_state->mode_changed = true; 127 crtc_state->connectors_changed = true;
128 128
129 list_for_each_entry(connector, &config->connector_list, head) { 129 list_for_each_entry(connector, &config->connector_list, head) {
130 if (connector->state->best_encoder != encoder) 130 if (connector->state->best_encoder != encoder)
@@ -174,14 +174,14 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
174 idx = drm_crtc_index(connector->state->crtc); 174 idx = drm_crtc_index(connector->state->crtc);
175 175
176 crtc_state = state->crtc_states[idx]; 176 crtc_state = state->crtc_states[idx];
177 crtc_state->mode_changed = true; 177 crtc_state->connectors_changed = true;
178 } 178 }
179 179
180 if (connector_state->crtc) { 180 if (connector_state->crtc) {
181 idx = drm_crtc_index(connector_state->crtc); 181 idx = drm_crtc_index(connector_state->crtc);
182 182
183 crtc_state = state->crtc_states[idx]; 183 crtc_state = state->crtc_states[idx];
184 crtc_state->mode_changed = true; 184 crtc_state->connectors_changed = true;
185 } 185 }
186 } 186 }
187 187
@@ -233,7 +233,7 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
233 idx = drm_crtc_index(connector_state->crtc); 233 idx = drm_crtc_index(connector_state->crtc);
234 234
235 crtc_state = state->crtc_states[idx]; 235 crtc_state = state->crtc_states[idx];
236 crtc_state->mode_changed = true; 236 crtc_state->connectors_changed = true;
237 237
238 DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d]\n", 238 DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d]\n",
239 connector->base.id, 239 connector->base.id,
@@ -256,7 +256,8 @@ mode_fixup(struct drm_atomic_state *state)
256 bool ret; 256 bool ret;
257 257
258 for_each_crtc_in_state(state, crtc, crtc_state, i) { 258 for_each_crtc_in_state(state, crtc, crtc_state, i) {
259 if (!crtc_state->mode_changed) 259 if (!crtc_state->mode_changed &&
260 !crtc_state->connectors_changed)
260 continue; 261 continue;
261 262
262 drm_mode_copy(&crtc_state->adjusted_mode, &crtc_state->mode); 263 drm_mode_copy(&crtc_state->adjusted_mode, &crtc_state->mode);
@@ -312,7 +313,8 @@ mode_fixup(struct drm_atomic_state *state)
312 for_each_crtc_in_state(state, crtc, crtc_state, i) { 313 for_each_crtc_in_state(state, crtc, crtc_state, i) {
313 const struct drm_crtc_helper_funcs *funcs; 314 const struct drm_crtc_helper_funcs *funcs;
314 315
315 if (!crtc_state->mode_changed) 316 if (!crtc_state->mode_changed &&
317 !crtc_state->connectors_changed)
316 continue; 318 continue;
317 319
318 funcs = crtc->helper_private; 320 funcs = crtc->helper_private;
@@ -338,9 +340,14 @@ mode_fixup(struct drm_atomic_state *state)
338 * 340 *
339 * Check the state object to see if the requested state is physically possible. 341 * Check the state object to see if the requested state is physically possible.
340 * This does all the crtc and connector related computations for an atomic 342 * This does all the crtc and connector related computations for an atomic
341 * update. It computes and updates crtc_state->mode_changed, adds any additional 343 * update and adds any additional connectors needed for full modesets and calls
342 * connectors needed for full modesets and calls down into ->mode_fixup 344 * down into ->mode_fixup functions of the driver backend.
343 * functions of the driver backend. 345 *
346 * crtc_state->mode_changed is set when the input mode is changed.
347 * crtc_state->connectors_changed is set when a connector is added or
348 * removed from the crtc.
349 * crtc_state->active_changed is set when crtc_state->active changes,
350 * which is used for dpms.
344 * 351 *
345 * IMPORTANT: 352 * IMPORTANT:
346 * 353 *
@@ -373,7 +380,17 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
373 if (crtc->state->enable != crtc_state->enable) { 380 if (crtc->state->enable != crtc_state->enable) {
374 DRM_DEBUG_ATOMIC("[CRTC:%d] enable changed\n", 381 DRM_DEBUG_ATOMIC("[CRTC:%d] enable changed\n",
375 crtc->base.id); 382 crtc->base.id);
383
384 /*
385 * For clarity this assignment is done here, but
386 * enable == 0 is only true when there are no
387 * connectors and a NULL mode.
388 *
389 * The other way around is true as well. enable != 0
390 * iff connectors are attached and a mode is set.
391 */
376 crtc_state->mode_changed = true; 392 crtc_state->mode_changed = true;
393 crtc_state->connectors_changed = true;
377 } 394 }
378 } 395 }
379 396
@@ -448,6 +465,9 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
448 * This does all the plane update related checks using by calling into the 465 * This does all the plane update related checks using by calling into the
449 * ->atomic_check hooks provided by the driver. 466 * ->atomic_check hooks provided by the driver.
450 * 467 *
468 * It also sets crtc_state->planes_changed to indicate that a crtc has
469 * updated planes.
470 *
451 * RETURNS 471 * RETURNS
452 * Zero for success or -errno 472 * Zero for success or -errno
453 */ 473 */
@@ -2074,6 +2094,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
2074 state->mode_changed = false; 2094 state->mode_changed = false;
2075 state->active_changed = false; 2095 state->active_changed = false;
2076 state->planes_changed = false; 2096 state->planes_changed = false;
2097 state->connectors_changed = false;
2077 state->event = NULL; 2098 state->event = NULL;
2078} 2099}
2079EXPORT_SYMBOL(__drm_atomic_helper_crtc_duplicate_state); 2100EXPORT_SYMBOL(__drm_atomic_helper_crtc_duplicate_state);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index af0bcfee4771..07cee59edece 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -413,7 +413,7 @@ static const intel_limit_t intel_limits_bxt = {
413static bool 413static bool
414needs_modeset(struct drm_crtc_state *state) 414needs_modeset(struct drm_crtc_state *state)
415{ 415{
416 return state->mode_changed || state->active_changed; 416 return drm_atomic_crtc_needs_modeset(state);
417} 417}
418 418
419/** 419/**