gpu: host1x: Add actmon registration interface

Provide the actmon registration interface for host1x clients. The
registration process will create the debugfs for the actmon associated
with the host1x client, and initialize the actmon registers.

Bug 3788919

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I313bf52a5eda1663e26c2579788a873ca4081459
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2886696
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Johnny Liu
2023-04-12 09:20:00 +00:00
committed by mobile promotions
parent d99906cfaa
commit fa8cf02e87
7 changed files with 559 additions and 4 deletions

View File

@@ -0,0 +1,45 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Tegra host1x Actmon
*
* Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/
#ifndef HOST1X_ACTMON_H
#define HOST1X_ACTMON_H
#include <linux/device.h>
#include <linux/types.h>
enum host1x_actmon_module_type {
HOST1X_ACTMON_MODULE_ACTIVE,
HOST1X_ACTMON_MODULE_STALL,
};
struct host1x_actmon;
struct host1x_actmon_module {
enum host1x_actmon_module_type type;
u32 k;
u32 consec_upper_num;
u32 consec_lower_num;
void __iomem *regs;
struct host1x_actmon *actmon;
struct dentry *debugfs;
};
struct host1x_client;
struct host1x_actmon {
char *name;
unsigned int irq;
unsigned int num_modules;
unsigned long rate;
u32 usecs_per_sample;
void __iomem *regs;
struct host1x_client *client;
struct host1x_actmon_module modules[8];
struct dentry *debugfs;
};
#endif