Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/etnaviv: add performance monitor request processing

Changes v4 -> v5
- make use of doms_meta array

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

authored by

Christian Gmeiner and committed by
Lucas Stach
249300c7 c8e4a7fd

+20
+17
drivers/gpu/drm/etnaviv/etnaviv_perfmon.c
··· 16 16 */ 17 17 18 18 #include "etnaviv_gpu.h" 19 + #include "etnaviv_perfmon.h" 19 20 20 21 struct etnaviv_pm_domain; 21 22 ··· 128 127 return -EINVAL; 129 128 130 129 return 0; 130 + } 131 + 132 + void etnaviv_perfmon_process(struct etnaviv_gpu *gpu, 133 + const struct etnaviv_perfmon_request *pmr) 134 + { 135 + const struct etnaviv_pm_domain_meta *meta = &doms_meta[gpu->exec_state]; 136 + const struct etnaviv_pm_domain *dom; 137 + const struct etnaviv_pm_signal *sig; 138 + u32 *bo = pmr->bo_vma; 139 + u32 val; 140 + 141 + dom = meta->domains + pmr->domain; 142 + sig = &dom->signal[pmr->signal]; 143 + val = sig->sample(gpu, dom, sig); 144 + 145 + *(bo + pmr->offset) = val; 131 146 }
+3
drivers/gpu/drm/etnaviv/etnaviv_perfmon.h
··· 43 43 int etnaviv_pm_req_validate(const struct drm_etnaviv_gem_submit_pmr *r, 44 44 u32 exec_state); 45 45 46 + void etnaviv_perfmon_process(struct etnaviv_gpu *gpu, 47 + const struct etnaviv_perfmon_request *pmr); 48 + 46 49 #endif /* __ETNAVIV_PERFMON_H__ */