diff options
author | 2016-04-11 10:41:07 +0300 | |
---|---|---|
committer | 2016-04-13 08:17:18 +0300 | |
commit | e09b41010ba33a20a87472ee821fa407a5b8da36 (patch) | |
tree | d10dc367189862e7ca5c592f033dc3726e1df4e3 /kernel/drivers/staging/media/davinci_vpfe | |
parent | f93b97fd65072de626c074dbe099a1fff05ce060 (diff) |
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
are taken from kernel.org, and rt patch from the rt wiki download page.
During the rebasing, the following patch collided:
Force tick interrupt and get rid of softirq magic(I70131fb85).
Collisions have been removed because its logic was found on the
source already.
Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769
Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'kernel/drivers/staging/media/davinci_vpfe')
6 files changed, 64 insertions, 65 deletions
diff --git a/kernel/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/kernel/drivers/staging/media/davinci_vpfe/dm365_ipipe.c index 1bbb90ce0..b1dfa2ccc 100644 --- a/kernel/drivers/staging/media/davinci_vpfe/dm365_ipipe.c +++ b/kernel/drivers/staging/media/davinci_vpfe/dm365_ipipe.c @@ -79,7 +79,7 @@ static int ipipe_set_lutdpc_params(struct vpfe_ipipe_device *ipipe, void *param) } dev = ipipe->subdev.v4l2_dev->dev; - dpc_param = (struct vpfe_ipipe_lutdpc *)param; + dpc_param = param; lutdpc->en = dpc_param->en; lutdpc->repl_white = dpc_param->repl_white; lutdpc->dpc_size = dpc_param->dpc_size; @@ -96,7 +96,7 @@ success: static int ipipe_get_lutdpc_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_lutdpc *lut_param = (struct vpfe_ipipe_lutdpc *)param; + struct vpfe_ipipe_lutdpc *lut_param = param; struct vpfe_ipipe_lutdpc *lutdpc = &ipipe->config.lutdpc; lut_param->en = lutdpc->en; @@ -171,7 +171,7 @@ static int ipipe_validate_otfdpc_params(struct vpfe_ipipe_otfdpc *dpc_param) static int ipipe_set_otfdpc_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_otfdpc *dpc_param = (struct vpfe_ipipe_otfdpc *)param; + struct vpfe_ipipe_otfdpc *dpc_param = param; struct vpfe_ipipe_otfdpc *otfdpc = &ipipe->config.otfdpc; struct device *dev; @@ -194,7 +194,7 @@ success: static int ipipe_get_otfdpc_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_otfdpc *dpc_param = (struct vpfe_ipipe_otfdpc *)param; + struct vpfe_ipipe_otfdpc *dpc_param = param; struct vpfe_ipipe_otfdpc *otfdpc = &ipipe->config.otfdpc; memcpy(dpc_param, otfdpc, sizeof(struct vpfe_ipipe_otfdpc)); @@ -226,7 +226,7 @@ static int ipipe_validate_nf_params(struct vpfe_ipipe_nf *nf_param) static int ipipe_set_nf_params(struct vpfe_ipipe_device *ipipe, unsigned int id, void *param) { - struct vpfe_ipipe_nf *nf_param = (struct vpfe_ipipe_nf *)param; + struct vpfe_ipipe_nf *nf_param = param; struct vpfe_ipipe_nf *nf = &ipipe->config.nf1; struct device *dev; @@ -264,7 +264,7 @@ static int ipipe_set_nf2_params(struct vpfe_ipipe_device *ipipe, void *param) static int ipipe_get_nf_params(struct vpfe_ipipe_device *ipipe, unsigned int id, void *param) { - struct vpfe_ipipe_nf *nf_param = (struct vpfe_ipipe_nf *)param; + struct vpfe_ipipe_nf *nf_param = param; struct vpfe_ipipe_nf *nf = &ipipe->config.nf1; if (id == IPIPE_D2F_2ND) @@ -299,7 +299,7 @@ static int ipipe_validate_gic_params(struct vpfe_ipipe_gic *gic) static int ipipe_set_gic_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_gic *gic_param = (struct vpfe_ipipe_gic *)param; + struct vpfe_ipipe_gic *gic_param = param; struct device *dev = ipipe->subdev.v4l2_dev->dev; struct vpfe_ipipe_gic *gic = &ipipe->config.gic; @@ -322,7 +322,7 @@ success: static int ipipe_get_gic_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_gic *gic_param = (struct vpfe_ipipe_gic *)param; + struct vpfe_ipipe_gic *gic_param = param; struct vpfe_ipipe_gic *gic = &ipipe->config.gic; memcpy(gic_param, gic, sizeof(struct vpfe_ipipe_gic)); @@ -351,7 +351,7 @@ static int ipipe_validate_wb_params(struct vpfe_ipipe_wb *wbal) static int ipipe_set_wb_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_wb *wb_param = (struct vpfe_ipipe_wb *)param; + struct vpfe_ipipe_wb *wb_param = param; struct vpfe_ipipe_wb *wbal = &ipipe->config.wbal; if (!wb_param) { @@ -377,7 +377,7 @@ success: static int ipipe_get_wb_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_wb *wb_param = (struct vpfe_ipipe_wb *)param; + struct vpfe_ipipe_wb *wb_param = param; struct vpfe_ipipe_wb *wbal = &ipipe->config.wbal; memcpy(wb_param, wbal, sizeof(struct vpfe_ipipe_wb)); @@ -407,7 +407,7 @@ static int ipipe_validate_cfa_params(struct vpfe_ipipe_cfa *cfa) static int ipipe_set_cfa_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_cfa *cfa_param = (struct vpfe_ipipe_cfa *)param; + struct vpfe_ipipe_cfa *cfa_param = param; struct vpfe_ipipe_cfa *cfa = &ipipe->config.cfa; if (!cfa_param) { @@ -428,7 +428,7 @@ success: static int ipipe_get_cfa_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_cfa *cfa_param = (struct vpfe_ipipe_cfa *)param; + struct vpfe_ipipe_cfa *cfa_param = param; struct vpfe_ipipe_cfa *cfa = &ipipe->config.cfa; memcpy(cfa_param, cfa, sizeof(struct vpfe_ipipe_cfa)); @@ -498,7 +498,7 @@ static int ipipe_set_rgb2rgb_params(struct vpfe_ipipe_device *ipipe, struct device *dev = ipipe->subdev.v4l2_dev->dev; struct vpfe_ipipe_rgb2rgb *rgb2rgb_param; - rgb2rgb_param = (struct vpfe_ipipe_rgb2rgb *)param; + rgb2rgb_param = param; if (id == IPIPE_RGB2RGB_2) rgb2rgb = &ipipe->config.rgb2rgb2; @@ -551,7 +551,7 @@ static int ipipe_get_rgb2rgb_params(struct vpfe_ipipe_device *ipipe, struct vpfe_ipipe_rgb2rgb *rgb2rgb = &ipipe->config.rgb2rgb1; struct vpfe_ipipe_rgb2rgb *rgb2rgb_param; - rgb2rgb_param = (struct vpfe_ipipe_rgb2rgb *)param; + rgb2rgb_param = param; if (id == IPIPE_RGB2RGB_2) rgb2rgb = &ipipe->config.rgb2rgb2; @@ -634,7 +634,7 @@ ipipe_validate_gamma_params(struct vpfe_ipipe_gamma *gamma, struct device *dev) static int ipipe_set_gamma_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_gamma *gamma_param = (struct vpfe_ipipe_gamma *)param; + struct vpfe_ipipe_gamma *gamma_param = param; struct vpfe_ipipe_gamma *gamma = &ipipe->config.gamma; struct device *dev = ipipe->subdev.v4l2_dev->dev; int table_size; @@ -678,7 +678,7 @@ success: static int ipipe_get_gamma_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_gamma *gamma_param = (struct vpfe_ipipe_gamma *)param; + struct vpfe_ipipe_gamma *gamma_param = param; struct vpfe_ipipe_gamma *gamma = &ipipe->config.gamma; struct device *dev = ipipe->subdev.v4l2_dev->dev; int table_size; @@ -737,7 +737,7 @@ static int ipipe_validate_3d_lut_params(struct vpfe_ipipe_3d_lut *lut) static int ipipe_get_3d_lut_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_3d_lut *lut_param = (struct vpfe_ipipe_3d_lut *)param; + struct vpfe_ipipe_3d_lut *lut_param = param; struct vpfe_ipipe_3d_lut *lut = &ipipe->config.lut; struct device *dev = ipipe->subdev.v4l2_dev->dev; @@ -757,7 +757,7 @@ static int ipipe_get_3d_lut_params(struct vpfe_ipipe_device *ipipe, void *param) static int ipipe_set_3d_lut_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_3d_lut *lut_param = (struct vpfe_ipipe_3d_lut *)param; + struct vpfe_ipipe_3d_lut *lut_param = param; struct vpfe_ipipe_3d_lut *lut = &ipipe->config.lut; struct device *dev = ipipe->subdev.v4l2_dev->dev; @@ -831,7 +831,7 @@ ipipe_set_rgb2yuv_params(struct vpfe_ipipe_device *ipipe, void *param) struct device *dev = ipipe->subdev.v4l2_dev->dev; struct vpfe_ipipe_rgb2yuv *rgb2yuv_param; - rgb2yuv_param = (struct vpfe_ipipe_rgb2yuv *)param; + rgb2yuv_param = param; if (!rgb2yuv_param) { /* Defaults for rgb2yuv conversion */ const struct vpfe_ipipe_rgb2yuv rgb2yuv_defaults = { @@ -871,7 +871,7 @@ ipipe_get_rgb2yuv_params(struct vpfe_ipipe_device *ipipe, void *param) struct vpfe_ipipe_rgb2yuv *rgb2yuv = &ipipe->config.rgb2yuv; struct vpfe_ipipe_rgb2yuv *rgb2yuv_param; - rgb2yuv_param = (struct vpfe_ipipe_rgb2yuv *)param; + rgb2yuv_param = param; memcpy(rgb2yuv_param, rgb2yuv, sizeof(struct vpfe_ipipe_rgb2yuv)); return 0; } @@ -896,7 +896,7 @@ static int ipipe_validate_gbce_params(struct vpfe_ipipe_gbce *gbce) static int ipipe_set_gbce_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_gbce *gbce_param = (struct vpfe_ipipe_gbce *)param; + struct vpfe_ipipe_gbce *gbce_param = param; struct vpfe_ipipe_gbce *gbce = &ipipe->config.gbce; struct device *dev = ipipe->subdev.v4l2_dev->dev; @@ -917,7 +917,7 @@ static int ipipe_set_gbce_params(struct vpfe_ipipe_device *ipipe, void *param) static int ipipe_get_gbce_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_gbce *gbce_param = (struct vpfe_ipipe_gbce *)param; + struct vpfe_ipipe_gbce *gbce_param = param; struct vpfe_ipipe_gbce *gbce = &ipipe->config.gbce; struct device *dev = ipipe->subdev.v4l2_dev->dev; @@ -950,7 +950,7 @@ ipipe_set_yuv422_conv_params(struct vpfe_ipipe_device *ipipe, void *param) struct vpfe_ipipe_yuv422_conv *yuv422_conv_param; struct device *dev = ipipe->subdev.v4l2_dev->dev; - yuv422_conv_param = (struct vpfe_ipipe_yuv422_conv *)param; + yuv422_conv_param = param; if (!yuv422_conv_param) { memset(yuv422_conv, 0, sizeof(struct vpfe_ipipe_yuv422_conv)); yuv422_conv->chrom_pos = VPFE_IPIPE_YUV422_CHR_POS_COSITE; @@ -974,7 +974,7 @@ ipipe_get_yuv422_conv_params(struct vpfe_ipipe_device *ipipe, void *param) struct vpfe_ipipe_yuv422_conv *yuv422_conv = &ipipe->config.yuv422_conv; struct vpfe_ipipe_yuv422_conv *yuv422_conv_param; - yuv422_conv_param = (struct vpfe_ipipe_yuv422_conv *)param; + yuv422_conv_param = param; memcpy(yuv422_conv_param, yuv422_conv, sizeof(struct vpfe_ipipe_yuv422_conv)); @@ -1018,7 +1018,7 @@ static int ipipe_validate_yee_params(struct vpfe_ipipe_yee *yee) static int ipipe_set_yee_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_yee *yee_param = (struct vpfe_ipipe_yee *)param; + struct vpfe_ipipe_yee *yee_param = param; struct device *dev = ipipe->subdev.v4l2_dev->dev; struct vpfe_ipipe_yee *yee = &ipipe->config.yee; @@ -1039,7 +1039,7 @@ static int ipipe_set_yee_params(struct vpfe_ipipe_device *ipipe, void *param) static int ipipe_get_yee_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_yee *yee_param = (struct vpfe_ipipe_yee *)param; + struct vpfe_ipipe_yee *yee_param = param; struct vpfe_ipipe_yee *yee = &ipipe->config.yee; yee_param->en = yee->en; @@ -1081,7 +1081,7 @@ static int ipipe_validate_car_params(struct vpfe_ipipe_car *car) static int ipipe_set_car_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_car *car_param = (struct vpfe_ipipe_car *)param; + struct vpfe_ipipe_car *car_param = param; struct device *dev = ipipe->subdev.v4l2_dev->dev; struct vpfe_ipipe_car *car = &ipipe->config.car; @@ -1102,7 +1102,7 @@ static int ipipe_set_car_params(struct vpfe_ipipe_device *ipipe, void *param) static int ipipe_get_car_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_car *car_param = (struct vpfe_ipipe_car *)param; + struct vpfe_ipipe_car *car_param = param; struct vpfe_ipipe_car *car = &ipipe->config.car; memcpy(car_param, car, sizeof(struct vpfe_ipipe_car)); @@ -1119,7 +1119,7 @@ static int ipipe_validate_cgs_params(struct vpfe_ipipe_cgs *cgs) static int ipipe_set_cgs_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_cgs *cgs_param = (struct vpfe_ipipe_cgs *)param; + struct vpfe_ipipe_cgs *cgs_param = param; struct device *dev = ipipe->subdev.v4l2_dev->dev; struct vpfe_ipipe_cgs *cgs = &ipipe->config.cgs; @@ -1140,7 +1140,7 @@ static int ipipe_set_cgs_params(struct vpfe_ipipe_device *ipipe, void *param) static int ipipe_get_cgs_params(struct vpfe_ipipe_device *ipipe, void *param) { - struct vpfe_ipipe_cgs *cgs_param = (struct vpfe_ipipe_cgs *)param; + struct vpfe_ipipe_cgs *cgs_param = param; struct vpfe_ipipe_cgs *cgs = &ipipe->config.cgs; memcpy(cgs_param, cgs, sizeof(struct vpfe_ipipe_cgs)); diff --git a/kernel/drivers/staging/media/davinci_vpfe/dm365_resizer.c b/kernel/drivers/staging/media/davinci_vpfe/dm365_resizer.c index b6498137d..acb293ed9 100644 --- a/kernel/drivers/staging/media/davinci_vpfe/dm365_resizer.c +++ b/kernel/drivers/staging/media/davinci_vpfe/dm365_resizer.c @@ -321,6 +321,7 @@ static int resizer_configure_output_win(struct vpfe_resizer_device *resizer) outformat = &resizer->resizer_a.formats[RESIZER_PAD_SOURCE]; + memset(&output_specs, 0x0, sizeof(struct vpfe_rsz_output_spec)); output_specs.vst_y = param->user_config.vst; if (outformat->code == MEDIA_BUS_FMT_YDYUYDYV8_1X16) output_specs.vst_c = param->user_config.vst; diff --git a/kernel/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c b/kernel/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c index 57426199a..01df0683e 100644 --- a/kernel/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c +++ b/kernel/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c @@ -294,7 +294,7 @@ static void vpfe_detach_irq(struct vpfe_device *vpfe_dev) */ static int vpfe_attach_irq(struct vpfe_device *vpfe_dev) { - int ret = 0; + int ret; ret = request_irq(vpfe_dev->ccdc_irq0, vpfe_isr, 0, "vpfe_capture0", vpfe_dev); diff --git a/kernel/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.h b/kernel/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.h index 2632a806c..8ad8d743f 100644 --- a/kernel/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.h +++ b/kernel/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.h @@ -67,8 +67,6 @@ struct vpfe_device { /* CCDC IRQs used when CCDC/ISIF output to SDRAM */ unsigned int ccdc_irq0; unsigned int ccdc_irq1; - /* maximum video memory that is available*/ - unsigned int video_limit; /* media device */ struct media_device media_dev; /* ccdc subdevice */ diff --git a/kernel/drivers/staging/media/davinci_vpfe/vpfe_video.c b/kernel/drivers/staging/media/davinci_vpfe/vpfe_video.c index 06d48d5eb..0fdff9162 100644 --- a/kernel/drivers/staging/media/davinci_vpfe/vpfe_video.c +++ b/kernel/drivers/staging/media/davinci_vpfe/vpfe_video.c @@ -27,9 +27,6 @@ #include "vpfe.h" #include "vpfe_mc_capture.h" -/* minimum number of buffers needed in cont-mode */ -#define MIN_NUM_BUFFERS 3 - static int debug; /* get v4l2 subdev pointer to external subdev which is active */ @@ -431,8 +428,8 @@ vpfe_video_get_next_buffer(struct vpfe_video_device *video) struct vpfe_cap_buffer, list); list_del(&video->next_frm->list); - video->next_frm->vb.state = VB2_BUF_STATE_ACTIVE; - return vb2_dma_contig_plane_dma_addr(&video->next_frm->vb, 0); + video->next_frm->vb.vb2_buf.state = VB2_BUF_STATE_ACTIVE; + return vb2_dma_contig_plane_dma_addr(&video->next_frm->vb.vb2_buf, 0); } /* schedule the next buffer which is available on dma queue */ @@ -451,8 +448,8 @@ void vpfe_video_schedule_next_buffer(struct vpfe_video_device *video) video->cur_frm = video->next_frm; list_del(&video->next_frm->list); - video->next_frm->vb.state = VB2_BUF_STATE_ACTIVE; - addr = vb2_dma_contig_plane_dma_addr(&video->next_frm->vb, 0); + video->next_frm->vb.vb2_buf.state = VB2_BUF_STATE_ACTIVE; + addr = vb2_dma_contig_plane_dma_addr(&video->next_frm->vb.vb2_buf, 0); video->ops->queue(vpfe_dev, addr); video->state = VPFE_VIDEO_BUFFER_QUEUED; } @@ -463,7 +460,7 @@ void vpfe_video_schedule_bottom_field(struct vpfe_video_device *video) struct vpfe_device *vpfe_dev = video->vpfe_dev; unsigned long addr; - addr = vb2_dma_contig_plane_dma_addr(&video->cur_frm->vb, 0); + addr = vb2_dma_contig_plane_dma_addr(&video->cur_frm->vb.vb2_buf, 0); addr += video->field_off; video->ops->queue(vpfe_dev, addr); } @@ -473,8 +470,8 @@ void vpfe_video_process_buffer_complete(struct vpfe_video_device *video) { struct vpfe_pipeline *pipe = &video->pipe; - do_gettimeofday(&video->cur_frm->vb.v4l2_buf.timestamp); - vb2_buffer_done(&video->cur_frm->vb, VB2_BUF_STATE_DONE); + v4l2_get_timestamp(&video->cur_frm->vb.timestamp); + vb2_buffer_done(&video->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE); if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS) video->cur_frm = video->next_frm; } @@ -1081,27 +1078,21 @@ vpfe_g_dv_timings(struct file *file, void *fh, * the buffer nbuffers and buffer size */ static int -vpfe_buffer_queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt, +vpfe_buffer_queue_setup(struct vb2_queue *vq, const void *parg, unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) { struct vpfe_fh *fh = vb2_get_drv_priv(vq); struct vpfe_video_device *video = fh->video; struct vpfe_device *vpfe_dev = video->vpfe_dev; - struct vpfe_pipeline *pipe = &video->pipe; unsigned long size; v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_buffer_queue_setup\n"); size = video->fmt.fmt.pix.sizeimage; - if (vpfe_dev->video_limit) { - while (size * *nbuffers > vpfe_dev->video_limit) - (*nbuffers)--; - } - if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS) { - if (*nbuffers < MIN_NUM_BUFFERS) - *nbuffers = MIN_NUM_BUFFERS; - } + if (vq->num_buffers + *nbuffers < 3) + *nbuffers = 3 - vq->num_buffers; + *nplanes = 1; sizes[0] = size; alloc_ctxs[0] = video->alloc_ctx; @@ -1147,12 +1138,13 @@ static int vpfe_buffer_prepare(struct vb2_buffer *vb) static void vpfe_buffer_queue(struct vb2_buffer *vb) { + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); /* Get the file handle object and device object */ struct vpfe_fh *fh = vb2_get_drv_priv(vb->vb2_queue); struct vpfe_video_device *video = fh->video; struct vpfe_device *vpfe_dev = video->vpfe_dev; struct vpfe_pipeline *pipe = &video->pipe; - struct vpfe_cap_buffer *buf = container_of(vb, + struct vpfe_cap_buffer *buf = container_of(vbuf, struct vpfe_cap_buffer, vb); unsigned long flags; unsigned long empty; @@ -1212,10 +1204,10 @@ static int vpfe_start_streaming(struct vb2_queue *vq, unsigned int count) /* Remove buffer from the buffer queue */ list_del(&video->cur_frm->list); /* Mark state of the current frame to active */ - video->cur_frm->vb.state = VB2_BUF_STATE_ACTIVE; + video->cur_frm->vb.vb2_buf.state = VB2_BUF_STATE_ACTIVE; /* Initialize field_id and started member */ video->field_id = 0; - addr = vb2_dma_contig_plane_dma_addr(&video->cur_frm->vb, 0); + addr = vb2_dma_contig_plane_dma_addr(&video->cur_frm->vb.vb2_buf, 0); video->ops->queue(vpfe_dev, addr); video->state = VPFE_VIDEO_BUFFER_QUEUED; @@ -1223,10 +1215,12 @@ static int vpfe_start_streaming(struct vb2_queue *vq, unsigned int count) if (ret) { struct vpfe_cap_buffer *buf, *tmp; - vb2_buffer_done(&video->cur_frm->vb, VB2_BUF_STATE_QUEUED); + vb2_buffer_done(&video->cur_frm->vb.vb2_buf, + VB2_BUF_STATE_QUEUED); list_for_each_entry_safe(buf, tmp, &video->dma_queue, list) { list_del(&buf->list); - vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); + vb2_buffer_done(&buf->vb.vb2_buf, + VB2_BUF_STATE_QUEUED); } goto unlock_out; } @@ -1243,7 +1237,8 @@ streamoff: static int vpfe_buffer_init(struct vb2_buffer *vb) { - struct vpfe_cap_buffer *buf = container_of(vb, + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); + struct vpfe_cap_buffer *buf = container_of(vbuf, struct vpfe_cap_buffer, vb); INIT_LIST_HEAD(&buf->list); @@ -1258,13 +1253,14 @@ static void vpfe_stop_streaming(struct vb2_queue *vq) /* release all active buffers */ if (video->cur_frm == video->next_frm) { - vb2_buffer_done(&video->cur_frm->vb, VB2_BUF_STATE_ERROR); + vb2_buffer_done(&video->cur_frm->vb.vb2_buf, + VB2_BUF_STATE_ERROR); } else { if (video->cur_frm != NULL) - vb2_buffer_done(&video->cur_frm->vb, + vb2_buffer_done(&video->cur_frm->vb.vb2_buf, VB2_BUF_STATE_ERROR); if (video->next_frm != NULL) - vb2_buffer_done(&video->next_frm->vb, + vb2_buffer_done(&video->next_frm->vb.vb2_buf, VB2_BUF_STATE_ERROR); } @@ -1272,16 +1268,18 @@ static void vpfe_stop_streaming(struct vb2_queue *vq) video->next_frm = list_entry(video->dma_queue.next, struct vpfe_cap_buffer, list); list_del(&video->next_frm->list); - vb2_buffer_done(&video->next_frm->vb, VB2_BUF_STATE_ERROR); + vb2_buffer_done(&video->next_frm->vb.vb2_buf, + VB2_BUF_STATE_ERROR); } } static void vpfe_buf_cleanup(struct vb2_buffer *vb) { + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct vpfe_fh *fh = vb2_get_drv_priv(vb->vb2_queue); struct vpfe_video_device *video = fh->video; struct vpfe_device *vpfe_dev = video->vpfe_dev; - struct vpfe_cap_buffer *buf = container_of(vb, + struct vpfe_cap_buffer *buf = container_of(vbuf, struct vpfe_cap_buffer, vb); v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_buf_cleanup\n"); @@ -1346,6 +1344,7 @@ static int vpfe_reqbufs(struct file *file, void *priv, q->ops = &video_qops; q->mem_ops = &vb2_dma_contig_memops; q->buf_struct_size = sizeof(struct vpfe_cap_buffer); + q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; ret = vb2_queue_init(q); if (ret) { diff --git a/kernel/drivers/staging/media/davinci_vpfe/vpfe_video.h b/kernel/drivers/staging/media/davinci_vpfe/vpfe_video.h index 1b1b6c4a5..673cefe3e 100644 --- a/kernel/drivers/staging/media/davinci_vpfe/vpfe_video.h +++ b/kernel/drivers/staging/media/davinci_vpfe/vpfe_video.h @@ -22,6 +22,7 @@ #ifndef _DAVINCI_VPFE_VIDEO_H #define _DAVINCI_VPFE_VIDEO_H +#include <media/videobuf2-v4l2.h> #include <media/videobuf2-dma-contig.h> struct vpfe_device; @@ -72,7 +73,7 @@ struct vpfe_pipeline { container_of(vdev, struct vpfe_video_device, video_dev) struct vpfe_cap_buffer { - struct vb2_buffer vb; + struct vb2_v4l2_buffer vb; struct list_head list; }; |