summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164/saa7164-core.c
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2010-07-31 16:18:35 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 07:55:14 -0200
commit1247ff5c0acb0fb50b076e390bb770acc95d1d7e (patch)
tree8b59af2d7df57c5675de0d103b22a667c1a951c8 /drivers/media/video/saa7164/saa7164-core.c
parent0b62ceb03545099f0ab43a787cef5307b34b2fe4 (diff)
downloadop-kernel-dev-1247ff5c0acb0fb50b076e390bb770acc95d1d7e.zip
op-kernel-dev-1247ff5c0acb0fb50b076e390bb770acc95d1d7e.tar.gz
[media] saa7164: monitor the RISC cpu load via a thread
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164/saa7164-core.c')
-rw-r--r--drivers/media/video/saa7164/saa7164-core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c
index db4b39c..5913ed7 100644
--- a/drivers/media/video/saa7164/saa7164-core.c
+++ b/drivers/media/video/saa7164/saa7164-core.c
@@ -1191,6 +1191,8 @@ static int saa7164_proc_create(void)
static int saa7164_thread_function(void *data)
{
struct saa7164_dev *dev = data;
+ tmFwInfoStruct_t fwinfo;
+ u64 last_poll_time = 0;
dprintk(DBGLVL_THR, "thread started\n");
@@ -1205,8 +1207,16 @@ static int saa7164_thread_function(void *data)
dprintk(DBGLVL_THR, "thread running\n");
/* Dump the firmware debug message to console */
+ /* Polling this costs us 1-2% of the arm CPU */
+ /* convert this into a respnde to interrupt 0x7a */
saa7164_api_collect_debug(dev);
+ /* Monitor CPU load every 1 second */
+ if ((last_poll_time + 1000 /* ms */) < jiffies_to_msecs(jiffies)) {
+ saa7164_api_get_load_info(dev, &fwinfo);
+ last_poll_time = jiffies_to_msecs(jiffies);
+ }
+
}
dprintk(DBGLVL_THR, "thread exiting\n");
OpenPOWER on IntegriCloud