Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137717
b: refs/heads/master
c: 5029999
h: refs/heads/master
i:
  137715: 7aa85b4
v: v3
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 8f4922c commit 4af7c21
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 903bfeac50ecc7725db606c19edbbc93966772c2
refs/heads/master: 50299994181b835e5a6ee2882df2ee07e7fb4491
42 changes: 30 additions & 12 deletions trunk/drivers/media/video/cx18/cx18-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,30 @@ static const struct cx18_api_info *find_api_info(u32 cmd)
return NULL;
}

static void dump_mb(struct cx18 *cx, struct cx18_mailbox *mb, char *name)
/* Call with buf of n*11+1 bytes */
static char *u32arr2hex(u32 data[], int n, char *buf)
{
char argstr[MAX_MB_ARGUMENTS*11+1];
char *p;
int i;

for (i = 0, p = buf; i < n; i++, p += 11) {
/* kernel snprintf() appends '\0' always */
snprintf(p, 12, " %#010x", data[i]);
}
*p = '\0';
return buf;
}

static void dump_mb(struct cx18 *cx, struct cx18_mailbox *mb, char *name)
{
char argstr[MAX_MB_ARGUMENTS*11+1];

if (!(cx18_debug & CX18_DBGFLG_API))
return;

for (i = 0, p = argstr; i < MAX_MB_ARGUMENTS; i++, p += 11) {
/* kernel snprintf() appends '\0' always */
snprintf(p, 12, " %#010x", mb->args[i]);
}
CX18_DEBUG_API("%s: req %#010x ack %#010x cmd %#010x err %#010x args%s"
"\n", name, mb->request, mb->ack, mb->cmd, mb->error, argstr);
"\n", name, mb->request, mb->ack, mb->cmd, mb->error,
u32arr2hex(mb->args, MAX_MB_ARGUMENTS, argstr));
}


Expand Down Expand Up @@ -439,7 +448,8 @@ void cx18_api_epu_cmd_irq(struct cx18 *cx, int rpu)
"incoming %s to EPU mailbox (sequence no. %u)"
"\n",
rpu_str[rpu], rpu_str[rpu], order_mb->request);
dump_mb(cx, order_mb, "incoming");
if (cx18_debug & CX18_DBGFLG_WARN)
dump_mb(cx, order_mb, "incoming");
order->flags = CX18_F_EWO_MB_STALE_UPON_RECEIPT;
}

Expand Down Expand Up @@ -468,16 +478,24 @@ static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[])
struct mutex *mb_lock;
long int timeout, ret;
int i;
char argstr[MAX_MB_ARGUMENTS*11+1];

if (info == NULL) {
CX18_WARN("unknown cmd %x\n", cmd);
return -EINVAL;
}

if (cmd == CX18_CPU_DE_SET_MDL)
CX18_DEBUG_HI_API("%s\n", info->name);
else
CX18_DEBUG_API("%s\n", info->name);
if (cx18_debug & CX18_DBGFLG_API) { /* only call u32arr2hex if needed */
if (cmd == CX18_CPU_DE_SET_MDL) {
if (cx18_debug & CX18_DBGFLG_HIGHVOL)
CX18_DEBUG_HI_API("%s\tcmd %#010x args%s\n",
info->name, cmd,
u32arr2hex(data, args, argstr));
} else
CX18_DEBUG_API("%s\tcmd %#010x args%s\n",
info->name, cmd,
u32arr2hex(data, args, argstr));
}

switch (info->rpu) {
case APU:
Expand Down

0 comments on commit 4af7c21

Please sign in to comment.