On Saturday 23 August 2008 17:52:05 Andy Walls wrote:
> Hans,
>
> A few questions:
>
> 1. The handle member in struct cx18_stream is initialized and
> cleared to 0xffffffff to indicated non-use. BTW, the CX23418 appears
> to begin assigning task handles starting with 0. So what is
> cx18_streams:cx18_find_handle() really trying to do? Find the first
> used handle or first unused handle?
>
> u32 cx18_find_handle(struct cx18 *cx)
> {
> int i;
>
> /* find first available handle to be used for global settings
> */ for (i = 0; i < CX18_MAX_STREAMS; i++) {
> struct cx18_stream *s = &cx->streams[i];
>
> if (s->v4l2dev && s->handle)
> return s->handle;
> }
> return 0;
> }
>
> The above code will reject handle 0 and likely return either
> 0xffffffff or 1 in the most common cases.
>
>
>
> 2. The CX23418 appears to reuse handles:
Oops, missed this one.
>
> Aug 23 11:01:02 morgan kernel: cx18-0 info: Start feed: pid = 0x31
> index = 0 Aug 23 11:01:02 morgan kernel: cx18-0 info: Starting
> Transport DMA Aug 23 11:01:02 morgan kernel: cx18-0 info: Start
> encoder stream TS Aug 23 11:01:02 morgan kernel: cx18-0 info: Stream
> TS task given handle 0 by CX23418 [...]
> Aug 23 11:01:09 morgan kernel: cx18-0 info: Stopping Transport DMA
> Aug 23 11:01:09 morgan kernel: cx18-0 info: Stop Capture
> Aug 23 11:01:09 morgan kernel: cx180 irq: SW1: 10000 SW2: 0 HW2: 0
> Aug 23 11:01:09 morgan kernel: cx180 irq: queue_get_buf_irq enter
> Aug 23 11:01:09 morgan kernel: cx180 irq: queue_get_buf_irq normal
> exit Aug 23 11:01:09 morgan kernel: cx18-0 info: Stop Capture mbox
> command sent Aug 23 11:01:09 morgan kernel: cx18-0 info: Destroy task
> mbox command sent Aug 23 11:01:09 morgan kernel: cx18-0 info: DSP0
> interrupt mask altered Aug 23 11:26:22 morgan kernel: cx18-0 info:
> Start encoder stream encoder MPEG Aug 23 11:26:22 morgan kernel:
> cx18-0 info: Stream encoder MPEG task given handle 0 by CX23418
>
> So without asking the CX23418 to release the MDLs at the end of a
> capture, the CX23418 can later return a data buffer with a buffer id
> in the wrong range for a stream type. cx18_queue_get_buf_irq() will
> gripe when this happens and the data in that buffer will be wrongly
> dropped.
>
> In cx23418.h, CX18_CPU_DE_ReleaseMDL is commented out. Is there a
> problem with it, or is it OK to uncomment and use?
I was never certain whether is was needed or not. The driver code I have
didn't use it and the documentation is for all practical purposes
non-existent. By all means, see if it fixes this issue. It was always
my impression that the cx23418 automatically released all MDLs after
the capture was stopped and the task destroyed. But I probably never
have tested this particular scenario.
Regards,
Hans
>
> Regards,
> Andy
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel