|
@@ -1,3 +1,5 @@
|
|
|
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
+
|
|
|
#include <media/saa7146_vv.h>
|
|
|
#include <media/v4l2-chip-ident.h>
|
|
|
|
|
@@ -94,7 +96,7 @@ struct saa7146_format* saa7146_format_by_fourcc(struct saa7146_dev *dev, int fou
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- DEB_D(("unknown pixelformat:'%4.4s'\n",(char *)&fourcc));
|
|
|
+ DEB_D("unknown pixelformat:'%4.4s'\n", (char *)&fourcc);
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
@@ -107,32 +109,32 @@ int saa7146_start_preview(struct saa7146_fh *fh)
|
|
|
struct v4l2_format fmt;
|
|
|
int ret = 0, err = 0;
|
|
|
|
|
|
- DEB_EE(("dev:%p, fh:%p\n",dev,fh));
|
|
|
+ DEB_EE("dev:%p, fh:%p\n", dev, fh);
|
|
|
|
|
|
/* check if we have overlay informations */
|
|
|
if( NULL == fh->ov.fh ) {
|
|
|
- DEB_D(("no overlay data available. try S_FMT first.\n"));
|
|
|
+ DEB_D("no overlay data available. try S_FMT first.\n");
|
|
|
return -EAGAIN;
|
|
|
}
|
|
|
|
|
|
/* check if streaming capture is running */
|
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
|
- DEB_D(("streaming capture is active.\n"));
|
|
|
+ DEB_D("streaming capture is active\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
|
/* check if overlay is running */
|
|
|
if (IS_OVERLAY_ACTIVE(fh) != 0) {
|
|
|
if (vv->video_fh == fh) {
|
|
|
- DEB_D(("overlay is already active.\n"));
|
|
|
+ DEB_D("overlay is already active\n");
|
|
|
return 0;
|
|
|
}
|
|
|
- DEB_D(("overlay is already active in another open.\n"));
|
|
|
+ DEB_D("overlay is already active in another open\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
|
if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) {
|
|
|
- DEB_D(("cannot get necessary overlay resources\n"));
|
|
|
+ DEB_D("cannot get necessary overlay resources\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
@@ -145,13 +147,13 @@ int saa7146_start_preview(struct saa7146_fh *fh)
|
|
|
fh->ov.win = fmt.fmt.win;
|
|
|
vv->ov_data = &fh->ov;
|
|
|
|
|
|
- DEB_D(("%dx%d+%d+%d %s field=%s\n",
|
|
|
- fh->ov.win.w.width,fh->ov.win.w.height,
|
|
|
- fh->ov.win.w.left,fh->ov.win.w.top,
|
|
|
- vv->ov_fmt->name,v4l2_field_names[fh->ov.win.field]));
|
|
|
+ DEB_D("%dx%d+%d+%d %s field=%s\n",
|
|
|
+ fh->ov.win.w.width, fh->ov.win.w.height,
|
|
|
+ fh->ov.win.w.left, fh->ov.win.w.top,
|
|
|
+ vv->ov_fmt->name, v4l2_field_names[fh->ov.win.field]);
|
|
|
|
|
|
if (0 != (ret = saa7146_enable_overlay(fh))) {
|
|
|
- DEB_D(("enabling overlay failed: %d\n",ret));
|
|
|
+ DEB_D("enabling overlay failed: %d\n", ret);
|
|
|
saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP);
|
|
|
return ret;
|
|
|
}
|
|
@@ -168,22 +170,22 @@ int saa7146_stop_preview(struct saa7146_fh *fh)
|
|
|
struct saa7146_dev *dev = fh->dev;
|
|
|
struct saa7146_vv *vv = dev->vv_data;
|
|
|
|
|
|
- DEB_EE(("dev:%p, fh:%p\n",dev,fh));
|
|
|
+ DEB_EE("dev:%p, fh:%p\n", dev, fh);
|
|
|
|
|
|
/* check if streaming capture is running */
|
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
|
- DEB_D(("streaming capture is active.\n"));
|
|
|
+ DEB_D("streaming capture is active\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
|
/* check if overlay is running at all */
|
|
|
if ((vv->video_status & STATUS_OVERLAY) == 0) {
|
|
|
- DEB_D(("no active overlay.\n"));
|
|
|
+ DEB_D("no active overlay\n");
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
if (vv->video_fh != fh) {
|
|
|
- DEB_D(("overlay is active, but in another open.\n"));
|
|
|
+ DEB_D("overlay is active, but in another open\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
@@ -268,7 +270,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu
|
|
|
int length = dma->sglen;
|
|
|
struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat);
|
|
|
|
|
|
- DEB_EE(("dev:%p, buf:%p, sg_len:%d\n",dev,buf,length));
|
|
|
+ DEB_EE("dev:%p, buf:%p, sg_len:%d\n", dev, buf, length);
|
|
|
|
|
|
if( 0 != IS_PLANAR(sfmt->trans)) {
|
|
|
struct saa7146_pgtable *pt1 = &buf->pt[0];
|
|
@@ -288,7 +290,8 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu
|
|
|
m3 = ((size+(size/2)+PAGE_SIZE)/PAGE_SIZE)-1;
|
|
|
o1 = size%PAGE_SIZE;
|
|
|
o2 = (size+(size/4))%PAGE_SIZE;
|
|
|
- DEB_CAP(("size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n",size,m1,m2,m3,o1,o2));
|
|
|
+ DEB_CAP("size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n",
|
|
|
+ size, m1, m2, m3, o1, o2);
|
|
|
break;
|
|
|
}
|
|
|
case 16: {
|
|
@@ -298,7 +301,8 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu
|
|
|
m3 = ((2*size+PAGE_SIZE)/PAGE_SIZE)-1;
|
|
|
o1 = size%PAGE_SIZE;
|
|
|
o2 = (size+(size/2))%PAGE_SIZE;
|
|
|
- DEB_CAP(("size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n",size,m1,m2,m3,o1,o2));
|
|
|
+ DEB_CAP("size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n",
|
|
|
+ size, m1, m2, m3, o1, o2);
|
|
|
break;
|
|
|
}
|
|
|
default: {
|
|
@@ -387,23 +391,23 @@ static int video_begin(struct saa7146_fh *fh)
|
|
|
unsigned int resource;
|
|
|
int ret = 0, err = 0;
|
|
|
|
|
|
- DEB_EE(("dev:%p, fh:%p\n",dev,fh));
|
|
|
+ DEB_EE("dev:%p, fh:%p\n", dev, fh);
|
|
|
|
|
|
if ((vv->video_status & STATUS_CAPTURE) != 0) {
|
|
|
if (vv->video_fh == fh) {
|
|
|
- DEB_S(("already capturing.\n"));
|
|
|
+ DEB_S("already capturing\n");
|
|
|
return 0;
|
|
|
}
|
|
|
- DEB_S(("already capturing in another open.\n"));
|
|
|
+ DEB_S("already capturing in another open\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
|
if ((vv->video_status & STATUS_OVERLAY) != 0) {
|
|
|
- DEB_S(("warning: suspending overlay video for streaming capture.\n"));
|
|
|
+ DEB_S("warning: suspending overlay video for streaming capture\n");
|
|
|
vv->ov_suspend = vv->video_fh;
|
|
|
err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */
|
|
|
if (0 != err) {
|
|
|
- DEB_D(("suspending video failed. aborting\n"));
|
|
|
+ DEB_D("suspending video failed. aborting\n");
|
|
|
return err;
|
|
|
}
|
|
|
}
|
|
@@ -420,7 +424,7 @@ static int video_begin(struct saa7146_fh *fh)
|
|
|
|
|
|
ret = saa7146_res_get(fh, resource);
|
|
|
if (0 == ret) {
|
|
|
- DEB_S(("cannot get capture resource %d\n",resource));
|
|
|
+ DEB_S("cannot get capture resource %d\n", resource);
|
|
|
if (vv->ov_suspend != NULL) {
|
|
|
saa7146_start_preview(vv->ov_suspend);
|
|
|
vv->ov_suspend = NULL;
|
|
@@ -448,15 +452,15 @@ static int video_end(struct saa7146_fh *fh, struct file *file)
|
|
|
unsigned long flags;
|
|
|
unsigned int resource;
|
|
|
u32 dmas = 0;
|
|
|
- DEB_EE(("dev:%p, fh:%p\n",dev,fh));
|
|
|
+ DEB_EE("dev:%p, fh:%p\n", dev, fh);
|
|
|
|
|
|
if ((vv->video_status & STATUS_CAPTURE) != STATUS_CAPTURE) {
|
|
|
- DEB_S(("not capturing.\n"));
|
|
|
+ DEB_S("not capturing\n");
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
if (vv->video_fh != fh) {
|
|
|
- DEB_S(("capturing, but in another open.\n"));
|
|
|
+ DEB_S("capturing, but in another open\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
@@ -530,7 +534,7 @@ static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *f
|
|
|
struct saa7146_vv *vv = dev->vv_data;
|
|
|
struct saa7146_format *fmt;
|
|
|
|
|
|
- DEB_EE(("VIDIOC_S_FBUF\n"));
|
|
|
+ DEB_EE("VIDIOC_S_FBUF\n");
|
|
|
|
|
|
if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RAWIO))
|
|
|
return -EPERM;
|
|
@@ -542,13 +546,13 @@ static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *f
|
|
|
|
|
|
/* planar formats are not allowed for overlay video, clipping and video dma would clash */
|
|
|
if (fmt->flags & FORMAT_IS_PLANAR)
|
|
|
- DEB_S(("planar pixelformat '%4.4s' not allowed for overlay\n",
|
|
|
- (char *)&fmt->pixelformat));
|
|
|
+ DEB_S("planar pixelformat '%4.4s' not allowed for overlay\n",
|
|
|
+ (char *)&fmt->pixelformat);
|
|
|
|
|
|
/* check if overlay is running */
|
|
|
if (IS_OVERLAY_ACTIVE(fh) != 0) {
|
|
|
if (vv->video_fh != fh) {
|
|
|
- DEB_D(("refusing to change framebuffer informations while overlay is active in another open.\n"));
|
|
|
+ DEB_D("refusing to change framebuffer informations while overlay is active in another open\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
}
|
|
@@ -559,7 +563,7 @@ static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *f
|
|
|
|
|
|
if (vv->ov_fb.fmt.bytesperline < vv->ov_fb.fmt.width) {
|
|
|
vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8;
|
|
|
- DEB_D(("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline));
|
|
|
+ DEB_D("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline);
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
@@ -588,7 +592,7 @@ static int vidioc_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *
|
|
|
if (ctrl == NULL)
|
|
|
return -EINVAL;
|
|
|
|
|
|
- DEB_EE(("VIDIOC_QUERYCTRL: id:%d\n", c->id));
|
|
|
+ DEB_EE("VIDIOC_QUERYCTRL: id:%d\n", c->id);
|
|
|
*c = *ctrl;
|
|
|
return 0;
|
|
|
}
|
|
@@ -607,25 +611,25 @@ static int vidioc_g_ctrl(struct file *file, void *fh, struct v4l2_control *c)
|
|
|
case V4L2_CID_BRIGHTNESS:
|
|
|
value = saa7146_read(dev, BCS_CTRL);
|
|
|
c->value = 0xff & (value >> 24);
|
|
|
- DEB_D(("V4L2_CID_BRIGHTNESS: %d\n", c->value));
|
|
|
+ DEB_D("V4L2_CID_BRIGHTNESS: %d\n", c->value);
|
|
|
break;
|
|
|
case V4L2_CID_CONTRAST:
|
|
|
value = saa7146_read(dev, BCS_CTRL);
|
|
|
c->value = 0x7f & (value >> 16);
|
|
|
- DEB_D(("V4L2_CID_CONTRAST: %d\n", c->value));
|
|
|
+ DEB_D("V4L2_CID_CONTRAST: %d\n", c->value);
|
|
|
break;
|
|
|
case V4L2_CID_SATURATION:
|
|
|
value = saa7146_read(dev, BCS_CTRL);
|
|
|
c->value = 0x7f & (value >> 0);
|
|
|
- DEB_D(("V4L2_CID_SATURATION: %d\n", c->value));
|
|
|
+ DEB_D("V4L2_CID_SATURATION: %d\n", c->value);
|
|
|
break;
|
|
|
case V4L2_CID_VFLIP:
|
|
|
c->value = vv->vflip;
|
|
|
- DEB_D(("V4L2_CID_VFLIP: %d\n", c->value));
|
|
|
+ DEB_D("V4L2_CID_VFLIP: %d\n", c->value);
|
|
|
break;
|
|
|
case V4L2_CID_HFLIP:
|
|
|
c->value = vv->hflip;
|
|
|
- DEB_D(("V4L2_CID_HFLIP: %d\n", c->value));
|
|
|
+ DEB_D("V4L2_CID_HFLIP: %d\n", c->value);
|
|
|
break;
|
|
|
default:
|
|
|
return -EINVAL;
|
|
@@ -641,7 +645,7 @@ static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
|
|
|
|
|
|
ctrl = ctrl_by_id(c->id);
|
|
|
if (NULL == ctrl) {
|
|
|
- DEB_D(("unknown control %d\n", c->id));
|
|
|
+ DEB_D("unknown control %d\n", c->id);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
@@ -686,14 +690,14 @@ static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
|
|
|
case V4L2_CID_HFLIP:
|
|
|
/* fixme: we can support changing VFLIP and HFLIP here... */
|
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
|
- DEB_D(("V4L2_CID_HFLIP while active capture.\n"));
|
|
|
+ DEB_D("V4L2_CID_HFLIP while active capture\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
vv->hflip = c->value;
|
|
|
break;
|
|
|
case V4L2_CID_VFLIP:
|
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
|
- DEB_D(("V4L2_CID_VFLIP while active capture.\n"));
|
|
|
+ DEB_D("V4L2_CID_VFLIP while active capture\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
vv->vflip = c->value;
|
|
@@ -748,7 +752,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_forma
|
|
|
int maxw, maxh;
|
|
|
int calc_bpl;
|
|
|
|
|
|
- DEB_EE(("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh));
|
|
|
+ DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh);
|
|
|
|
|
|
fmt = saa7146_format_by_fourcc(dev, f->fmt.pix.pixelformat);
|
|
|
if (NULL == fmt)
|
|
@@ -777,7 +781,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_forma
|
|
|
vv->last_field = V4L2_FIELD_INTERLACED;
|
|
|
break;
|
|
|
default:
|
|
|
- DEB_D(("no known field mode '%d'.\n", field));
|
|
|
+ DEB_D("no known field mode '%d'\n", field);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
@@ -796,8 +800,9 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_forma
|
|
|
f->fmt.pix.bytesperline = calc_bpl;
|
|
|
|
|
|
f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * f->fmt.pix.height;
|
|
|
- DEB_D(("w:%d, h:%d, bytesperline:%d, sizeimage:%d\n", f->fmt.pix.width,
|
|
|
- f->fmt.pix.height, f->fmt.pix.bytesperline, f->fmt.pix.sizeimage));
|
|
|
+ DEB_D("w:%d, h:%d, bytesperline:%d, sizeimage:%d\n",
|
|
|
+ f->fmt.pix.width, f->fmt.pix.height,
|
|
|
+ f->fmt.pix.bytesperline, f->fmt.pix.sizeimage);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -811,22 +816,23 @@ static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_f
|
|
|
enum v4l2_field field;
|
|
|
int maxw, maxh;
|
|
|
|
|
|
- DEB_EE(("dev:%p\n", dev));
|
|
|
+ DEB_EE("dev:%p\n", dev);
|
|
|
|
|
|
if (NULL == vv->ov_fb.base) {
|
|
|
- DEB_D(("no fb base set.\n"));
|
|
|
+ DEB_D("no fb base set\n");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (NULL == vv->ov_fmt) {
|
|
|
- DEB_D(("no fb fmt set.\n"));
|
|
|
+ DEB_D("no fb fmt set\n");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (win->w.width < 48 || win->w.height < 32) {
|
|
|
- DEB_D(("min width/height. (%d,%d)\n", win->w.width, win->w.height));
|
|
|
+ DEB_D("min width/height. (%d,%d)\n",
|
|
|
+ win->w.width, win->w.height);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (win->clipcount > 16) {
|
|
|
- DEB_D(("clipcount too big.\n"));
|
|
|
+ DEB_D("clipcount too big\n");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
@@ -848,7 +854,7 @@ static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_f
|
|
|
case V4L2_FIELD_INTERLACED:
|
|
|
break;
|
|
|
default:
|
|
|
- DEB_D(("no known field mode '%d'.\n", field));
|
|
|
+ DEB_D("no known field mode '%d'\n", field);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
@@ -868,16 +874,17 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *__fh, struct v4l2_forma
|
|
|
struct saa7146_vv *vv = dev->vv_data;
|
|
|
int err;
|
|
|
|
|
|
- DEB_EE(("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh));
|
|
|
+ DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh);
|
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
|
- DEB_EE(("streaming capture is active\n"));
|
|
|
+ DEB_EE("streaming capture is active\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
err = vidioc_try_fmt_vid_cap(file, fh, f);
|
|
|
if (0 != err)
|
|
|
return err;
|
|
|
fh->video_fmt = f->fmt.pix;
|
|
|
- DEB_EE(("set to pixelformat '%4.4s'\n", (char *)&fh->video_fmt.pixelformat));
|
|
|
+ DEB_EE("set to pixelformat '%4.4s'\n",
|
|
|
+ (char *)&fh->video_fmt.pixelformat);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -888,7 +895,7 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *__fh, struct v4l2_f
|
|
|
struct saa7146_vv *vv = dev->vv_data;
|
|
|
int err;
|
|
|
|
|
|
- DEB_EE(("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n", dev, fh));
|
|
|
+ DEB_EE("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n", dev, fh);
|
|
|
err = vidioc_try_fmt_vid_overlay(file, fh, f);
|
|
|
if (0 != err)
|
|
|
return err;
|
|
@@ -931,7 +938,7 @@ static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm)
|
|
|
if (e->index < 0 )
|
|
|
return -EINVAL;
|
|
|
if( e->index < dev->ext_vv_data->num_stds ) {
|
|
|
- DEB_EE(("VIDIOC_ENUMSTD: index:%d\n",e->index));
|
|
|
+ DEB_EE("VIDIOC_ENUMSTD: index:%d\n", e->index);
|
|
|
v4l2_video_std_construct(e, dev->ext_vv_data->stds[e->index].id, dev->ext_vv_data->stds[e->index].name);
|
|
|
return 0;
|
|
|
}
|
|
@@ -946,10 +953,10 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
|
|
|
int found = 0;
|
|
|
int err, i;
|
|
|
|
|
|
- DEB_EE(("VIDIOC_S_STD\n"));
|
|
|
+ DEB_EE("VIDIOC_S_STD\n");
|
|
|
|
|
|
if ((vv->video_status & STATUS_CAPTURE) == STATUS_CAPTURE) {
|
|
|
- DEB_D(("cannot change video standard while streaming capture is active\n"));
|
|
|
+ DEB_D("cannot change video standard while streaming capture is active\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
@@ -957,7 +964,7 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
|
|
|
vv->ov_suspend = vv->video_fh;
|
|
|
err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */
|
|
|
if (0 != err) {
|
|
|
- DEB_D(("suspending video failed. aborting\n"));
|
|
|
+ DEB_D("suspending video failed. aborting\n");
|
|
|
return err;
|
|
|
}
|
|
|
}
|
|
@@ -978,11 +985,11 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
|
|
|
}
|
|
|
|
|
|
if (!found) {
|
|
|
- DEB_EE(("VIDIOC_S_STD: standard not found.\n"));
|
|
|
+ DEB_EE("VIDIOC_S_STD: standard not found\n");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- DEB_EE(("VIDIOC_S_STD: set to standard to '%s'\n", vv->standard->name));
|
|
|
+ DEB_EE("VIDIOC_S_STD: set to standard to '%s'\n", vv->standard->name);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -990,7 +997,7 @@ static int vidioc_overlay(struct file *file, void *fh, unsigned int on)
|
|
|
{
|
|
|
int err;
|
|
|
|
|
|
- DEB_D(("VIDIOC_OVERLAY on:%d\n", on));
|
|
|
+ DEB_D("VIDIOC_OVERLAY on:%d\n", on);
|
|
|
if (on)
|
|
|
err = saa7146_start_preview(fh);
|
|
|
else
|
|
@@ -1047,7 +1054,7 @@ static int vidioc_streamon(struct file *file, void *__fh, enum v4l2_buf_type typ
|
|
|
struct saa7146_fh *fh = __fh;
|
|
|
int err;
|
|
|
|
|
|
- DEB_D(("VIDIOC_STREAMON, type:%d\n", type));
|
|
|
+ DEB_D("VIDIOC_STREAMON, type:%d\n", type);
|
|
|
|
|
|
err = video_begin(fh);
|
|
|
if (err)
|
|
@@ -1066,18 +1073,18 @@ static int vidioc_streamoff(struct file *file, void *__fh, enum v4l2_buf_type ty
|
|
|
struct saa7146_vv *vv = dev->vv_data;
|
|
|
int err;
|
|
|
|
|
|
- DEB_D(("VIDIOC_STREAMOFF, type:%d\n", type));
|
|
|
+ DEB_D("VIDIOC_STREAMOFF, type:%d\n", type);
|
|
|
|
|
|
/* ugly: we need to copy some checks from video_end(),
|
|
|
because videobuf_streamoff() relies on the capture running.
|
|
|
check and fix this */
|
|
|
if ((vv->video_status & STATUS_CAPTURE) != STATUS_CAPTURE) {
|
|
|
- DEB_S(("not capturing.\n"));
|
|
|
+ DEB_S("not capturing\n");
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
if (vv->video_fh != fh) {
|
|
|
- DEB_S(("capturing, but in another open.\n"));
|
|
|
+ DEB_S("capturing, but in another open\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|
|
@@ -1087,7 +1094,7 @@ static int vidioc_streamoff(struct file *file, void *__fh, enum v4l2_buf_type ty
|
|
|
else if (type == V4L2_BUF_TYPE_VBI_CAPTURE)
|
|
|
err = videobuf_streamoff(&fh->vbi_q);
|
|
|
if (0 != err) {
|
|
|
- DEB_D(("warning: videobuf_streamoff() failed.\n"));
|
|
|
+ DEB_D("warning: videobuf_streamoff() failed\n");
|
|
|
video_end(fh, file);
|
|
|
} else {
|
|
|
err = video_end(fh, file);
|
|
@@ -1174,25 +1181,27 @@ static int buffer_prepare(struct videobuf_queue *q,
|
|
|
struct saa7146_buf *buf = (struct saa7146_buf *)vb;
|
|
|
int size,err = 0;
|
|
|
|
|
|
- DEB_CAP(("vbuf:%p\n",vb));
|
|
|
+ DEB_CAP("vbuf:%p\n", vb);
|
|
|
|
|
|
/* sanity checks */
|
|
|
if (fh->video_fmt.width < 48 ||
|
|
|
fh->video_fmt.height < 32 ||
|
|
|
fh->video_fmt.width > vv->standard->h_max_out ||
|
|
|
fh->video_fmt.height > vv->standard->v_max_out) {
|
|
|
- DEB_D(("w (%d) / h (%d) out of bounds.\n",fh->video_fmt.width,fh->video_fmt.height));
|
|
|
+ DEB_D("w (%d) / h (%d) out of bounds\n",
|
|
|
+ fh->video_fmt.width, fh->video_fmt.height);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
size = fh->video_fmt.sizeimage;
|
|
|
if (0 != buf->vb.baddr && buf->vb.bsize < size) {
|
|
|
- DEB_D(("size mismatch.\n"));
|
|
|
+ DEB_D("size mismatch\n");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- DEB_CAP(("buffer_prepare [size=%dx%d,bytes=%d,fields=%s]\n",
|
|
|
- fh->video_fmt.width,fh->video_fmt.height,size,v4l2_field_names[fh->video_fmt.field]));
|
|
|
+ DEB_CAP("buffer_prepare [size=%dx%d,bytes=%d,fields=%s]\n",
|
|
|
+ fh->video_fmt.width, fh->video_fmt.height,
|
|
|
+ size, v4l2_field_names[fh->video_fmt.field]);
|
|
|
if (buf->vb.width != fh->video_fmt.width ||
|
|
|
buf->vb.bytesperline != fh->video_fmt.bytesperline ||
|
|
|
buf->vb.height != fh->video_fmt.height ||
|
|
@@ -1238,7 +1247,7 @@ static int buffer_prepare(struct videobuf_queue *q,
|
|
|
return 0;
|
|
|
|
|
|
oops:
|
|
|
- DEB_D(("error out.\n"));
|
|
|
+ DEB_D("error out\n");
|
|
|
saa7146_dma_free(dev,q,buf);
|
|
|
|
|
|
return err;
|
|
@@ -1259,7 +1268,7 @@ static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned
|
|
|
*count = (max_memory*1048576) / *size;
|
|
|
}
|
|
|
|
|
|
- DEB_CAP(("%d buffers, %d bytes each.\n",*count,*size));
|
|
|
+ DEB_CAP("%d buffers, %d bytes each\n", *count, *size);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -1272,7 +1281,7 @@ static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
|
|
|
struct saa7146_vv *vv = dev->vv_data;
|
|
|
struct saa7146_buf *buf = (struct saa7146_buf *)vb;
|
|
|
|
|
|
- DEB_CAP(("vbuf:%p\n",vb));
|
|
|
+ DEB_CAP("vbuf:%p\n", vb);
|
|
|
saa7146_buffer_queue(fh->dev,&vv->video_q,buf);
|
|
|
}
|
|
|
|
|
@@ -1283,7 +1292,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
|
|
|
struct saa7146_dev *dev = fh->dev;
|
|
|
struct saa7146_buf *buf = (struct saa7146_buf *)vb;
|
|
|
|
|
|
- DEB_CAP(("vbuf:%p\n",vb));
|
|
|
+ DEB_CAP("vbuf:%p\n", vb);
|
|
|
|
|
|
saa7146_dma_free(dev,q,buf);
|
|
|
|
|
@@ -1368,7 +1377,7 @@ static void video_irq_done(struct saa7146_dev *dev, unsigned long st)
|
|
|
struct saa7146_dmaqueue *q = &vv->video_q;
|
|
|
|
|
|
spin_lock(&dev->slock);
|
|
|
- DEB_CAP(("called.\n"));
|
|
|
+ DEB_CAP("called\n");
|
|
|
|
|
|
/* only finish the buffer if we have one... */
|
|
|
if( NULL != q->curr ) {
|
|
@@ -1386,15 +1395,15 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo
|
|
|
struct saa7146_vv *vv = dev->vv_data;
|
|
|
ssize_t ret = 0;
|
|
|
|
|
|
- DEB_EE(("called.\n"));
|
|
|
+ DEB_EE("called\n");
|
|
|
|
|
|
if ((vv->video_status & STATUS_CAPTURE) != 0) {
|
|
|
/* fixme: should we allow read() captures while streaming capture? */
|
|
|
if (vv->video_fh == fh) {
|
|
|
- DEB_S(("already capturing.\n"));
|
|
|
+ DEB_S("already capturing\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
- DEB_S(("already capturing in another open.\n"));
|
|
|
+ DEB_S("already capturing in another open\n");
|
|
|
return -EBUSY;
|
|
|
}
|
|
|
|