| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. |
|---|
| 2 | | - * |
|---|
| 3 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 4 | | - * it under the terms of the GNU General Public License version 2 and |
|---|
| 5 | | - * only version 2 as published by the Free Software Foundation. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 8 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 9 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 10 | | - * GNU General Public License for more details. |
|---|
| 11 | 3 | */ |
|---|
| 12 | 4 | |
|---|
| 13 | 5 | #ifndef _DPU_CORE_PERF_H_ |
|---|
| .. | .. |
|---|
| 19 | 11 | #include <drm/drm_crtc.h> |
|---|
| 20 | 12 | |
|---|
| 21 | 13 | #include "dpu_hw_catalog.h" |
|---|
| 22 | | -#include "dpu_power_handle.h" |
|---|
| 23 | 14 | |
|---|
| 24 | 15 | #define DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE 412500000 |
|---|
| 16 | + |
|---|
| 17 | +/** |
|---|
| 18 | + * enum dpu_core_perf_data_bus_id - data bus identifier |
|---|
| 19 | + * @DPU_CORE_PERF_DATA_BUS_ID_MNOC: DPU/MNOC data bus |
|---|
| 20 | + * @DPU_CORE_PERF_DATA_BUS_ID_LLCC: MNOC/LLCC data bus |
|---|
| 21 | + * @DPU_CORE_PERF_DATA_BUS_ID_EBI: LLCC/EBI data bus |
|---|
| 22 | + */ |
|---|
| 23 | +enum dpu_core_perf_data_bus_id { |
|---|
| 24 | + DPU_CORE_PERF_DATA_BUS_ID_MNOC, |
|---|
| 25 | + DPU_CORE_PERF_DATA_BUS_ID_LLCC, |
|---|
| 26 | + DPU_CORE_PERF_DATA_BUS_ID_EBI, |
|---|
| 27 | + DPU_CORE_PERF_DATA_BUS_ID_MAX, |
|---|
| 28 | +}; |
|---|
| 25 | 29 | |
|---|
| 26 | 30 | /** |
|---|
| 27 | 31 | * struct dpu_core_perf_params - definition of performance parameters |
|---|
| .. | .. |
|---|
| 30 | 34 | * @core_clk_rate: core clock rate request |
|---|
| 31 | 35 | */ |
|---|
| 32 | 36 | struct dpu_core_perf_params { |
|---|
| 33 | | - u64 max_per_pipe_ib[DPU_POWER_HANDLE_DBUS_ID_MAX]; |
|---|
| 34 | | - u64 bw_ctl[DPU_POWER_HANDLE_DBUS_ID_MAX]; |
|---|
| 37 | + u64 max_per_pipe_ib; |
|---|
| 38 | + u64 bw_ctl; |
|---|
| 35 | 39 | u64 core_clk_rate; |
|---|
| 36 | 40 | }; |
|---|
| 37 | 41 | |
|---|
| .. | .. |
|---|
| 52 | 56 | * @dev: Pointer to drm device |
|---|
| 53 | 57 | * @debugfs_root: top level debug folder |
|---|
| 54 | 58 | * @catalog: Pointer to catalog configuration |
|---|
| 55 | | - * @phandle: Pointer to power handler |
|---|
| 56 | 59 | * @core_clk: Pointer to core clock structure |
|---|
| 57 | 60 | * @core_clk_rate: current core clock rate |
|---|
| 58 | 61 | * @max_core_clk_rate: maximum allowable core clock rate |
|---|
| .. | .. |
|---|
| 66 | 69 | struct drm_device *dev; |
|---|
| 67 | 70 | struct dentry *debugfs_root; |
|---|
| 68 | 71 | struct dpu_mdss_cfg *catalog; |
|---|
| 69 | | - struct dpu_power_handle *phandle; |
|---|
| 70 | 72 | struct dss_clk *core_clk; |
|---|
| 71 | 73 | u64 core_clk_rate; |
|---|
| 72 | 74 | u64 max_core_clk_rate; |
|---|
| .. | .. |
|---|
| 113 | 115 | * @perf: Pointer to core performance context |
|---|
| 114 | 116 | * @dev: Pointer to drm device |
|---|
| 115 | 117 | * @catalog: Pointer to catalog |
|---|
| 116 | | - * @phandle: Pointer to power handle |
|---|
| 117 | 118 | * @core_clk: pointer to core clock |
|---|
| 118 | 119 | */ |
|---|
| 119 | 120 | int dpu_core_perf_init(struct dpu_core_perf *perf, |
|---|
| 120 | 121 | struct drm_device *dev, |
|---|
| 121 | 122 | struct dpu_mdss_cfg *catalog, |
|---|
| 122 | | - struct dpu_power_handle *phandle, |
|---|
| 123 | 123 | struct dss_clk *core_clk); |
|---|
| 124 | + |
|---|
| 125 | +struct dpu_kms; |
|---|
| 124 | 126 | |
|---|
| 125 | 127 | /** |
|---|
| 126 | 128 | * dpu_core_perf_debugfs_init - initialize debugfs for core performance context |
|---|
| 127 | | - * @perf: Pointer to core performance context |
|---|
| 129 | + * @dpu_kms: Pointer to the dpu_kms struct |
|---|
| 128 | 130 | * @debugfs_parent: Pointer to parent debugfs |
|---|
| 129 | 131 | */ |
|---|
| 130 | | -int dpu_core_perf_debugfs_init(struct dpu_core_perf *perf, |
|---|
| 131 | | - struct dentry *parent); |
|---|
| 132 | +int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent); |
|---|
| 132 | 133 | |
|---|
| 133 | 134 | #endif /* _DPU_CORE_PERF_H_ */ |
|---|