diff options
Diffstat (limited to 'drivers/media/platform/mem2mem_testdev.c')
-rw-r--r-- | drivers/media/platform/mem2mem_testdev.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/platform/mem2mem_testdev.c b/drivers/media/platform/mem2mem_testdev.c index 7487d7208dea..4cc7f65d7d76 100644 --- a/drivers/media/platform/mem2mem_testdev.c +++ b/drivers/media/platform/mem2mem_testdev.c | |||
@@ -38,6 +38,10 @@ MODULE_AUTHOR("Pawel Osciak, <pawel@osciak.com>"); | |||
38 | MODULE_LICENSE("GPL"); | 38 | MODULE_LICENSE("GPL"); |
39 | MODULE_VERSION("0.1.1"); | 39 | MODULE_VERSION("0.1.1"); |
40 | 40 | ||
41 | static unsigned debug; | ||
42 | module_param(debug, uint, 0644); | ||
43 | MODULE_PARM_DESC(debug, "activates debug info"); | ||
44 | |||
41 | #define MIN_W 32 | 45 | #define MIN_W 32 |
42 | #define MIN_H 32 | 46 | #define MIN_H 32 |
43 | #define MAX_W 640 | 47 | #define MAX_W 640 |
@@ -67,7 +71,7 @@ MODULE_VERSION("0.1.1"); | |||
67 | #define MEM2MEM_VFLIP (1 << 1) | 71 | #define MEM2MEM_VFLIP (1 << 1) |
68 | 72 | ||
69 | #define dprintk(dev, fmt, arg...) \ | 73 | #define dprintk(dev, fmt, arg...) \ |
70 | v4l2_dbg(1, 1, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg) | 74 | v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg) |
71 | 75 | ||
72 | 76 | ||
73 | static void m2mtest_dev_release(struct device *dev) | 77 | static void m2mtest_dev_release(struct device *dev) |
@@ -234,6 +238,10 @@ static int device_process(struct m2mtest_ctx *ctx, | |||
234 | bytes_left = bytesperline - tile_w * MEM2MEM_NUM_TILES; | 238 | bytes_left = bytesperline - tile_w * MEM2MEM_NUM_TILES; |
235 | w = 0; | 239 | w = 0; |
236 | 240 | ||
241 | memcpy(&out_vb->v4l2_buf.timestamp, | ||
242 | &in_vb->v4l2_buf.timestamp, | ||
243 | sizeof(struct timeval)); | ||
244 | |||
237 | switch (ctx->mode) { | 245 | switch (ctx->mode) { |
238 | case MEM2MEM_HFLIP | MEM2MEM_VFLIP: | 246 | case MEM2MEM_HFLIP | MEM2MEM_VFLIP: |
239 | p_out += bytesperline * height - bytes_left; | 247 | p_out += bytesperline * height - bytes_left; |
@@ -844,6 +852,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *ds | |||
844 | src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); | 852 | src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); |
845 | src_vq->ops = &m2mtest_qops; | 853 | src_vq->ops = &m2mtest_qops; |
846 | src_vq->mem_ops = &vb2_vmalloc_memops; | 854 | src_vq->mem_ops = &vb2_vmalloc_memops; |
855 | src_vq->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY; | ||
847 | 856 | ||
848 | ret = vb2_queue_init(src_vq); | 857 | ret = vb2_queue_init(src_vq); |
849 | if (ret) | 858 | if (ret) |
@@ -855,6 +864,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *ds | |||
855 | dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); | 864 | dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); |
856 | dst_vq->ops = &m2mtest_qops; | 865 | dst_vq->ops = &m2mtest_qops; |
857 | dst_vq->mem_ops = &vb2_vmalloc_memops; | 866 | dst_vq->mem_ops = &vb2_vmalloc_memops; |
867 | dst_vq->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY; | ||
858 | 868 | ||
859 | return vb2_queue_init(dst_vq); | 869 | return vb2_queue_init(dst_vq); |
860 | } | 870 | } |