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

Commit 8d2eb871 authored by Yashwanth's avatar Yashwanth
Browse files

disp: msm: sde: add kickoff_in_progress flag in sde crtc



In dual display usecases, during pm suspend/resume,
commit is scheduled only on primary crtc thread. If idle
timeout value is very short such as in LP2 mode, it might
result in race condition due to idle pc off work getting
scheduled on its crtc thread. This change adds kickoff in
progress flag to handle such cases as crtc frame pending
count is only updated after rc kickoff.

Change-Id: Iebb331d914b23cc5eeadfeb2a488891e88b3202a
Signed-off-by: default avatarYashwanth <yvulapu@codeaurora.org>
parent 0b595d4f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3740,6 +3740,7 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc,

	idle_pc_state = sde_crtc_get_property(cstate, CRTC_PROP_IDLE_PC_STATE);

	sde_crtc->kickoff_in_progress = true;
	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
		if (encoder->crtc != crtc)
			continue;
@@ -3801,6 +3802,7 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc,

		sde_encoder_kickoff(encoder, false, true);
	}
	sde_crtc->kickoff_in_progress = false;

	/* store the event after frame trigger */
	if (sde_crtc->event) {
@@ -6595,6 +6597,7 @@ struct drm_crtc *sde_crtc_init(struct drm_device *dev, struct drm_plane *plane)
	atomic_set(&sde_crtc->frame_pending, 0);

	sde_crtc->enabled = false;
	sde_crtc->kickoff_in_progress = false;

	/* Below parameters are for fps calculation for sysfs node */
	sde_crtc->fps_info.fps_periodic_duration = DEFAULT_FPS_PERIOD_1_SEC;
+2 −0
Original line number Diff line number Diff line
@@ -257,6 +257,7 @@ struct sde_crtc_misr_info {
 * @ad_active     : list containing ad properties that are active
 * @crtc_lock     : crtc lock around create, destroy and access.
 * @frame_pending : Whether or not an update is pending
 * @kickoff_in_progress : boolean entry to check if kickoff is in progress
 * @frame_events  : static allocation of in-flight frame events
 * @frame_event_list : available frame event list
 * @spin_lock     : spin lock for transaction status, etc...
@@ -344,6 +345,7 @@ struct sde_crtc {
	struct list_head frame_event_list;
	spinlock_t spin_lock;
	spinlock_t fevent_spin_lock;
	bool kickoff_in_progress;

	/* for handling internal event thread */
	struct sde_crtc_event event_cache[SDE_CRTC_MAX_EVENT_COUNT];
+3 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
@@ -1916,7 +1916,8 @@ static int _sde_encoder_rc_idle(struct drm_encoder *drm_enc,
		SDE_EVT32(DRMID(drm_enc), sw_event, sde_enc->rc_state,
				SDE_EVTLOG_ERROR);
		goto end;
	} else if (sde_crtc_frame_pending(sde_enc->crtc)) {
	} else if (sde_crtc_frame_pending(sde_enc->crtc) ||
			sde_crtc->kickoff_in_progress) {
		SDE_DEBUG_ENC(sde_enc, "skip idle entry");
		SDE_EVT32(DRMID(drm_enc), sw_event, sde_enc->rc_state,
			sde_crtc_frame_pending(sde_enc->crtc),