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

Commit cfcdc956 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Do dispatcher init at first open



With eCP, we will no longer be using the dispatcher. And
we will have different first open functions depending on
whether eCP is enabled or disabled. Hence, move dispatcher
init to first open so that dispatcher is initialized only when
eCP is not enabled.

Change-Id: Ia65807dcfed65a4b810b886f71beb4c5ba30abb1
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 1affb278
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -1517,8 +1517,11 @@ static int adreno_probe(struct platform_device *pdev)
		KGSL_MEMSTORE_SIZE, 0, priv, "memstore");

	status = PTR_ERR_OR_ZERO(device->memstore);
	if (status)
		goto out;
	if (status) {
		kgsl_device_platform_remove(device);
		device->pdev = NULL;
		return status;
	}

	/* Initialize the snapshot engine */
	size = adreno_dev->gpucore->snapshot_size;
@@ -1533,10 +1536,6 @@ static int adreno_probe(struct platform_device *pdev)

	kgsl_device_snapshot_probe(device, size);

	status = adreno_dispatcher_init(adreno_dev);
	if (status)
		goto out;

	adreno_debugfs_init(adreno_dev);
	adreno_profile_init(adreno_dev);

@@ -1577,13 +1576,8 @@ static int adreno_probe(struct platform_device *pdev)
		}
	}
#endif
out:
	if (status) {
		kgsl_device_platform_remove(device);
		device->pdev = NULL;
	}

	return status;
	return 0;
}

static void _adreno_free_memories(struct adreno_device *adreno_dev)
@@ -1816,6 +1810,10 @@ static int adreno_init(struct kgsl_device *device)
	if (test_bit(ADRENO_DEVICE_INITIALIZED, &adreno_dev->priv))
		return 0;

	ret = adreno_dispatcher_init(adreno_dev);
	if (ret)
		return ret;

	ret = adreno_ringbuffer_init(adreno_dev);
	if (ret)
		return ret;
+11 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -2802,8 +2802,16 @@ int adreno_dispatcher_init(struct adreno_device *adreno_dev)
	struct adreno_dispatcher *dispatcher = &adreno_dev->dispatcher;
	int ret, i;

	if (test_bit(ADRENO_DISPATCHER_INIT, &dispatcher->priv))
		return 0;

	memset(dispatcher, 0, sizeof(*dispatcher));

	ret = kobject_init_and_add(&dispatcher->kobj, &ktype_dispatcher,
		&device->dev->kobj, "dispatch");
	if (ret)
		return ret;

	mutex_init(&dispatcher->mutex);

	timer_setup(&dispatcher->timer, adreno_dispatcher_timer, 0);
@@ -2820,10 +2828,9 @@ int adreno_dispatcher_init(struct adreno_device *adreno_dev)
	for (i = 0; i < ARRAY_SIZE(dispatcher->jobs); i++)
		init_llist_head(&dispatcher->jobs[i]);

	ret = kobject_init_and_add(&dispatcher->kobj, &ktype_dispatcher,
		&device->dev->kobj, "dispatch");
	set_bit(ADRENO_DISPATCHER_INIT, &dispatcher->priv);

	return ret;
	return 0;
}

void adreno_dispatcher_halt(struct kgsl_device *device)
+3 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2020, The Linux Foundation. All rights reserved.
 */

#ifndef ____ADRENO_DISPATCHER_H
@@ -83,7 +83,8 @@ struct adreno_dispatcher {

enum adreno_dispatcher_flags {
	ADRENO_DISPATCHER_POWER = 0,
	ADRENO_DISPATCHER_ACTIVE = 1,
	ADRENO_DISPATCHER_ACTIVE,
	ADRENO_DISPATCHER_INIT,
};

struct adreno_device;