V4L/DVB (5850): ivtv: improve API command debugging
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 17 Jul 2007 09:38:43 +0000 (06:38 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 20 Jul 2007 20:35:42 +0000 (17:35 -0300)
Turn off debugging of API commands that occur during encoding or decoding,
unless they are explicitly requested.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/ivtv/ivtv-mailbox.c

index 6ae42a3b03cc824fa35b07cd9ba6e2ee60bc5936..eaa43e9e91856367a2d2949d166af45224893d33 100644 (file)
@@ -37,6 +37,7 @@
 #define API_RESULT      (1 << 1)       /* Allow 1 second for this cmd to end */
 #define API_FAST_RESULT         (3 << 1)       /* Allow 0.1 second for this cmd to end */
 #define API_DMA         (1 << 3)       /* DMA mailbox, has special handling */
+#define API_HIGH_VOL    (1 << 5)       /* High volume command (i.e. called during encoding or decoding) */
 #define API_NO_WAIT_MB          (1 << 4)       /* Command may not wait for a free mailbox */
 #define API_NO_WAIT_RES         (1 << 5)       /* Command may not wait for the result */
 
@@ -77,11 +78,11 @@ static const struct ivtv_api_info api_info[256] = {
        API_ENTRY(CX2341X_ENC_SET_DMA_BLOCK_SIZE,       API_CACHE),
        API_ENTRY(CX2341X_ENC_GET_PREV_DMA_INFO_MB_10,  API_FAST_RESULT),
        API_ENTRY(CX2341X_ENC_GET_PREV_DMA_INFO_MB_9,   API_FAST_RESULT),
-       API_ENTRY(CX2341X_ENC_SCHED_DMA_TO_HOST,        API_DMA),
+       API_ENTRY(CX2341X_ENC_SCHED_DMA_TO_HOST,        API_DMA | API_HIGH_VOL),
        API_ENTRY(CX2341X_ENC_INITIALIZE_INPUT,         API_RESULT),
        API_ENTRY(CX2341X_ENC_SET_FRAME_DROP_RATE,      API_CACHE),
        API_ENTRY(CX2341X_ENC_PAUSE_ENCODER,            API_RESULT),
-       API_ENTRY(CX2341X_ENC_REFRESH_INPUT,            API_NO_WAIT_MB),
+       API_ENTRY(CX2341X_ENC_REFRESH_INPUT,            API_NO_WAIT_MB | API_HIGH_VOL),
        API_ENTRY(CX2341X_ENC_SET_COPYRIGHT,            API_CACHE),
        API_ENTRY(CX2341X_ENC_SET_EVENT_NOTIFICATION,   API_RESULT),
        API_ENTRY(CX2341X_ENC_SET_NUM_VSYNC_LINES,      API_CACHE),
@@ -102,7 +103,7 @@ static const struct ivtv_api_info api_info[256] = {
        API_ENTRY(CX2341X_DEC_SET_DMA_BLOCK_SIZE,       API_CACHE),
        API_ENTRY(CX2341X_DEC_GET_XFER_INFO,            API_FAST_RESULT),
        API_ENTRY(CX2341X_DEC_GET_DMA_STATUS,           API_FAST_RESULT),
-       API_ENTRY(CX2341X_DEC_SCHED_DMA_FROM_HOST,      API_DMA),
+       API_ENTRY(CX2341X_DEC_SCHED_DMA_FROM_HOST,      API_DMA | API_HIGH_VOL),
        API_ENTRY(CX2341X_DEC_PAUSE_PLAYBACK,           API_RESULT),
        API_ENTRY(CX2341X_DEC_HALT_FW,                  API_FAST_RESULT),
        API_ENTRY(CX2341X_DEC_SET_STANDARD,             API_CACHE),
@@ -227,7 +228,12 @@ static int ivtv_api_call(struct ivtv *itv, int cmd, int args, u32 data[])
                return -EINVAL;
        }
 
-       IVTV_DEBUG_API("API Call: %s\n", api_info[cmd].name);
+       if (api_info[cmd].flags & API_HIGH_VOL) {
+           IVTV_DEBUG_HI_API("API Call: %s\n", api_info[cmd].name);
+       }
+       else {
+           IVTV_DEBUG_API("API Call: %s\n", api_info[cmd].name);
+       }
 
        /* clear possibly uninitialized part of data array */
        for (i = args; i < CX2341X_MBOX_MAX_DATA; i++)