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

Commit b1976689 authored by Sushmita Susheelendra's avatar Sushmita Susheelendra Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Add sysfs node to enable/disable GPU LLC slice



The change will take effect upon the next GPU
wake-up.

CRs-Fixed: 1081617
Change-Id: I0d15c70737ad312ffa2b327ba293ed85819d3cb3
Signed-off-by: default avatarSushmita Susheelendra <ssusheel@codeaurora.org>
parent 7f66cf70
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ static struct adreno_device device_3d0 = {
	.profile.enabled = false,
	.active_list = LIST_HEAD_INIT(device_3d0.active_list),
	.active_list_lock = __SPIN_LOCK_UNLOCKED(device_3d0.active_list_lock),
	.gpu_llc_slice_enable = true,
};

/* Ptr to array for the current set of fault detect registers */
+2 −0
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ struct adreno_gpu_core {
 * @active_list: List to track active contexts
 * @active_list_lock: Lock to protect active_list
 * @gpu_llc_slice: GPU system cache slice descriptor
 * @gpu_llc_slice_enable: To enable the GPU system cache slice or not
 */
struct adreno_device {
	struct kgsl_device dev;    /* Must be first field in this struct */
@@ -457,6 +458,7 @@ struct adreno_device {
	spinlock_t active_list_lock;

	void *gpu_llc_slice;
	bool gpu_llc_slice_enable;
};

/**
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ static inline void adreno_llc_setup(struct kgsl_device *device)
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev);

	if (adreno_dev->gpu_llc_slice)
	if (adreno_dev->gpu_llc_slice && adreno_dev->gpu_llc_slice_enable)
		if (!llcc_slice_activate(adreno_dev->gpu_llc_slice)) {
			if (gpudev->llc_configure_gpu_scid)
				gpudev->llc_configure_gpu_scid(adreno_dev);
+14 −0
Original line number Diff line number Diff line
@@ -77,6 +77,18 @@ static unsigned int _ft_pagefault_policy_show(struct adreno_device *adreno_dev)
	return adreno_dev->ft_pf_policy;
}

static int _gpu_llc_slice_enable_store(struct adreno_device *adreno_dev,
		unsigned int val)
{
	adreno_dev->gpu_llc_slice_enable = val ? true : false;
	return 0;
}

static unsigned int _gpu_llc_slice_enable_show(struct adreno_device *adreno_dev)
{
	return adreno_dev->gpu_llc_slice_enable;
}

static int _ft_long_ib_detect_store(struct adreno_device *adreno_dev,
		unsigned int val)
{
@@ -290,6 +302,7 @@ static ADRENO_SYSFS_U32(ft_policy);
static ADRENO_SYSFS_U32(ft_pagefault_policy);
static ADRENO_SYSFS_BOOL(ft_long_ib_detect);
static ADRENO_SYSFS_BOOL(ft_hang_intr_status);
static ADRENO_SYSFS_BOOL(gpu_llc_slice_enable);

static DEVICE_INT_ATTR(wake_nice, 0644, adreno_wake_nice);
static DEVICE_INT_ATTR(wake_timeout, 0644, adreno_wake_timeout);
@@ -314,6 +327,7 @@ static const struct device_attribute *_attr_list[] = {
	&adreno_attr_preemption.attr,
	&adreno_attr_hwcg.attr,
	&adreno_attr_throttling.attr,
	&adreno_attr_gpu_llc_slice_enable.attr,
	NULL,
};