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

Commit 7892968f authored by Jordan Crouse's avatar Jordan Crouse Committed by Tarun Karra
Browse files

sync: oneshot_sync: Update oneshot_sync for new sync APIs



The sync APIs have changed slightly since 3.10/3.14 and so
must oneshot_sync also change.

Change-Id: Ic0dedbad8cdee48534b24fa2688dd7979f9f3933
Signed-off-by: default avatarLokesh Batra <lbatra@codeaurora.org>
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 7aa47219
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ config MSM_KGSL
	select DEVFREQ_GOV_PERFORMANCE
	select DEVFREQ_GOV_MSM_ADRENO_TZ
	select DEVFREQ_GOV_MSM_GPUBW_MON
	select ONESHOT_SYNC if SYNC
	---help---
	  3D graphics driver. Required to use hardware accelerated
	  OpenGL ES 2.0 and 1.1.
+0 −1
Original line number Diff line number Diff line
@@ -97,7 +97,6 @@ config SW_SYNC_USER

config ONESHOT_SYNC
	bool "One shot sync objects"
	default n
	depends on SYNC
	help
	  This sync driver provides a way to create sync objects that may
+8 −7
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ struct oneshot_sync_state {
struct oneshot_sync_pt {
	struct sync_pt sync_pt;
	struct oneshot_sync_state *state;
	bool dup;
};
#define to_oneshot_pt(_p) container_of((_p), struct oneshot_sync_pt, sync_pt)

@@ -127,13 +128,15 @@ static struct sync_pt *oneshot_pt_dup(struct sync_pt *sync_pt)
	if (!kref_get_unless_zero(&pt->state->refcount))
		return NULL;

	out_pt = (struct oneshot_sync_pt *)sync_pt_create(sync_pt->parent,
							 sizeof(*out_pt));
	out_pt = (struct oneshot_sync_pt *)
		sync_pt_create(sync_pt_parent(sync_pt), sizeof(*out_pt));

	if (out_pt == NULL) {
		oneshot_state_put(pt->state);
		return NULL;
	}
	out_pt->state = pt->state;
	out_pt->dup = true;

	return &out_pt->sync_pt;
}
@@ -161,8 +164,8 @@ static void oneshot_pt_free(struct sync_pt *sync_pt)
{
	struct oneshot_sync_pt *pt = to_oneshot_pt(sync_pt);

	struct oneshot_sync_timeline *timeline =
		sync_pt->parent ? to_oneshot_timeline(sync_pt->parent) : NULL;
	struct oneshot_sync_timeline *timeline = sync_pt_parent(sync_pt) ?
		to_oneshot_timeline(sync_pt_parent(sync_pt)) : NULL;

	if (timeline != NULL) {
		spin_lock(&timeline->lock);
@@ -172,8 +175,8 @@ static void oneshot_pt_free(struct sync_pt *sync_pt)
		 * safely, so there could be a delay until the pt's
		 * state change is noticed.
		 */
		if (pt->state->orig_fence == sync_pt->fence) {

		if (pt->dup == false) {
			/*
			 * If the original pt goes away, force it signaled to
			 * avoid deadlock.
@@ -183,8 +186,6 @@ static void oneshot_pt_free(struct sync_pt *sync_pt)
						pt->state->id);
				pt->state->signaled = true;
			}
			/* clear the pointer, since it will be freed soon */
			pt->state->orig_fence = NULL;
		}
		spin_unlock(&timeline->lock);
	}