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

Commit 47546cab authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dma-buf/sync_file: Allow multiple sync_files to wrap a single dma-fence"

parents 2431c5d6 ad597759
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ static void sync_file_free(struct kref *kref)
	struct sync_file *sync_file = container_of(kref, struct sync_file,
						     kref);

	if (test_bit(POLL_ENABLED, &sync_file->fence->flags))
	if (test_bit(POLL_ENABLED, &sync_file->flags))
		fence_remove_callback(sync_file->fence, &sync_file->cb);
	fence_put(sync_file->fence);
	kfree(sync_file);
@@ -305,7 +305,7 @@ static unsigned int sync_file_poll(struct file *file, poll_table *wait)

	poll_wait(file, &sync_file->wq, wait);

	if (!test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) {
	if (!test_and_set_bit(POLL_ENABLED, &sync_file->flags)) {
		if (fence_add_callback(sync_file->fence, &sync_file->cb,
					   fence_check_cb_func) < 0)
			wake_up_all(&sync_file->wq);
+2 −1
Original line number Diff line number Diff line
@@ -43,9 +43,10 @@ struct sync_file {

	struct fence		*fence;
	struct fence_cb cb;
	unsigned long flags;
};

#define POLL_ENABLED FENCE_FLAG_USER_BITS
#define POLL_ENABLED 0

struct sync_file *sync_file_create(struct fence *fence);
struct fence *sync_file_get_fence(int fd);