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

Commit 9746de41 authored by Jordan Crouse's avatar Jordan Crouse Committed by Sharat Masetty
Browse files

drm/msm: Add devfreq support



Try to initialize and use the 'simple_ondemand' devfreq governor.
If all the stars align the governor will poll every 10ms to
determine how busy the GPU is and adjust the frequency accordingly.

Change-Id: Ic0dedbad16d0733cbfd5b268fc14fa064192d864
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: default avatarVenkateswara Rao Tadikonda <vtadik@codeaurora.org>
Signed-off-by: default avatarSharat Masetty <smasetty@codeaurora.org>
parent c97c16c7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
 * Copyright (c) 2014 The Linux Foundation. All rights reserved.
 * Copyright (c) 2014,2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
@@ -483,8 +483,6 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
	adreno_gpu = &a3xx_gpu->base;
	gpu = &adreno_gpu->base;

	a3xx_gpu->pdev = pdev;

	gpu->perfcntrs = perfcntrs;
	gpu->num_perfcntrs = ARRAY_SIZE(perfcntrs);

+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
 * Copyright (c) 2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
@@ -28,7 +30,6 @@

struct a3xx_gpu {
	struct adreno_gpu base;
	struct platform_device *pdev;

	/* if OCMEM is used for GMEM: */
	uint32_t ocmem_base;
+1 −3
Original line number Diff line number Diff line
/* Copyright (c) 2014 The Linux Foundation. All rights reserved.
/* Copyright (c) 2014,2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -560,8 +560,6 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev)
	adreno_gpu = &a4xx_gpu->base;
	gpu = &adreno_gpu->base;

	a4xx_gpu->pdev = pdev;

	gpu->perfcntrs = NULL;
	gpu->num_perfcntrs = 0;

+1 −2
Original line number Diff line number Diff line
/* Copyright (c) 2014 The Linux Foundation. All rights reserved.
/* Copyright (c) 2014,2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -23,7 +23,6 @@

struct a4xx_gpu {
	struct adreno_gpu base;
	struct platform_device *pdev;

	/* if OCMEM is used for GMEM: */
	uint32_t ocmem_base;
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017 The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -225,7 +225,7 @@ static void a5xx_counter_enable_alwayson_power(struct msm_gpu *gpu,
static u64 a5xx_counter_read(struct msm_gpu *gpu,
		struct adreno_counter_group *group, int counterid)
{
	if (counterid >= group->nr_counters)
	if (counterid < 0 || counterid >= group->nr_counters)
		return 0;

	return gpu_read64(gpu, group->counters[counterid].lo,
Loading