summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-06-22 13:57:31 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-06-22 13:57:31 +0200
commit92283451cab7a6739b867c55024aa6c38e0342dc (patch)
tree015252c8a35fd028b1dd7ec6d6ba5836dc65ff9b /linux/drivers/media/video
parentb37f653a50cd90598a56f6c60c839ef62f5e8545 (diff)
downloadmediapointer-dvb-s2-92283451cab7a6739b867c55024aa6c38e0342dc.tar.gz
mediapointer-dvb-s2-92283451cab7a6739b867c55024aa6c38e0342dc.tar.bz2
cx18/ivtv: ioctl debugging improvements
From: Hans Verkuil <hverkuil@xs4all.nl> Completely rely on the video_ioctl2 debugging facilities rather than doing it ourselves. Fill in some missing fields in ivtv with VIDIOC_G_FBUF. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/cx18/cx18-controls.c16
-rw-r--r--linux/drivers/media/video/cx18/cx18-ioctl.c97
-rw-r--r--linux/drivers/media/video/cx18/cx18-streams.c4
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-controls.c16
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-ioctl.c21
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-streams.c4
-rw-r--r--linux/drivers/media/video/ivtv/ivtvfb.c3
7 files changed, 33 insertions, 128 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-controls.c b/linux/drivers/media/video/cx18/cx18-controls.c
index 6eae75f4e..01ba9ca37 100644
--- a/linux/drivers/media/video/cx18/cx18-controls.c
+++ b/linux/drivers/media/video/cx18/cx18-controls.c
@@ -56,8 +56,6 @@ int cx18_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl)
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
const char *name;
- CX18_DEBUG_IOCTL("VIDIOC_QUERYCTRL(%08x)\n", qctrl->id);
-
qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
if (qctrl->id == 0)
return -EINVAL;
@@ -94,10 +92,8 @@ int cx18_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl)
int cx18_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu)
{
- struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_queryctrl qctrl;
- CX18_DEBUG_IOCTL("VIDIOC_QUERYMENU\n");
qctrl.id = qmenu->id;
cx18_queryctrl(file, fh, &qctrl);
return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id));
@@ -108,14 +104,11 @@ int cx18_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
int ret;
- s32 v = vctrl->value;
ret = v4l2_prio_check(&cx->prio, &id->prio);
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_CTRL(%08x, %x)\n", vctrl->id, v);
-
switch (vctrl->id) {
/* Standard V4L2 controls */
case V4L2_CID_BRIGHTNESS:
@@ -133,7 +126,7 @@ int cx18_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl);
default:
- CX18_DEBUG_IOCTL("invalid control %x\n", vctrl->id);
+ CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
return -EINVAL;
}
return 0;
@@ -143,8 +136,6 @@ int cx18_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_CTRL(%08x)\n", vctrl->id);
-
switch (vctrl->id) {
/* Standard V4L2 controls */
case V4L2_CID_BRIGHTNESS:
@@ -161,7 +152,7 @@ int cx18_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
case V4L2_CID_AUDIO_LOUDNESS:
return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl);
default:
- CX18_DEBUG_IOCTL("invalid control %x\n", vctrl->id);
+ CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
return -EINVAL;
}
return 0;
@@ -227,7 +218,6 @@ int cx18_g_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
}
return err;
}
- CX18_DEBUG_IOCTL("VIDIOC_G_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(&cx->params, 0, c, VIDIOC_G_EXT_CTRLS);
return -EINVAL;
@@ -260,7 +250,6 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
}
return err;
}
- CX18_DEBUG_IOCTL("VIDIOC_S_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) {
struct cx2341x_mpeg_params p = cx->params;
int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing),
@@ -296,7 +285,6 @@ int cx18_try_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(&cx->params,
atomic_read(&cx->ana_capturing),
diff --git a/linux/drivers/media/video/cx18/cx18-ioctl.c b/linux/drivers/media/video/cx18/cx18-ioctl.c
index 90712f4cd..078f3cd7d 100644
--- a/linux/drivers/media/video/cx18/cx18-ioctl.c
+++ b/linux/drivers/media/video/cx18/cx18-ioctl.c
@@ -180,8 +180,6 @@ static int cx18_g_fmt_vbi_cap(struct file *file, void *fh,
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_vbi_format *vbifmt = &fmt->fmt.vbi;
- CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
vbifmt->sampling_rate = 27000000;
vbifmt->offset = 248;
vbifmt->samples_per_line = cx->vbi.raw_decoder_line_size - 4;
@@ -203,8 +201,6 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, void *fh,
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
- CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_SLICED_VBI_CAPTURE\n");
-
vbifmt->reserved[0] = 0;
vbifmt->reserved[1] = 0;
vbifmt->io_size = sizeof(struct v4l2_sliced_vbi_data) * 36;
@@ -227,8 +223,6 @@ static int cx18_try_fmt_vid_cap(struct file *file, void *fh,
int w = fmt->fmt.pix.width;
int h = fmt->fmt.pix.height;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
w = min(w, 720);
w = max(w, 1);
h = min(h, cx->is_50hz ? 576 : 480);
@@ -242,10 +236,6 @@ static int cx18_try_fmt_vid_cap(struct file *file, void *fh,
static int cx18_try_fmt_vbi_cap(struct file *file, void *fh,
struct v4l2_format *fmt)
{
- struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
-
- CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
return cx18_g_fmt_vbi_cap(file, fh, fmt);
}
@@ -257,8 +247,6 @@ static int cx18_try_fmt_sliced_vbi_cap(struct file *file, void *fh,
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_SLICED_VBI_CAPTURE\n");
-
vbifmt->io_size = sizeof(struct v4l2_sliced_vbi_data) * 36;
vbifmt->reserved[0] = 0;
vbifmt->reserved[1] = 0;
@@ -286,8 +274,6 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
ret = cx18_try_fmt_vid_cap(file, fh, fmt);
if (ret)
return ret;
@@ -315,8 +301,6 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
if (id->type == CX18_ENC_STREAM_TYPE_VBI &&
cx->vbi.sliced_in->service_set &&
atomic_read(&cx->ana_capturing) > 0)
@@ -341,8 +325,6 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_SLICED_VBI_CAPTURE\n");
-
ret = cx18_try_fmt_sliced_vbi_cap(file, fh, fmt);
if (ret)
return ret;
@@ -366,8 +348,6 @@ static int cx18_g_chip_ident(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_CHIP_IDENT\n");
-
chip->ident = V4L2_IDENT_NONE;
chip->revision = 0;
if (chip->match_type == V4L2_CHIP_MATCH_HOST) {
@@ -389,8 +369,6 @@ static int cx18_g_register(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_DBG_G_REGISTER\n");
-
if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg);
if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
@@ -405,8 +383,6 @@ static int cx18_s_register(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_DBG_S_REGISTER\n");
-
if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg);
if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
@@ -420,8 +396,6 @@ static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_PRIORITY\n");
-
*p = v4l2_prio_max(&cx->prio);
return 0;
}
@@ -431,8 +405,6 @@ static int cx18_s_priority(struct file *file, void *fh, enum v4l2_priority prio)
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
- CX18_DEBUG_IOCTL("VIDIOC_S_PRIORITY\n");
-
return v4l2_prio_change(&cx->prio, &id->prio, prio);
}
@@ -441,8 +413,6 @@ static int cx18_querycap(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_QUERYCAP\n");
-
strlcpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver));
strlcpy(vcap->card, cx->card_name, sizeof(vcap->card));
strlcpy(vcap->bus_info, pci_name(cx->dev), sizeof(vcap->bus_info));
@@ -455,8 +425,6 @@ static int cx18_enumaudio(struct file *file, void *fh, struct v4l2_audio *vin)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENUMAUDIO\n");
-
return cx18_get_audio_input(cx, vin->index, vin);
}
@@ -464,8 +432,6 @@ static int cx18_g_audio(struct file *file, void *fh, struct v4l2_audio *vin)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_AUDIO\n");
-
vin->index = cx->audio_input;
return cx18_get_audio_input(cx, vin->index, vin);
}
@@ -474,8 +440,6 @@ static int cx18_s_audio(struct file *file, void *fh, struct v4l2_audio *vout)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_S_AUDIO\n");
-
if (vout->index >= cx->nof_audio_inputs)
return -EINVAL;
cx->audio_input = vout->index;
@@ -487,8 +451,6 @@ static int cx18_enum_input(struct file *file, void *fh, struct v4l2_input *vin)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENUMINPUT\n");
-
/* set it to defaults from our table */
return cx18_get_input(cx, vin->index, vin);
}
@@ -498,8 +460,6 @@ static int cx18_cropcap(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_CROPCAP\n");
-
if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
cropcap->bounds.top = cropcap->bounds.left = 0;
@@ -521,8 +481,6 @@ static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_CROP\n");
-
if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
return cx18_av_cmd(cx, VIDIOC_S_CROP, crop);
@@ -532,8 +490,6 @@ static int cx18_g_crop(struct file *file, void *fh, struct v4l2_crop *crop)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_CROP\n");
-
if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
return cx18_av_cmd(cx, VIDIOC_G_CROP, crop);
@@ -551,10 +507,6 @@ static int cx18_enum_fmt_vid_cap(struct file *file, void *fh,
}
};
- struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
-
- CX18_DEBUG_IOCTL("VIDIOC_ENUM_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
if (fmt->index > 1)
return -EINVAL;
*fmt = formats[fmt->index];
@@ -565,8 +517,6 @@ static int cx18_g_input(struct file *file, void *fh, unsigned int *i)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_INPUT\n");
-
*i = cx->active_input;
return 0;
}
@@ -581,8 +531,6 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_INPUT\n");
-
if (inp < 0 || inp >= cx->nof_inputs)
return -EINVAL;
@@ -612,8 +560,6 @@ static int cx18_g_frequency(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_FREQUENCY\n");
-
if (vf->tuner != 0)
return -EINVAL;
@@ -631,8 +577,6 @@ int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FREQUENCY\n");
-
if (vf->tuner != 0)
return -EINVAL;
@@ -647,8 +591,6 @@ static int cx18_g_std(struct file *file, void *fh, v4l2_std_id *std)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_STD\n");
-
*std = cx->std;
return 0;
}
@@ -663,8 +605,6 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_STD\n");
-
if ((*std & V4L2_STD_ALL) == 0)
return -EINVAL;
@@ -706,8 +646,6 @@ static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_TUNER\n");
-
if (vt->index != 0)
return -EINVAL;
@@ -721,8 +659,6 @@ static int cx18_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_TUNER\n");
-
if (vt->index != 0)
return -EINVAL;
@@ -748,8 +684,6 @@ static int cx18_g_sliced_vbi_cap(struct file *file, void *fh,
int set = cx->is_50hz ? V4L2_SLICED_VBI_625 : V4L2_SLICED_VBI_525;
int f, l;
- CX18_DEBUG_IOCTL("VIDIOC_G_SLICED_VBI_CAP\n");
-
if (cap->type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) {
for (f = 0; f < 2; f++) {
for (l = 0; l < 24; l++) {
@@ -771,8 +705,6 @@ static int cx18_g_enc_index(struct file *file, void *fh,
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
int i;
- CX18_DEBUG_IOCTL("VIDIOC_G_ENC_INDEX\n");
-
idx->entries = (cx->pgm_info_write_idx + CX18_MAX_PGM_INDEX
- cx->pgm_info_read_idx) % CX18_MAX_PGM_INDEX;
if (idx->entries > V4L2_ENC_IDX_ENTRIES)
@@ -794,8 +726,6 @@ static int cx18_encoder_cmd(struct file *file, void *fh,
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENCODER_CMD:\n");
-
switch (enc->cmd) {
case V4L2_ENC_CMD_START:
CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n");
@@ -843,8 +773,6 @@ static int cx18_try_encoder_cmd(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_ENCDOER_CMD:\n");
-
switch (enc->cmd) {
case V4L2_ENC_CMD_START:
CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n");
@@ -880,7 +808,6 @@ static int cx18_log_status(struct file *file, void *fh)
struct v4l2_audio audin;
int i;
- CX18_DEBUG_IOCTL("VIDIOC_LOG_STATUS\n");
CX18_INFO("================= START STATUS CARD #%d =================\n", cx->num);
if (cx->hw_flags & CX18_HW_TVEEPROM) {
struct tveeprom tv;
@@ -922,26 +849,13 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg)
switch (cmd) {
case VIDIOC_INT_S_AUDIO_ROUTING: {
struct v4l2_routing *route = arg;
- CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING (%d, %d)\n",
- route->input, route->output);
+
+ CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING(%d, %d)\n",
+ route->input, route->output);
cx18_audio_set_route(cx, route);
break;
}
- case VIDIOC_INT_RESET: {
- u32 val = *(u32 *)arg;
- CX18_DEBUG_IOCTL("VIDIOC_INT_RESET (%#10x)\n", val);
- /* No op right now */
- /* cx18_av_cmd(cx, cmd, arg) */
- /* cx18_call_i2c_clients(cx, cmd, arg) */
- break;
- }
default:
- if (cx18_debug & CX18_DBGFLG_IOCTL) {
- printk(KERN_INFO "cx18%d ioctl: unsupported cmd: ",
- cx->num);
- v4l_printk_ioctl(cmd);
- printk("\n");
- }
return -EINVAL;
}
return 0;
@@ -950,12 +864,17 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg)
int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
+ struct video_device *vfd = video_devdata(filp);
struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data;
struct cx18 *cx = id->cx;
int res;
mutex_lock(&cx->serialize_lock);
+
+ if (cx18_debug & CX18_DBGFLG_IOCTL)
+ vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
res = video_ioctl2(inode, filp, cmd, arg);
+ vfd->debug = 0;
mutex_unlock(&cx->serialize_lock);
return res;
}
diff --git a/linux/drivers/media/video/cx18/cx18-streams.c b/linux/drivers/media/video/cx18/cx18-streams.c
index 177cd7c3a..deacdb836 100644
--- a/linux/drivers/media/video/cx18/cx18-streams.c
+++ b/linux/drivers/media/video/cx18/cx18-streams.c
@@ -192,8 +192,8 @@ static int cx18_prep_dev(struct cx18 *cx, int type)
s->v4l2dev->type =
VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT |
VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER;
- snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18%d %s",
- cx->num, s->name);
+ snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18-%d",
+ cx->num);
s->v4l2dev->minor = minor;
s->v4l2dev->dev = &cx->dev->dev;
diff --git a/linux/drivers/media/video/ivtv/ivtv-controls.c b/linux/drivers/media/video/ivtv/ivtv-controls.c
index 06723bac9..2df9b0668 100644
--- a/linux/drivers/media/video/ivtv/ivtv-controls.c
+++ b/linux/drivers/media/video/ivtv/ivtv-controls.c
@@ -53,8 +53,6 @@ int ivtv_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl)
struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
const char *name;
- IVTV_DEBUG_IOCTL("VIDIOC_QUERYCTRL(%08x)\n", qctrl->id);
-
qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
if (qctrl->id == 0)
return -EINVAL;
@@ -91,10 +89,8 @@ int ivtv_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl)
int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu)
{
- struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
struct v4l2_queryctrl qctrl;
- IVTV_DEBUG_IOCTL("VIDIOC_QUERYMENU\n");
qctrl.id = qmenu->id;
ivtv_queryctrl(file, fh, &qctrl);
return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id));
@@ -103,9 +99,6 @@ int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu)
int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
{
struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
- s32 v = vctrl->value;
-
- IVTV_DEBUG_IOCTL("VIDIOC_S_CTRL(%08x, %x)\n", vctrl->id, v);
switch (vctrl->id) {
/* Standard V4L2 controls */
@@ -124,7 +117,7 @@ int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
return ivtv_i2c_hw(itv, itv->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl);
default:
- IVTV_DEBUG_IOCTL("invalid control %x\n", vctrl->id);
+ IVTV_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
return -EINVAL;
}
return 0;
@@ -134,8 +127,6 @@ int ivtv_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
{
struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
- IVTV_DEBUG_IOCTL("VIDIOC_G_CTRL(%08x)\n", vctrl->id);
-
switch (vctrl->id) {
/* Standard V4L2 controls */
case V4L2_CID_BRIGHTNESS:
@@ -152,7 +143,7 @@ int ivtv_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
case V4L2_CID_AUDIO_LOUDNESS:
return ivtv_i2c_hw(itv, itv->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl);
default:
- IVTV_DEBUG_IOCTL("invalid control %x\n", vctrl->id);
+ IVTV_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
return -EINVAL;
}
return 0;
@@ -219,7 +210,6 @@ int ivtv_g_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
}
return err;
}
- IVTV_DEBUG_IOCTL("VIDIOC_G_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(&itv->params, 0, c, VIDIOC_G_EXT_CTRLS);
return -EINVAL;
@@ -246,7 +236,6 @@ int ivtv_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
}
return err;
}
- IVTV_DEBUG_IOCTL("VIDIOC_S_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) {
static u32 freqs[3] = { 44100, 48000, 32000 };
struct cx2341x_mpeg_params p = itv->params;
@@ -286,7 +275,6 @@ int ivtv_try_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
{
struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
- IVTV_DEBUG_IOCTL("VIDIOC_TRY_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(&itv->params, atomic_read(&itv->capturing), c, VIDIOC_TRY_EXT_CTRLS);
return -EINVAL;
diff --git a/linux/drivers/media/video/ivtv/ivtv-ioctl.c b/linux/drivers/media/video/ivtv/ivtv-ioctl.c
index aa222056d..8d602cb6b 100644
--- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1336,6 +1336,8 @@ static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY))
return -EINVAL;
+ if (!itv->osd_video_pbase)
+ return -EINVAL;
fb->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_CHROMAKEY |
V4L2_FBUF_CAP_GLOBAL_ALPHA;
@@ -1349,11 +1351,15 @@ static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
fb->fmt.height = itv->osd_rect.height;
fb->fmt.field = V4L2_FIELD_INTERLACED;
fb->fmt.bytesperline = fb->fmt.width;
+ fb->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;
+ fb->fmt.field = V4L2_FIELD_INTERLACED;
+ fb->fmt.priv = 0;
if (fb->fmt.pixelformat != V4L2_PIX_FMT_PAL8)
fb->fmt.bytesperline *= 2;
if (fb->fmt.pixelformat == V4L2_PIX_FMT_RGB32 ||
fb->fmt.pixelformat == V4L2_PIX_FMT_YUV32)
fb->fmt.bytesperline *= 2;
+ fb->fmt.sizeimage = fb->fmt.bytesperline * fb->fmt.height;
fb->base = (void *)itv->osd_video_pbase;
fb->flags = 0;
@@ -1396,6 +1402,8 @@ static int ivtv_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY))
return -EINVAL;
+ if (!itv->osd_video_pbase)
+ return -EINVAL;
itv->osd_global_alpha_state = (fb->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0;
itv->osd_local_alpha_state =
@@ -1744,6 +1752,7 @@ static int ivtv_default(struct file *file, void *fh, int cmd, void *arg)
static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
+ struct video_device *vfd = video_devdata(filp);
struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
int ret;
@@ -1812,13 +1821,11 @@ static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct f
return ret;
}
- if (ivtv_debug & IVTV_DBGFLG_IOCTL) {
- printk(KERN_INFO "ivtv%d ioctl: ", itv->num);
- v4l_printk_ioctl(cmd);
- printk("\n");
- }
-
- return video_ioctl2(inode, filp, cmd, arg);
+ if (ivtv_debug & IVTV_DBGFLG_IOCTL)
+ vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
+ ret = video_ioctl2(inode, filp, cmd, arg);
+ vfd->debug = 0;
+ return ret;
}
int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
diff --git a/linux/drivers/media/video/ivtv/ivtv-streams.c b/linux/drivers/media/video/ivtv/ivtv-streams.c
index d2dd89519..da84b9088 100644
--- a/linux/drivers/media/video/ivtv/ivtv-streams.c
+++ b/linux/drivers/media/video/ivtv/ivtv-streams.c
@@ -217,8 +217,8 @@ static int ivtv_prep_dev(struct ivtv *itv, int type)
if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
s->v4l2dev->type |= VID_TYPE_MPEG_DECODER;
}
- snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "ivtv%d %s",
- itv->num, s->name);
+ snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "ivtv%d",
+ itv->num);
s->v4l2dev->minor = minor;
s->v4l2dev->dev = &itv->dev->dev;
diff --git a/linux/drivers/media/video/ivtv/ivtvfb.c b/linux/drivers/media/video/ivtv/ivtvfb.c
index e8dbee443..14f93341f 100644
--- a/linux/drivers/media/video/ivtv/ivtvfb.c
+++ b/linux/drivers/media/video/ivtv/ivtvfb.c
@@ -789,6 +789,9 @@ static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv)
else
var->pixclock = pixclock;
+ itv->osd_rect.width = var->xres;
+ itv->osd_rect.height = var->yres;
+
IVTVFB_DEBUG_INFO("Display size: %dx%d (virtual %dx%d) @ %dbpp\n",
var->xres, var->yres,
var->xres_virtual, var->yres_virtual,