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

Commit 96dcc644 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm/sde: update drm modes with private fields during atomic check" into msm-4.9

parents 3c4c3312 eb49ff33
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -284,6 +284,24 @@ void sde_encoder_helper_split_config(
	}
}

static void _sde_encoder_adjust_mode(struct drm_connector *connector,
		struct drm_display_mode *adj_mode)
{
	struct drm_display_mode *cur_mode;

	if (!connector || !adj_mode)
		return;

	list_for_each_entry(cur_mode, &connector->modes, head) {
		if (cur_mode->vdisplay == adj_mode->vdisplay &&
			cur_mode->hdisplay == adj_mode->hdisplay &&
			cur_mode->vrefresh == adj_mode->vrefresh) {
			adj_mode->private = cur_mode->private;
			adj_mode->private_flags = cur_mode->private_flags;
		}
	}
}

static int sde_encoder_virt_atomic_check(
		struct drm_encoder *drm_enc,
		struct drm_crtc_state *crtc_state,
@@ -312,6 +330,15 @@ static int sde_encoder_virt_atomic_check(
	adj_mode = &crtc_state->adjusted_mode;
	SDE_EVT32(DRMID(drm_enc));

	/*
	 * display drivers may populate private fields of the drm display mode
	 * structure while registering possible modes of a connector with DRM.
	 * These private fields are not populated back while DRM invokes
	 * the mode_set callbacks. This module retrieves and populates the
	 * private fields of the given mode.
	 */
	_sde_encoder_adjust_mode(conn_state->connector, adj_mode);

	/* perform atomic check on the first physical encoder (master) */
	for (i = 0; i < sde_enc->num_phys_encs; i++) {
		struct sde_encoder_phys *phys = sde_enc->phys_encs[i];