static int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa7146_buf *buf)
{
struct saa7146_vv *vv = dev->vv_data;
+ struct v4l2_pix_format *pix = &vv->video_fmt;
struct saa7146_video_dma vdma1;
+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pix->pixelformat);
- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat);
-
- int width = buf->fmt->width;
- int height = buf->fmt->height;
- int bytesperline = buf->fmt->bytesperline;
- enum v4l2_field field = buf->fmt->field;
+ int width = pix->width;
+ int height = pix->height;
+ int bytesperline = pix->bytesperline;
+ enum v4l2_field field = pix->field;
int depth = sfmt->depth;
static int calc_planar_422(struct saa7146_vv *vv, struct saa7146_buf *buf, struct saa7146_video_dma *vdma2, struct saa7146_video_dma *vdma3)
{
- int height = buf->fmt->height;
- int width = buf->fmt->width;
+ struct v4l2_pix_format *pix = &vv->video_fmt;
+ int height = pix->height;
+ int width = pix->width;
vdma2->pitch = width;
vdma3->pitch = width;
static int calc_planar_420(struct saa7146_vv *vv, struct saa7146_buf *buf, struct saa7146_video_dma *vdma2, struct saa7146_video_dma *vdma3)
{
- int height = buf->fmt->height;
- int width = buf->fmt->width;
+ struct v4l2_pix_format *pix = &vv->video_fmt;
+ int height = pix->height;
+ int width = pix->width;
vdma2->pitch = width/2;
vdma3->pitch = width/2;
static int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa7146_buf *buf)
{
struct saa7146_vv *vv = dev->vv_data;
+ struct v4l2_pix_format *pix = &vv->video_fmt;
struct saa7146_video_dma vdma1;
struct saa7146_video_dma vdma2;
struct saa7146_video_dma vdma3;
+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pix->pixelformat);
- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat);
-
- int width = buf->fmt->width;
- int height = buf->fmt->height;
- enum v4l2_field field = buf->fmt->field;
+ int width = pix->width;
+ int height = pix->height;
+ enum v4l2_field field = pix->field;
BUG_ON(0 == buf->pt[0].dma);
BUG_ON(0 == buf->pt[1].dma);
void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next)
{
- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat);
struct saa7146_vv *vv = dev->vv_data;
+ struct v4l2_pix_format *pix = &vv->video_fmt;
+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pix->pixelformat);
u32 vdma1_prot_addr;
DEB_CAP("buf:%p, next:%p\n", buf, next);
saa7146_write(dev, MC2, MASK_27 );
}
- saa7146_set_window(dev, buf->fmt->width, buf->fmt->height, buf->fmt->field);
+ saa7146_set_window(dev, pix->width, pix->height, pix->field);
saa7146_set_output_format(dev, sfmt->trans);
saa7146_disable_clipping(dev);
static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf)
{
+ struct saa7146_vv *vv = dev->vv_data;
struct pci_dev *pci = dev->pci;
struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
struct scatterlist *list = dma->sglist;
int length = dma->sglen;
- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat);
+ struct v4l2_pix_format *pix = &vv->video_fmt;
+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pix->pixelformat);
DEB_EE("dev:%p, buf:%p, sg_len:%d\n", dev, buf, length);
__le32 *ptr1, *ptr2, *ptr3;
__le32 fill;
- int size = buf->fmt->width*buf->fmt->height;
+ int size = pix->width * pix->height;
int i,p,m1,m2,m3,o1,o2;
switch( sfmt->depth ) {
buf->vb.height != vv->video_fmt.height ||
buf->vb.size != size ||
buf->vb.field != field ||
- buf->vb.field != vv->video_fmt.field ||
- buf->fmt != &vv->video_fmt) {
+ buf->vb.field != vv->video_fmt.field) {
saa7146_dma_free(dev,q,buf);
}
buf->vb.height = vv->video_fmt.height;
buf->vb.size = size;
buf->vb.field = field;
- buf->fmt = &vv->video_fmt;
buf->vb.field = vv->video_fmt.field;
- sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat);
+ sfmt = saa7146_format_by_fourcc(dev, vv->video_fmt.pixelformat);
release_all_pagetables(dev, buf);
if( 0 != IS_PLANAR(sfmt->trans)) {