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

Commit 17e908b5 authored by Clarence Ip's avatar Clarence Ip Committed by Narendra Muppalla
Browse files

drm/msm/sde: don't duplicate input fence pointer with state



Avoid duplicating the input fence structure within the plane
driver's duplicate state callback. The user context is not
always available at this point and the pointer can't be
safely copied without taking an extra reference to it.

Change-Id: I0aeb4f83b871e4c9add95113ffc80f10b56f51a6
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent 2705bff8
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1775,6 +1775,7 @@ sde_plane_duplicate_state(struct drm_plane *plane)
	struct sde_plane *psde;
	struct sde_plane_state *pstate;
	struct sde_plane_state *old_state;
	uint64_t input_fence_default;

	if (!plane || !plane->state)
		return NULL;
@@ -1795,12 +1796,12 @@ sde_plane_duplicate_state(struct drm_plane *plane)
	if (pstate->base.fb)
		drm_framebuffer_reference(pstate->base.fb);

	/* add ref count for fence */
	if (pstate->input_fence) {
	/* clear out any input fence */
	pstate->input_fence = 0;
		_sde_plane_set_input_fence(plane, pstate, pstate->
				property_values[PLANE_PROP_INPUT_FENCE]);
	}
	input_fence_default = msm_property_get_default(
			&psde->property_info, PLANE_PROP_INPUT_FENCE);
	msm_property_set_property(&psde->property_info, pstate->property_values,
			PLANE_PROP_INPUT_FENCE, input_fence_default);

	pstate->dirty = 0x0;
	pstate->pending = false;