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

Commit a15ae767 authored by Alan Kwong's avatar Alan Kwong
Browse files

drm/msm/sde: renew rot resource on new crtc state



Currently rotator resource is not renewed if the inline
rotation plane is not specified in the new atomic commit.
Update crtc to renew rotator resource explicity using
new crtc state if the plane is not part of atomic commit.

Change-Id: I8294f6b4c096751fe577fc49411d197a034af259
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 373476f5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4565,7 +4565,7 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc,

		/* identify attached planes that are not in the delta state */
		if (!drm_atomic_get_existing_plane_state(state->state, plane)) {
			rc = sde_plane_confirm_hw_rsvps(plane, pstate);
			rc = sde_plane_confirm_hw_rsvps(plane, pstate, state);
			if (rc) {
				SDE_ERROR("crtc%d confirmation hw failed %d\n",
						crtc->base.id, rc);
+14 −14
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ static struct drm_crtc_state *_sde_plane_get_crtc_state(
	return cstate;
}

static bool sde_plane_enabled(struct drm_plane_state *state)
static bool sde_plane_enabled(const struct drm_plane_state *state)
{
	return state && state->fb && state->crtc;
}
@@ -2966,30 +2966,22 @@ int sde_plane_validate_multirect_v2(struct sde_multirect_plane_states *plane)
}

int sde_plane_confirm_hw_rsvps(struct drm_plane *plane,
		const struct drm_plane_state *state)
		const struct drm_plane_state *state,
		struct drm_crtc_state *cstate)
{
	struct drm_crtc_state *cstate;
	struct sde_plane_state *pstate;
	struct sde_plane_rot_state *rstate;
	struct sde_hw_blk *hw_blk;

	if (!plane || !state) {
		SDE_ERROR("invalid plane/state\n");
	if (!plane || !state || !cstate) {
		SDE_ERROR("invalid parameters\n");
		return -EINVAL;
	}

	pstate = to_sde_plane_state(state);
	rstate = &pstate->rot;

	/* cstate will be null if crtc is disconnected from plane */
	cstate = _sde_plane_get_crtc_state((struct drm_plane_state *)state);
	if (IS_ERR_OR_NULL(cstate)) {
		SDE_ERROR("invalid crtc state\n");
		return -EINVAL;
	}

	if (sde_plane_enabled((struct drm_plane_state *)state) &&
			rstate->out_sbuf) {
	if (sde_plane_enabled(state) && rstate->out_sbuf) {
		SDE_DEBUG("plane%d.%d acquire rotator, fb %d\n",
				plane->base.id, rstate->sequence_id,
				state->fb ? state->fb->base.id : -1);
@@ -3005,7 +2997,15 @@ int sde_plane_confirm_hw_rsvps(struct drm_plane *plane,
					SDE_EVTLOG_ERROR);
			return -EINVAL;
		}

		_sde_plane_rot_get_fb(plane, cstate, rstate);

		SDE_EVT32(DRMID(plane), rstate->sequence_id,
				state->fb ? state->fb->base.id : -1,
				rstate->out_fb ? rstate->out_fb->base.id : -1,
				hw_blk->id);
	}

	return 0;
}

+3 −1
Original line number Diff line number Diff line
@@ -204,10 +204,12 @@ bool is_sde_plane_virtual(struct drm_plane *plane);
 * sde_plane_confirm_hw_rsvps - reserve an sbuf resource, if needed
 * @plane: Pointer to DRM plane object
 * @state: Pointer to plane state
 * @cstate: Pointer to crtc state containing the resource pool
 * Returns: Zero on success
 */
int sde_plane_confirm_hw_rsvps(struct drm_plane *plane,
		const struct drm_plane_state *state);
		const struct drm_plane_state *state,
		struct drm_crtc_state *cstate);

/**
 * sde_plane_get_ctl_flush - get control flush mask