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

Commit b738bdb9 authored by SIVA MULLATI's avatar SIVA MULLATI Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Defer drawobj_sync_timeline_fence_work() to a workqueue



drawobj_sync_timeline_fence_work() does a cleanup of fence and syncobj
allocations. Doing this cleanup in irq context requires the irq_work
struct to remain valid after the function executes. Avoid this constraint
by deferring this work to the memory workqueue.

Change-Id: Icf648a61686c1ef3fd84467a2376b11a9a4bb803
Signed-off-by: default avatarLynus Vaz <quic_lvaz@quicinc.com>
Signed-off-by: default avatarSIVA MULLATI <quic_smullati@quicinc.com>
parent 6c9b53fe
Loading
Loading
Loading
Loading
+4 −4
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 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
 */

/*
@@ -283,7 +283,7 @@ static void drawobj_destroy_sparse(struct kgsl_drawobj *drawobj)
	}
}

static void drawobj_sync_timeline_fence_work(struct irq_work *work)
static void drawobj_sync_timeline_fence_work(struct work_struct *work)
{
	struct kgsl_drawobj_sync_event *event = container_of(work,
		struct kgsl_drawobj_sync_event, work);
@@ -303,7 +303,7 @@ static void drawobj_sync_timeline_fence_callback(struct dma_fence *f,
	 * removing the fence
	 */
	if (drawobj_sync_expire(event->device, event))
		irq_work_queue(&event->work);
		queue_work(kgsl_driver.mem_workqueue, &event->work);
}

static void syncobj_destroy(struct kgsl_drawobj *drawobj)
@@ -497,7 +497,7 @@ static int drawobj_add_sync_timeline(struct kgsl_device *device,
	event->device = device;
	event->context = NULL;
	event->fence = fence;
	init_irq_work(&event->work, drawobj_sync_timeline_fence_work);
	INIT_WORK(&event->work, drawobj_sync_timeline_fence_work);

	INIT_LIST_HEAD(&event->cb.node);

+3 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2019, 2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#ifndef __KGSL_DRAWOBJ_H
@@ -169,8 +170,8 @@ struct kgsl_drawobj_sync_event {
	struct dma_fence *fence;
	/** @cb: Callback struct for KGSL_CMD_SYNCPOINT_TYPE_TIMELINE */
	struct dma_fence_cb cb;
	/** @work : irq worker for KGSL_CMD_SYNCPOINT_TYPE_TIMELINE */
	struct irq_work work;
	/** @work : work_struct for KGSL_CMD_SYNCPOINT_TYPE_TIMELINE */
	struct work_struct work;
};

/**