On Thu, 5 Sep 2002, Brian W Grasby wrote:
> Hello all,
>
> I'm writing a program that captures images from a bttv video capture card
> and processes them then outputs to the screen and i need real-time
> performance. Currently I'm using XImages to display on screen but i want
> to use MIT-SHM extension and XShmPutImage. My problem is that the data is
> coming from mmap()'ed buffers and i don't know how to get it into the
> XImage without doing memcopy. Currently I use
Well, if you are going to be processing data anyway a memcpy won't hurt.
The fact of the matter is that there is at least another memcpy going on
when Xserver transfers the contents of Ximage to video RAM. So, in the
worst case, you will have 2.0x slowdown versus "zero-copy mode". In
practice the slowdown will be smaller as there is overhead in context
switching: your process, kernel/bttv driver, X server.
The only concern you might have about memcpy is the extra latency it
introduces, but that is not very much. A 32bpp 640x480 image takes about
1.3meg. With 100mhz SDRAM, it will take less than 6.5ms for memcpy.
Certainly less with faster RAM.
Vladimir Dergachev
>
> XImage->data = &buffer[i];
> XPutImage(...
>
> Can i do this with SHM or can i mmap the same segment as i use for a SHM
> XImage? Or is it faster with memcopy?
>
> THanks
> Brian
>
> _______________________________________________
> Xpert mailing list
> [EMAIL PROTECTED]
> http://XFree86.Org/mailman/listinfo/xpert
>
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert