Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41227c8c authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Daniel Vetter
Browse files

drm/i915: Don't use staged config to calculate mode_changed flags

parent 8d8c9b51
Loading
Loading
Loading
Loading
+25 −24
Original line number Original line Diff line number Diff line
@@ -12638,10 +12638,12 @@ static void
intel_set_config_compute_mode_changes(struct drm_mode_set *set,
intel_set_config_compute_mode_changes(struct drm_mode_set *set,
				      struct intel_crtc_state *pipe_config)
				      struct intel_crtc_state *pipe_config)
{
{
	struct drm_device *dev = set->crtc->dev;
	struct drm_atomic_state *state;
	struct intel_connector *connector;
	struct drm_connector *connector;
	struct intel_encoder *encoder;
	struct drm_connector_state *connector_state;
	struct intel_crtc *crtc;
	struct drm_crtc *crtc;
	struct drm_crtc_state *crtc_state;
	int i;


	/* We should be able to check here if the fb has the same properties
	/* We should be able to check here if the fb has the same properties
	 * and then just flip_or_move it */
	 * and then just flip_or_move it */
@@ -12685,33 +12687,32 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set,
		pipe_config->base.mode_changed = true;
		pipe_config->base.mode_changed = true;
	}
	}


	for_each_intel_connector(dev, connector) {
	state = pipe_config->base.state;
		if (&connector->new_encoder->base == connector->base.encoder)
			continue;


		pipe_config->base.mode_changed = true;
	for_each_connector_in_state(state, connector, connector_state, i) {
		if (connector_state->best_encoder !=
		    connector->state->best_encoder) {
			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] encoder changed, full mode switch\n",
			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] encoder changed, full mode switch\n",
			      connector->base.base.id,
				      connector->base.id,
			      connector->base.name);
				      connector->name);
			pipe_config->base.mode_changed = true;
		}
		}


	for_each_intel_encoder(dev, encoder) {
		if (connector_state->crtc != connector->state->crtc) {
		if (&encoder->new_crtc->base == encoder->base.crtc)
			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] crtc changed, full mode switch\n",
			continue;
				      connector->base.id,

				      connector->name);
		DRM_DEBUG_KMS("[ENCODER:%d:%s] crtc changed, full mode switch\n",
			      encoder->base.base.id,
			      encoder->base.name);
			pipe_config->base.mode_changed = true;
			pipe_config->base.mode_changed = true;
		}
		}
	}


	for_each_intel_crtc(dev, crtc) {
	for_each_crtc_in_state(state, crtc, crtc_state, i) {
		if (crtc->new_enabled == crtc->base.state->enable)
		if (crtc_state->enable == crtc->state->enable)
			continue;
			continue;


		DRM_DEBUG_KMS("[CRTC:%d] %sabled, full mode switch\n",
		DRM_DEBUG_KMS("[CRTC:%d] %sabled, full mode switch\n",
			      crtc->base.base.id,
			      crtc->base.id,
			      crtc->new_enabled ? "en" : "dis");
			      crtc_state->enable ? "en" : "dis");
		pipe_config->base.mode_changed = true;
		pipe_config->base.mode_changed = true;
	}
	}