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

Commit dc674586 authored by Lynus Vaz's avatar Lynus Vaz 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>
parent afe20da3
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */
 */


/*
/*
@@ -253,7 +254,7 @@ static void drawobj_sync_func(struct kgsl_device *device,
	kgsl_drawobj_put(&event->syncobj->base);
	kgsl_drawobj_put(&event->syncobj->base);
}
}


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 *event = container_of(work,
		struct kgsl_drawobj_sync_event, work);
		struct kgsl_drawobj_sync_event, work);
@@ -301,7 +302,7 @@ static void drawobj_sync_timeline_fence_callback(struct dma_fence *f,
	 * removing the fence
	 * removing the fence
	 */
	 */
	if (drawobj_sync_expire(event->device, event))
	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)
static void syncobj_destroy(struct kgsl_drawobj *drawobj)
@@ -498,7 +499,7 @@ static int drawobj_add_sync_timeline(struct kgsl_device *device,
	event->device = device;
	event->device = device;
	event->context = NULL;
	event->context = NULL;
	event->fence = fence;
	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);
	INIT_LIST_HEAD(&event->cb.node);


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


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


#define KGSL_DRAWOBJ_FLAGS \
#define KGSL_DRAWOBJ_FLAGS \