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

Commit 5cb59be3 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

drm/msm/sde: update release & retire fence timeline



Update release and retire fence timeline according to client
requirement to align it with correct vsync boundary and avoid
issues in jank cases.

Change-Id: Ibee64f4feea2623e8bc8459273b7193d5e7bdacc
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 979ef22a
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -511,13 +511,7 @@ static int sde_connector_atomic_get_property(struct drm_connector *connector,

	idx = msm_property_index(&c_conn->property_info, property);
	if (idx == CONNECTOR_PROP_RETIRE_FENCE)
		/*
		 * Set a fence offset if not a virtual connector, so that the
		 * fence signals after one additional commit rather than at the
		 * end of the current one.
		 */
		rc = sde_fence_create(&c_conn->retire_fence, val,
			c_conn->connector_type != DRM_MODE_CONNECTOR_VIRTUAL);
		rc = sde_fence_create(&c_conn->retire_fence, val, 0);
	else
		/* get cached property value */
		rc = msm_property_atomic_get(&c_conn->property_info,
+17 −0
Original line number Diff line number Diff line
@@ -425,5 +425,22 @@ int sde_connector_register_custom_event(struct sde_kms *kms,
 */
int sde_connector_pre_kickoff(struct drm_connector *connector);

/**
 * sde_connector_needs_offset - adjust the output fence offset based on
 *                              display type
 * @connector: Pointer to drm connector object
 * Returns: true if offset is required, false for all other cases.
 */
static inline bool sde_connector_needs_offset(struct drm_connector *connector)
{
	struct sde_connector *c_conn;

	if (!connector)
		return false;

	c_conn = to_sde_connector(connector);
	return (c_conn->connector_type != DRM_MODE_CONNECTOR_VIRTUAL);
}

#endif /* _SDE_CONNECTOR_H_ */
+11 −2
Original line number Diff line number Diff line
@@ -2365,19 +2365,28 @@ static int sde_crtc_atomic_get_property(struct drm_crtc *crtc,
	struct sde_crtc *sde_crtc;
	struct sde_crtc_state *cstate;
	int i, ret = -EINVAL;
	bool conn_offset = 0;

	if (!crtc || !state) {
		SDE_ERROR("invalid argument(s)\n");
	} else {
		sde_crtc = to_sde_crtc(crtc);
		cstate = to_sde_crtc_state(state);

		for (i = 0; i < cstate->num_connectors; ++i) {
			conn_offset = sde_connector_needs_offset(
						cstate->connectors[i]);
			if (conn_offset)
				break;
		}

		i = msm_property_index(&sde_crtc->property_info, property);
		if (i == CRTC_PROP_OUTPUT_FENCE) {
			uint32_t offset = sde_crtc_get_property(cstate,
					CRTC_PROP_OUTPUT_FENCE_OFFSET);

			ret = sde_fence_create(
					&sde_crtc->output_fence, val, offset);
			ret = sde_fence_create(&sde_crtc->output_fence, val,
							offset + conn_offset);
			if (ret)
				SDE_ERROR("fence create failed\n");
		} else {