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

Commit 055a6e49 authored by Bharathraj Nagaraju's avatar Bharathraj Nagaraju Committed by Gerrit - the friendly Code Review server
Browse files

drm: Add GPU performance counter for DRM driver.



Ported performance counter changes from KGSL driver.
we can read all the GPU perf counter values in DRM based
GPU driver.

Change-Id: I4810de3b7232cbf5069645d8ff504d258c9eaa01
Signed-off-by: default avatarKiran Sunilrao Khatke <c-kkhatk@codeaurora.org>
Signed-off-by: default avatarBharathraj Nagaraju <snbraj@codeaurora.org>
parent c77f6d53
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -64,7 +64,8 @@ msm-y := \
ifneq ($(CONFIG_QCOM_KGSL),y)
msm-y += adreno/adreno_device.o \
	adreno/adreno_gpu.o \
	adreno/a5xx_gpu.o
	adreno/a5xx_gpu.o \
	adreno/adreno_perfcounter.o
endif

msm-$(CONFIG_DRM_MSM_HDCP) += hdmi/hdmi_hdcp.o
+434 −1

File changed.

Preview size limit exceeded, changes collapsed.

+40 −1
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,2017 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
@@ -383,6 +383,8 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
		return ret;
	}

	adreno_perfcounter_start(adreno_gpu);

	return 0;
}

@@ -401,3 +403,40 @@ void adreno_gpu_cleanup(struct adreno_gpu *gpu)
		msm_gem_free_object(gpu->pfp_bo);
	msm_gpu_cleanup(&gpu->base);
}

int adreno_perfcounter_read(struct msm_gpu *gpu,
	struct drm_perfcounter_read_group __user *reads, unsigned int count)
{
	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);

	return adreno_perfcounter_read_group(adreno_gpu, reads, count);
}

int adreno_perfcounter_query(struct msm_gpu *gpu, unsigned int groupid,
	unsigned int __user *countables, unsigned int count,
		unsigned int *max_counters)
{
	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);

	return adreno_perfcounter_query_group(adreno_gpu, groupid,
		&countables, count, &max_counters);
}

int adreno_perfcounter_msm_get(struct msm_gpu *gpu, unsigned int groupid,
	unsigned int countable, unsigned int *offset, unsigned int *offset_hi,
		unsigned int flags)
{
	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);

	return adreno_perfcounter_get(adreno_gpu, groupid, countable,
		&offset, &offset_hi, flags);
}

int adreno_perfcounter_msm_put(struct msm_gpu *gpu, unsigned int groupid,
	unsigned int countable, unsigned int flags)
{
	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);

	return adreno_perfcounter_put(adreno_gpu, groupid,
		countable, flags);
}
+14 −2

File changed.

Preview size limit exceeded, changes collapsed.

+768 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading