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

drm/etnaviv: use submit exec_state for perfmon sampling

The GPU exec state may have changed at the time when the perfmon sampling
is done, as it reflects the state of the last submission, not the current
GPU execution state.

So for proper sampling we must use the submit exec_state.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

+4 -4
+1 -1
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
··· 1324 1324 const struct etnaviv_perfmon_request *pmr = submit->pmrs + i; 1325 1325 1326 1326 if (pmr->flags == flags) 1327 - etnaviv_perfmon_process(gpu, pmr); 1327 + etnaviv_perfmon_process(gpu, pmr, submit->exec_state); 1328 1328 } 1329 1329 } 1330 1330
+2 -2
drivers/gpu/drm/etnaviv/etnaviv_perfmon.c
··· 479 479 } 480 480 481 481 void etnaviv_perfmon_process(struct etnaviv_gpu *gpu, 482 - const struct etnaviv_perfmon_request *pmr) 482 + const struct etnaviv_perfmon_request *pmr, u32 exec_state) 483 483 { 484 - const struct etnaviv_pm_domain_meta *meta = &doms_meta[gpu->exec_state]; 484 + const struct etnaviv_pm_domain_meta *meta = &doms_meta[exec_state]; 485 485 const struct etnaviv_pm_domain *dom; 486 486 const struct etnaviv_pm_signal *sig; 487 487 u32 *bo = pmr->bo_vma;
+1 -1
drivers/gpu/drm/etnaviv/etnaviv_perfmon.h
··· 44 44 u32 exec_state); 45 45 46 46 void etnaviv_perfmon_process(struct etnaviv_gpu *gpu, 47 - const struct etnaviv_perfmon_request *pmr); 47 + const struct etnaviv_perfmon_request *pmr, u32 exec_state); 48 48 49 49 #endif /* __ETNAVIV_PERFMON_H__ */