int ctrl_hflip;
dma_addr_t disp_bufs[FB_BUFS];
+
+ struct videobuf_buffer *pre_vb;
};
struct mxc_vout_dev {
goto err;
}
- show_buf(vout, vout->frame_count % FB_BUFS);
+ if (show_buf(vout, vout->frame_count % FB_BUFS) < 0)
+ goto err;
spin_lock_irqsave(q->irqlock, flags);
list_del(&vb->queue);
- vb->state = VIDEOBUF_DONE;
+ /*
+ * previous videobuf finish show, set VIDEOBUF_DONE state here
+ * to avoid tearing issue, which make sure showing buffer will
+ * not be dequeue to write new data. It also bring side-effect
+ * that the last buffer can not be dequeue correctly, app need
+ * take care about it.
+ */
+ if (vout->pre_vb) {
+ vout->pre_vb->state = VIDEOBUF_DONE;
+ wake_up_interruptible(&vout->pre_vb->done);
+ }
- wake_up_interruptible(&vb->done);
+ vout->pre_vb = vb;
vout->frame_count++;
return 0;
if (--vout->open_cnt == 0) {
- destroy_workqueue(vout->v4l_wq);
q = &vout->vbq;
if (q->streaming)
ret = mxc_vidioc_streamoff(file, vout, vout->type);
+ destroy_workqueue(vout->v4l_wq);
}
return ret;
rect = (struct v4l2_rect *)f->fmt.pix.priv;
vout->task.input.crop.pos.x = rect->left;
vout->task.input.crop.pos.y = rect->top;
- vout->task.input.crop.w = rect->width;
- vout->task.input.crop.h = rect->height;
+ vout->task.input.crop.w = rect->width - rect->width%8;
+ vout->task.input.crop.h = rect->height - rect->height%8;
} else {
vout->task.input.crop.pos.x = 0;
vout->task.input.crop.pos.y = 0;
- vout->task.input.crop.w = f->fmt.pix.width;
- vout->task.input.crop.h = f->fmt.pix.height;
+ vout->task.input.crop.w = f->fmt.pix.width - f->fmt.pix.width%8;
+ vout->task.input.crop.h = f->fmt.pix.height - f->fmt.pix.height%8;
}
/* assume task.output already set by S_CROP */
vout->start_jiffies = jiffies;
+ vout->pre_vb = NULL;
+
ret = videobuf_streamon(q);
done:
return ret;
fix->type = FB_TYPE_PACKED_PIXELS;
fix->accel = FB_ACCEL_NONE;
fix->visual = FB_VISUAL_TRUECOLOR;
- fix->xpanstep = 0;
+ fix->xpanstep = 1;
fix->ywrapstep = 1;
fix->ypanstep = 1;
}
/* update u/v offset */
- if (info->var.xres_virtual > info->var.xres)
- ipu_update_channel_offset(mxc_fbi->ipu, mxc_fbi->ipu_ch,
- IPU_INPUT_BUFFER,
- bpp_to_pixfmt(info),
- info->var.xres_virtual,
- info->var.yres_virtual,
- info->var.xres_virtual,
- 0, 0,
- var->yoffset,
- var->xoffset);
+ ipu_update_channel_offset(mxc_fbi->ipu, mxc_fbi->ipu_ch,
+ IPU_INPUT_BUFFER,
+ bpp_to_pixfmt(info),
+ info->var.xres_virtual,
+ info->var.yres_virtual,
+ info->var.xres_virtual,
+ 0, 0,
+ var->yoffset,
+ var->xoffset);
ipu_select_buffer(mxc_fbi->ipu, mxc_fbi->ipu_ch, IPU_INPUT_BUFFER,
mxc_fbi->cur_ipu_buf);