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

Commit cf42ee08 authored by Alan Kwong's avatar Alan Kwong Committed by Narendra Muppalla
Browse files

drm/msm/sde: remove redundant vblank request and notification



Vblank is requested twice in sde, once in sde_wait_for_commit_done
and another one in request_pending for each commit cycle. Only one
is required; hence, remove request_pending and associated logics.

Change-Id: I1ca69921abd5f7ab74b8f8900aee52e22efbe350
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 05ec9073
Loading
Loading
Loading
Loading
+4 −36
Original line number Diff line number Diff line
@@ -352,22 +352,11 @@ static void sde_crtc_vblank_cb(void *data)
	struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
	struct sde_kms *sde_kms = get_kms(crtc);
	struct drm_device *dev = sde_kms->dev;
	unsigned int pending;

	pending = atomic_xchg(&sde_crtc->pending, 0);

	if (pending & PENDING_FLIP) {
		complete_flip(crtc, NULL);
		/* free ref count paired with the atomic_flush */
		drm_crtc_vblank_put(crtc);
	}

	if (atomic_read(&sde_crtc->drm_requested_vblank)) {
	drm_handle_vblank(dev, sde_crtc->drm_crtc_id);
	DBG_IRQ("");
	MSM_EVT(crtc->dev, crtc->base.id, 0);
}
}

void sde_crtc_complete_commit(struct drm_crtc *crtc)
{
@@ -567,17 +556,6 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc,
	 */
}

static void request_pending(struct drm_crtc *crtc, u32 pending)
{
	struct sde_crtc *sde_crtc = to_sde_crtc(crtc);

	atomic_or(pending, &sde_crtc->pending);

	/* ref count the vblank event and interrupts over the atomic commit */
	if (drm_crtc_vblank_get(crtc))
		return;
}

static void sde_crtc_atomic_flush(struct drm_crtc *crtc,
		struct drm_crtc_state *old_crtc_state)
{
@@ -624,8 +602,6 @@ static void sde_crtc_atomic_flush(struct drm_crtc *crtc,
	drm_atomic_crtc_for_each_plane(plane, crtc)
		sde_plane_flush(plane);

	request_pending(crtc, PENDING_FLIP);

	/* Kickoff will be scheduled by outer layer */
}

@@ -900,7 +876,6 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc,

int sde_crtc_vblank(struct drm_crtc *crtc, bool en)
{
	struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
	struct drm_encoder *encoder;
	struct drm_device *dev = crtc->dev;

@@ -909,13 +884,7 @@ int sde_crtc_vblank(struct drm_crtc *crtc, bool en)
	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
		if (encoder->crtc != crtc)
			continue;
		/*
		 * Mark that framework requested vblank,
		 * as opposed to enabling vblank only for our internal purposes
		 * Currently this variable isn't required, but may be useful for
		 * future features
		 */
		atomic_set(&sde_crtc->drm_requested_vblank, en);

		MSM_EVT(crtc->dev, crtc->base.id, en);

		if (en)
@@ -1191,7 +1160,6 @@ struct drm_crtc *sde_crtc_init(struct drm_device *dev,
	crtc->dev = dev;

	sde_crtc->drm_crtc_id = drm_crtc_id;
	atomic_set(&sde_crtc->drm_requested_vblank, 0);

	drm_crtc_init_with_planes(dev, crtc, plane, NULL, &sde_crtc_funcs);

+0 −2
Original line number Diff line number Diff line
@@ -77,9 +77,7 @@ struct sde_crtc {

	/*if there is a pending flip, these will be non-null */
	struct drm_pending_vblank_event *event;
	atomic_t pending;
	u32 vsync_count;
	atomic_t drm_requested_vblank;

	struct msm_property_info property_info;
	struct msm_property_data property_data[CRTC_PROP_COUNT];