summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLoren Huang <b02279@freescale.com>2014-11-11 17:27:27 +0800
committerLoren Huang <b02279@freescale.com>2014-11-11 17:30:31 +0800
commitedb587f6ecfbf95bd38206695ae3389c768bf6f6 (patch)
tree8712d577c4b8c5acc640f1ba462ec5e6f4286651 /drivers
parent34a12aa5da73188eff1b702ec2f63bef824138c5 (diff)
MGS-271 gpu:gpu idle information can't be fetched
patch 5.0.11.p4-0039-base-CL26176-Dump-whole-process-db dropped idle sys interace. And vivante didn't fully integrate patch patch 5.0.11.p4-0039-base-CL26176-Dump-whole-process-db The fix is add back the missed code and logic. Date: Nov 10, 2014 Signed-off-by: Loren Huang <b02279@freescale.com> Acked-by: Jason Liu (cherry picked from commit dc397c3a4e150f18e68cf26350fa0aafe98d3e31)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c109
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c15
2 files changed, 70 insertions, 54 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
index 10477a1d844d..021f6338d1ef 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
@@ -1558,71 +1558,72 @@ gckKERNEL_QueryProcessDB(
Type &= gcdDATABASE_TYPE_MASK;
/* Find the database. */
- gcmkONERROR(
- gckKERNEL_FindDatabase(Kernel, ProcessID, LastProcessID, &database));
-
+ if(Type != gcvDB_IDLE)
+ {
+ gcmkONERROR(
+ gckKERNEL_FindDatabase(Kernel, ProcessID, LastProcessID, &database));
- gcmkVERIFY_OK(gckOS_AcquireMutex(Kernel->os, database->counterMutex, gcvINFINITE));
+ gcmkVERIFY_OK(gckOS_AcquireMutex(Kernel->os, database->counterMutex, gcvINFINITE));
- /* Get pointer to counters. */
- switch (Type)
- {
- case gcvDB_VIDEO_MEMORY:
- if (vidMemPool != gcvPOOL_UNKNOWN)
- {
- gckOS_MemCopy(&Info->counters,
- &database->vidMemPool[vidMemPool],
- gcmSIZEOF(database->vidMemPool[vidMemPool]));
- }
- else
+ /* Get pointer to counters. */
+ switch (Type)
{
- gckOS_MemCopy(&Info->counters,
- &database->vidMem,
- gcmSIZEOF(database->vidMem));
- }
- break;
+ case gcvDB_VIDEO_MEMORY:
+ if (vidMemPool != gcvPOOL_UNKNOWN)
+ {
+ gckOS_MemCopy(&Info->counters,
+ &database->vidMemPool[vidMemPool],
+ gcmSIZEOF(database->vidMemPool[vidMemPool]));
+ }
+ else
+ {
+ gckOS_MemCopy(&Info->counters,
+ &database->vidMem,
+ gcmSIZEOF(database->vidMem));
+ }
+ break;
- case gcvDB_NON_PAGED:
- gckOS_MemCopy(&Info->counters,
- &database->nonPaged,
- gcmSIZEOF(database->vidMem));
- break;
+ case gcvDB_NON_PAGED:
+ gckOS_MemCopy(&Info->counters,
+ &database->nonPaged,
+ gcmSIZEOF(database->vidMem));
+ break;
- case gcvDB_CONTIGUOUS:
- gckOS_MemCopy(&Info->counters,
- &database->contiguous,
- gcmSIZEOF(database->vidMem));
- break;
+ case gcvDB_CONTIGUOUS:
+ gckOS_MemCopy(&Info->counters,
+ &database->contiguous,
+ gcmSIZEOF(database->vidMem));
+ break;
- case gcvDB_IDLE:
- Info->time = Kernel->db->idleTime;
- Kernel->db->idleTime = 0;
- break;
+ case gcvDB_MAP_MEMORY:
+ gckOS_MemCopy(&Info->counters,
+ &database->mapMemory,
+ gcmSIZEOF(database->mapMemory));
+ break;
- case gcvDB_MAP_MEMORY:
- gckOS_MemCopy(&Info->counters,
- &database->mapMemory,
- gcmSIZEOF(database->mapMemory));
- break;
+ case gcvDB_MAP_USER_MEMORY:
+ gckOS_MemCopy(&Info->counters,
+ &database->mapUserMemory,
+ gcmSIZEOF(database->mapUserMemory));
+ break;
- case gcvDB_MAP_USER_MEMORY:
- gckOS_MemCopy(&Info->counters,
- &database->mapUserMemory,
- gcmSIZEOF(database->mapUserMemory));
- break;
+ case gcvDB_COMMAND_BUFFER:
+ gckOS_MemCopy(&Info->counters,
+ &database->virtualCommandBuffer,
+ gcmSIZEOF(database->virtualCommandBuffer));
+ break;
- case gcvDB_COMMAND_BUFFER:
- gckOS_MemCopy(&Info->counters,
- &database->virtualCommandBuffer,
- gcmSIZEOF(database->virtualCommandBuffer));
- break;
+ default:
+ break;
+ }
- default:
- break;
+ gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, database->counterMutex));
+ }
+ else
+ {
+ Info->time = Kernel->db->idleTime;
+ Kernel->db->idleTime = 0;
}
-
- gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, database->counterMutex));
-
/* Success. */
gcmkFOOTER_NO();
return gcvSTATUS_OK;
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
index 7addd63f503c..ccec82f282bc 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
@@ -365,11 +365,26 @@ gc_version_show(struct seq_file *m, void *data)
return 0 ;
}
+int gc_idle_show(struct seq_file* m, void* data)
+{
+ gcsINFO_NODE *node = m->private;
+ gckGALDEVICE device = node->device;
+ gckKERNEL kernel = _GetValidKernel(device);
+ gcuDATABASE_INFO info;
+
+ gckKERNEL_QueryProcessDB(kernel, 0, gcvFALSE, gcvDB_IDLE, &info);
+
+ seq_printf(m, "GPU idle time since last query: %llu ns\n", info.time);
+
+ return 0;
+}
+
static gcsINFO InfoList[] =
{
{"info", gc_info_show},
{"clients", gc_clients_show},
{"meminfo", gc_meminfo_show},
+ {"idle", gc_idle_show},
{"database", gc_db_show},
{"version", gc_version_show},
};