Re: [RFC-final] videobuf tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michael,Em Dom, 2007-10-07 às 02:30 -0400, Michael Krufky escreveu:> Mauro Carvalho Chehab wrote:> > Hi Michael,> > > > Please try the enclosed patch. It is just a hack. > > > > Please, post the dmesg, working or not.> > Mauro,> > Your patch touches code that apparently is not being executed in this case.  I've enclosed dmesg anyway (see attached)

I took a look at cx23885 code. It seems that there's a serious error onthe way you're using cx23885_buffer there:
cx23885-dvb.c:  return cx23885_buf_prepare(q, port, (structcx23885_buffer*)vb, field);cx23885-dvb.c:  cx23885_buf_queue(port, (struct cx23885_buffer*)vb);cx23885-dvb.c:  cx23885_free_buffer(q, (struct cx23885_buffer*)vb);
It seems that you are forcing videobuf_buffer to be cx23885_buffer. Thisis not right!
This is what is defined on cx23885.h:
struct cx23885_buffer {        /* common v4l buffer stuff -- must be first */        struct videobuf_buffer vb;
        /* cx23885 specific */        unsigned int           bpl;        struct btcx_riscmem    risc;        struct cx23885_fmt     *fmt;        u32                    count;};
You should notice that cx23885_buffer size is bigger thanvideobuf_buffer. If you just force one to be equal to the other, you'lluse more memory than the allocated one! 
Also, videobuf code will also add some extra bytes at the alloced memoryfor its own consuption.
The new videobuf code has some magic to protect about this bad usage,otherwise, you may risk to corrupt other memory areas with dmatransfers. I lost part of my reiserfs btrees once, with a bad code likethis.
What it should be done, is to use the allocated area provided byvideobuf_queue_pci_init.
I dunno how this ever worked!
Cheers,Mauro

_______________________________________________linux-dvb mailing listlinux-dvb@xxxxxxxxxxxxxxx://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux