summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx.h
diff options
context:
space:
mode:
authorFrank Schaefer <fschaefer.oss@googlemail.com>2012-12-08 14:31:29 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-22 22:55:01 (GMT)
commit4078d625c9610a362f571f7e5ff2521adadfff2b (patch)
treeb3fa9a55bf32243b13eff3cb939cdeec971f17ba /drivers/media/usb/em28xx/em28xx.h
parenta48370158d134807f5b02655287b91cc000c45ca (diff)
downloadlinux-fsl-qoriq-4078d625c9610a362f571f7e5ff2521adadfff2b.tar.xz
[media] em28xx: move caching of pointer to vmalloc memory in videobuf to struct em28xx_buffer
In the current code em28xx_urb_data_copy() caches the pointer to the vmalloc memory in videobuf locally. The alternative would be to call videobuf_to_vmalloc() for each processed USB data packet (isoc USB transfers => 64 times per URB) in the em28xx_copy_*() functions. With the next commits, the data processing code will be split into functions for serveral reasons: - em28xx_urb_data_copy() is generally way to long, making it less readable - there is code duplication between VBI and video data processing - support for em25xx data processing (uses a different header and frame end signaling mechanism) will be added This would require extensive usage of pointer-pointers, which usually makes the code less readable and prone to bugs. The better solution is to cache the pointer in struct em28xx_buffer. This also improves consistency, because we already track the buffer fill count there. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx.h')
-rw-r--r--drivers/media/usb/em28xx/em28xx.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h
index 7507aa6..062841e 100644
--- a/drivers/media/usb/em28xx/em28xx.h
+++ b/drivers/media/usb/em28xx/em28xx.h
@@ -258,6 +258,9 @@ struct em28xx_buffer {
unsigned int pos;
/* NOTE; in interlaced mode, this value is reset to zero at
* the start of each new field (not frame !) */
+
+ /* pointer to vmalloc memory address in vb */
+ char *vb_buf;
};
struct em28xx_dmaqueue {