diff options
author | Marius Vlad <marius-cristian.vlad@nxp.com> | 2018-06-07 16:47:34 +0300 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:32:20 +0800 |
commit | 767fc1953b6678d000a54ba0069cddc05d152c57 (patch) | |
tree | 8e3ad087b0d9216426964f996ef9d1b685a53492 /drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | |
parent | 079aa7a33d04bb73648a0e375638a23613fe7759 (diff) |
MGS-3969 [#imx-879] Fix reading HW counters values using old profiling method for GC7000
Adapted from 7a3d1096aa0cc77e258. This brings back the ability for
gputop to read HW counter values.
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c index efb015993a57..2cdc21f92930 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -2486,6 +2486,7 @@ gckKERNEL_Dispatch( } else { + gctUINT32 i; if (Interface->u.Commit.count > 1 && Interface->engine == gcvENGINE_RENDER) { gctUINT32 i; @@ -2530,7 +2531,6 @@ gckKERNEL_Dispatch( if (Interface->u.Commit.count > 1 && Interface->engine == gcvENGINE_RENDER) { - gctUINT32 i; for (i = 1; i < Interface->u.Commit.count; i++) { @@ -2567,6 +2567,23 @@ gckKERNEL_Dispatch( } } } + + for (i = 0; i < Interface->u.Commit.count; i++) { + gceHARDWARE_TYPE type = Interface->hardwareType; + gckKERNEL kernel = Device->map[type].kernels[i]; + + if ((kernel->hardware->options.gpuProfiler == gcvTRUE) && + (kernel->profileEnable == gcvTRUE)) { + gcmkONERROR(gckCOMMAND_Stall(kernel->command, gcvTRUE)); + + if (kernel->command->currContext) { + gcmkONERROR(gckHARDWARE_UpdateContextProfile( + kernel->hardware, + kernel->command->currContext)); + } + } + } + } gcmkONERROR(gckOS_ReleaseMutex(Kernel->os, Kernel->device->commitMutex)); commitMutexAcquired = gcvFALSE; |