Hi Marco, On Tuesday 17 June 2008, Marco Argiolas wrote: > Here I'm again to correct some mistakes and to add some missing data: > - first of all I have a Sonix webcam with device id 174f:5a35 (at the end > of this message I've attached the complete verbose lsusb output); > - with my webcam, "pixel_size" (# of bytes per pixel) has to be set equal > to "2" (pixel_size=2 ), because bpp=16 (2 byte); > - I've also added a kfree() in order to free the preallocated space;
You shouldn't have allocated extra memory in the first place. Instead of modifying the whole frame at once, you should instead replace the call to memcpy() in uvc_video_decode_data() and revert the image there. Computation of boundaries and memory offsets might be a bit more difficult, but you will speed up the process and you'll avoid allocating an extra buffer. > - in order to speed up the allocation process I've used GFP_ATOMIC flag in > kmalloc() function. The purpose of GFP_ATOMIC is not to speed up memory allocation, but to make sure that memory allocation will not sleep. This is required here, as uvc_video_decode_data() is called in interrupt context where you're not allowed to sleep. > Please let me know if you think something is wrong. > Because just right now my cam is working fine, now images are not > upside-down, but colour are not so perfect. > Also if the colour of my skin seems to be the right one, red and blu colour > are exchanged each other. > > Do you think the "=" is appropriate in "if (len >= maxlen)" statement? As explained above, you should modify the existing memcpy() instead of adding a new one. The statement your mention will then not have to be modified. Best regards, Laurent Pinchart _______________________________________________ Linux-uvc-devel mailing list [email protected] https://lists.berlios.de/mailman/listinfo/linux-uvc-devel
