aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc/pwc-uncompress.c
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-10-23 13:56:16 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-10-23 13:56:16 +0200
commitff67a6b9aaddb2dea6ed4a3f7df8a0c6acf131c2 (patch)
tree34d81901340c14191fab6e0c5a424f45385ae2aa /drivers/media/video/pwc/pwc-uncompress.c
parente7549b926dd3ceec048f5689df90d4ec970c9419 (diff)
downloadkernel_samsung_smdk4412-ff67a6b9aaddb2dea6ed4a3f7df8a0c6acf131c2.zip
kernel_samsung_smdk4412-ff67a6b9aaddb2dea6ed4a3f7df8a0c6acf131c2.tar.gz
kernel_samsung_smdk4412-ff67a6b9aaddb2dea6ed4a3f7df8a0c6acf131c2.tar.bz2
last driver import from 3.2.72 for now
Diffstat (limited to 'drivers/media/video/pwc/pwc-uncompress.c')
-rw-r--r--drivers/media/video/pwc/pwc-uncompress.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/media/video/pwc/pwc-uncompress.c b/drivers/media/video/pwc/pwc-uncompress.c
index 3b73f29..5126509 100644
--- a/drivers/media/video/pwc/pwc-uncompress.c
+++ b/drivers/media/video/pwc/pwc-uncompress.c
@@ -30,26 +30,17 @@
#include <asm/types.h>
#include "pwc.h"
-#include "pwc-uncompress.h"
#include "pwc-dec1.h"
#include "pwc-dec23.h"
-int pwc_decompress(struct pwc_device *pdev)
+int pwc_decompress(struct pwc_device *pdev, struct pwc_frame_buf *fbuf)
{
- struct pwc_frame_buf *fbuf;
int n, line, col, stride;
void *yuv, *image;
u16 *src;
u16 *dsty, *dstu, *dstv;
- if (pdev == NULL)
- return -EFAULT;
-
- fbuf = pdev->read_frame;
- if (fbuf == NULL)
- return -EFAULT;
- image = pdev->image_data;
- image += pdev->images[pdev->fill_image].offset;
+ image = vb2_plane_vaddr(&fbuf->vb, 0);
yuv = fbuf->data + pdev->frame_header_size; /* Skip header */
@@ -64,9 +55,13 @@ int pwc_decompress(struct pwc_device *pdev)
* determine this using the type of the webcam */
memcpy(raw_frame->cmd, pdev->cmd_buf, 4);
memcpy(raw_frame+1, yuv, pdev->frame_size);
+ vb2_set_plane_payload(&fbuf->vb, 0,
+ pdev->frame_size + sizeof(struct pwc_raw_frame));
return 0;
}
+ vb2_set_plane_payload(&fbuf->vb, 0, pdev->view.size);
+
if (pdev->vbandlength == 0) {
/* Uncompressed mode.
* We copy the data into the output buffer, using the viewport