diff options
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 76b01c16a0e8..76b034be2c7c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -8540,15 +8540,20 @@ static void intel_set_config_restore_state(struct drm_device *dev, | |||
| 8540 | } | 8540 | } |
| 8541 | 8541 | ||
| 8542 | static bool | 8542 | static bool |
| 8543 | is_crtc_connector_off(struct drm_crtc *crtc, struct drm_connector *connectors, | 8543 | is_crtc_connector_off(struct drm_mode_set *set) |
| 8544 | int num_connectors) | ||
| 8545 | { | 8544 | { |
| 8546 | int i; | 8545 | int i; |
| 8547 | 8546 | ||
| 8548 | for (i = 0; i < num_connectors; i++) | 8547 | if (set->num_connectors == 0) |
| 8549 | if (connectors[i].encoder && | 8548 | return false; |
| 8550 | connectors[i].encoder->crtc == crtc && | 8549 | |
| 8551 | connectors[i].dpms != DRM_MODE_DPMS_ON) | 8550 | if (WARN_ON(set->connectors == NULL)) |
| 8551 | return false; | ||
| 8552 | |||
| 8553 | for (i = 0; i < set->num_connectors; i++) | ||
| 8554 | if (set->connectors[i]->encoder && | ||
| 8555 | set->connectors[i]->encoder->crtc == set->crtc && | ||
| 8556 | set->connectors[i]->dpms != DRM_MODE_DPMS_ON) | ||
| 8552 | return true; | 8557 | return true; |
| 8553 | 8558 | ||
| 8554 | return false; | 8559 | return false; |
| @@ -8561,10 +8566,8 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set, | |||
| 8561 | 8566 | ||
| 8562 | /* We should be able to check here if the fb has the same properties | 8567 | /* We should be able to check here if the fb has the same properties |
| 8563 | * and then just flip_or_move it */ | 8568 | * and then just flip_or_move it */ |
| 8564 | if (set->connectors != NULL && | 8569 | if (is_crtc_connector_off(set)) { |
| 8565 | is_crtc_connector_off(set->crtc, *set->connectors, | 8570 | config->mode_changed = true; |
| 8566 | set->num_connectors)) { | ||
| 8567 | config->mode_changed = true; | ||
| 8568 | } else if (set->crtc->fb != set->fb) { | 8571 | } else if (set->crtc->fb != set->fb) { |
| 8569 | /* If we have no fb then treat it as a full mode set */ | 8572 | /* If we have no fb then treat it as a full mode set */ |
| 8570 | if (set->crtc->fb == NULL) { | 8573 | if (set->crtc->fb == NULL) { |
