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

Commit f51b9f9e authored by Govinda Rajulu Chenna's avatar Govinda Rajulu Chenna Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: fix for buffer corruption issues with mst connectors



Current implementation of get_output_fence is depending on
atomic_state to extract the connector details. There is a
possibility to have no connectors in atomic_state if no
connector property is processed by the time of executing
get_output_fence property and this results in wrong fence
handling.

This change depends on crtc encoder_mask field to extract
the drm_encoder tied to drm_crtc and extracts the panel
mode, video or command, information from sde_encoder object.

Change-Id: I3145b543382dcac038f38ee2769309b179395b3c
Signed-off-by: default avatarGovinda Rajulu Chenna <gchenna@codeaurora.org>
parent 3638c290
Loading
Loading
Loading
Loading
+7 −17
Original line number Original line Diff line number Diff line
@@ -5736,28 +5736,18 @@ static int _sde_crtc_get_output_fence(struct drm_crtc *crtc,
{
{
	struct sde_crtc *sde_crtc;
	struct sde_crtc *sde_crtc;
	struct sde_crtc_state *cstate;
	struct sde_crtc_state *cstate;
	uint32_t offset, i;
	uint32_t offset;
	struct drm_connector_state *old_conn_state, *new_conn_state;
	struct drm_connector *conn;
	struct sde_connector *sde_conn = NULL;
	struct msm_display_info disp_info;
	bool is_vid = false;
	bool is_vid = false;
	struct drm_encoder *encoder;


	sde_crtc = to_sde_crtc(crtc);
	sde_crtc = to_sde_crtc(crtc);
	cstate = to_sde_crtc_state(state);
	cstate = to_sde_crtc_state(state);


	for_each_oldnew_connector_in_state(state->state, conn, old_conn_state,
	drm_for_each_encoder_mask(encoder, crtc->dev, state->encoder_mask) {
							new_conn_state, i) {
		is_vid |= sde_encoder_check_mode(encoder,
		if (!new_conn_state || new_conn_state->crtc != crtc)
						MSM_DISPLAY_CAP_VID_MODE);
			continue;
		if (is_vid)

			break;
		sde_conn = to_sde_connector(new_conn_state->connector);
		if (sde_conn->display && sde_conn->ops.get_info) {
			sde_conn->ops.get_info(conn, &disp_info,
							sde_conn->display);
			is_vid |= disp_info.capabilities &
						MSM_DISPLAY_CAP_VID_MODE;
		}
	}
	}


	offset = sde_crtc_get_property(cstate, CRTC_PROP_OUTPUT_FENCE_OFFSET);
	offset = sde_crtc_get_property(cstate, CRTC_PROP_OUTPUT_FENCE_OFFSET);