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

Commit 69df853d authored by Lynus Vaz's avatar Lynus Vaz Committed by Rakesh Naidu Bhaviripudi
Browse files

msm: kgsl: Keep the timeline fence valid for logging



The timeline fence needs to remain valid for logging purposes. Take an
extra refcount on the timeline dma_fence to make sure it doesn't go
away till we're done with it.

Change-Id: I6670ef7add099a72684c1fe20ed009dff85d1f27
Signed-off-by: default avatarLynus Vaz <quic_lvaz@quicinc.com>
parent 1e664b6f
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
 */

/*
@@ -508,6 +508,8 @@ static int drawobj_add_sync_timeline(struct kgsl_device *device,
	/* Set pending flag before adding callback to avoid race */
	set_bit(event->id, &syncobj->pending);

	/* Get a dma_fence refcount to hand over to the callback */
	dma_fence_get(event->fence);
	ret = dma_fence_add_callback(event->fence,
		&event->cb, drawobj_sync_timeline_fence_callback);

@@ -520,10 +522,15 @@ static int drawobj_add_sync_timeline(struct kgsl_device *device,
			ret = 0;
		}

		/* Put the refcount from fence creation */
		dma_fence_put(event->fence);
		kgsl_drawobj_put(drawobj);
		return ret;
	}

	return ret;
	/* Put the refcount from fence creation */
	dma_fence_put(event->fence);
	return 0;
}

static int drawobj_add_sync_fence(struct kgsl_device *device,