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

Commit 00f0fa29 authored by Urvashi Agrawal's avatar Urvashi Agrawal Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Add debugfs node for cooperative reset



Add a knob to turn off the cooperative reset handshake between
the GMU and KGSL.

Change-Id: Ia3968881f0d5ed16ae6de5a75a2aa462e5d9dd57
Signed-off-by: default avatarUrvashi Agrawal <urvaagra@codeaurora.org>
parent 7bb42e6a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1712,6 +1712,9 @@ static int adreno_init(struct kgsl_device *device)
	adreno_perfcounter_init(adreno_dev);
	adreno_fault_detect_init(adreno_dev);

	adreno_dev->cooperative_reset = ADRENO_FEATURE(adreno_dev,
							ADRENO_COOP_RESET);

	/* Power down the device */
	if (ADRENO_GPUREV(adreno_dev) < 600)
		kgsl_pwrctrl_change_state(device, KGSL_STATE_SLUMBER);
+3 −0
Original line number Diff line number Diff line
@@ -404,6 +404,8 @@ enum gpu_coresight_sources {
 * @ft_policy: Defines the fault tolerance policy
 * @long_ib_detect: Long IB detection availability
 * @ft_pf_policy: Defines the fault policy for page faults
 * @cooperative_reset: Indicates if graceful death handshake is enabled
 * between GMU and GPU
 * @profile: Container for adreno profiler information
 * @dispatcher: Container for adreno GPU dispatcher
 * @pwron_fixup: Command buffer to run a post-power collapse shader workaround
@@ -481,6 +483,7 @@ struct adreno_device {
	unsigned long ft_policy;
	unsigned int long_ib_detect;
	unsigned long ft_pf_policy;
	bool cooperative_reset;
	struct adreno_profile profile;
	struct adreno_dispatcher dispatcher;
	struct kgsl_memdesc pwron_fixup;
+28 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <linux/msm_kgsl.h>

#include "adreno.h"
extern struct dentry *kgsl_debugfs_dir;

static int _isdb_set(void *data, u64 val)
{
@@ -110,6 +111,27 @@ static int _active_count_get(void *data, u64 *val)

DEFINE_DEBUGFS_ATTRIBUTE(_active_count_fops, _active_count_get, NULL, "%llu\n");

static int _coop_reset_set(void *data, u64 val)
{
	struct kgsl_device *device = data;
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);

	if (ADRENO_FEATURE(adreno_dev, ADRENO_COOP_RESET))
		adreno_dev->cooperative_reset = val ? true : false;
	return 0;
}

static int _coop_reset_get(void *data, u64 *val)
{
	struct kgsl_device *device = data;
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);

	*val = (u64) adreno_dev->cooperative_reset;
	return 0;
}
DEFINE_DEBUGFS_ATTRIBUTE(_coop_reset_fops, _coop_reset_get,
				_coop_reset_set, "%llu\n");

typedef void (*reg_read_init_t)(struct kgsl_device *device);
typedef void (*reg_read_fill_t)(struct kgsl_device *device, int i,
	unsigned int *vals, int linec);
@@ -362,6 +384,7 @@ adreno_context_debugfs_init(struct adreno_device *adreno_dev,
void adreno_debugfs_init(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct dentry *snapshot_dir;

	if (IS_ERR_OR_NULL(device->d_debugfs))
		return;
@@ -370,6 +393,11 @@ void adreno_debugfs_init(struct adreno_device *adreno_dev)
			    &_active_count_fops);
	adreno_dev->ctx_d_debugfs = debugfs_create_dir("ctx",
							device->d_debugfs);
	snapshot_dir = debugfs_lookup("snapshot", kgsl_debugfs_dir);

	if (!IS_ERR_OR_NULL(snapshot_dir))
		debugfs_create_file("coop_reset", 0644, snapshot_dir, device,
					&_coop_reset_fops);

	if (ADRENO_FEATURE(adreno_dev, ADRENO_LM)) {
		debugfs_create_file("lm_limit", 0644, device->d_debugfs, device,
+1 −2
Original line number Diff line number Diff line
@@ -2163,8 +2163,7 @@ static int dispatcher_do_fault(struct adreno_device *adreno_dev)
			ADRENO_REG_CP_IB1_BASE_HI, &base);

	if (!test_bit(KGSL_FT_PAGEFAULT_GPUHALT_ENABLE,
		&adreno_dev->ft_pf_policy) &&
		ADRENO_FEATURE(ADRENO_DEVICE(device), ADRENO_COOP_RESET))
		&adreno_dev->ft_pf_policy) && adreno_dev->cooperative_reset)
		gmu_core_dev_cooperative_reset(device);

	do_header_and_snapshot(device, fault, hung_rb, cmdobj);