The patch number 8104 was added via Hans Verkuil <[EMAIL PROTECTED]> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: [EMAIL PROTECTED] ------ From: Hans Verkuil <[EMAIL PROTECTED]> cx18/ivtv: ioctl debugging improvements 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 <[EMAIL PROTECTED]> --- linux/drivers/media/video/cx18/cx18-controls.c | 16 -- linux/drivers/media/video/cx18/cx18-ioctl.c | 97 +---------------- linux/drivers/media/video/cx18/cx18-streams.c | 4 linux/drivers/media/video/ivtv/ivtv-controls.c | 16 -- linux/drivers/media/video/ivtv/ivtv-ioctl.c | 21 ++- linux/drivers/media/video/ivtv/ivtv-streams.c | 4 linux/drivers/media/video/ivtv/ivtvfb.c | 3 7 files changed, 33 insertions(+), 128 deletions(-) diff -r da6ab7fadef9 -r 2ea57f76416a linux/drivers/media/video/cx18/cx18-controls.c --- a/linux/drivers/media/video/cx18/cx18-controls.c Sun Jun 22 13:55:09 2008 +0200 +++ b/linux/drivers/media/video/cx18/cx18-controls.c Sun Jun 22 13:57:31 2008 +0200 @@ -56,8 +56,6 @@ int cx18_queryctrl(struct file *file, vo 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, vo 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 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 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; @@ -142,8 +135,6 @@ int cx18_g_ctrl(struct file *file, void 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 */ @@ -161,7 +152,7 @@ int cx18_g_ctrl(struct file *file, void 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, } 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, } 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 { 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 -r da6ab7fadef9 -r 2ea57f76416a linux/drivers/media/video/cx18/cx18-ioctl.c --- a/linux/drivers/media/video/cx18/cx18-ioctl.c Sun Jun 22 13:55:09 2008 +0200 +++ b/linux/drivers/media/video/cx18/cx18-ioctl.c Sun Jun 22 13:57:31 2008 +0200 @@ -180,8 +180,6 @@ static int cx18_g_fmt_vbi_cap(struct fil 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(str 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; @@ -226,8 +222,6 @@ static int cx18_try_fmt_vid_cap(struct f 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); @@ -242,10 +236,6 @@ static int cx18_try_fmt_vbi_cap(struct f 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); } @@ -256,8 +246,6 @@ static int cx18_try_fmt_sliced_vbi_cap(s /* Supported by the cx23418 but not yet implemented. */ 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; @@ -286,8 +274,6 @@ static int cx18_s_fmt_vid_cap(struct fil 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 fil 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) @@ -340,8 +324,6 @@ static int cx18_s_fmt_sliced_vbi_cap(str ret = v4l2_prio_check(&cx->prio, &id->prio); 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) @@ -365,8 +347,6 @@ static int cx18_g_chip_ident(struct file struct v4l2_chip_ident *chip) { 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; @@ -389,8 +369,6 @@ static int cx18_g_register(struct file * { 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 * { 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 * { struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; - CX18_DEBUG_IOCTL("VIDIOC_G_PRIORITY\n"); - *p = v4l2_prio_max(&cx->prio); return 0; } @@ -430,8 +404,6 @@ static int cx18_s_priority(struct file * { 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); } @@ -440,8 +412,6 @@ static int cx18_querycap(struct file *fi struct v4l2_capability *vcap) { 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)); @@ -455,16 +425,12 @@ static int cx18_enumaudio(struct file *f { struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; - CX18_DEBUG_IOCTL("VIDIOC_ENUMAUDIO\n"); - return cx18_get_audio_input(cx, vin->index, vin); } 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 *fil { 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 * { 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); } @@ -497,8 +459,6 @@ static int cx18_cropcap(struct file *fil struct v4l2_cropcap *cropcap) { 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; @@ -521,8 +481,6 @@ static int cx18_s_crop(struct file *file 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); @@ -531,8 +489,6 @@ static int cx18_g_crop(struct file *file 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; @@ -551,10 +507,6 @@ static int cx18_enum_fmt_vid_cap(struct } }; - 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 *fil { struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; - CX18_DEBUG_IOCTL("VIDIOC_G_INPUT\n"); - *i = cx->active_input; return 0; } @@ -580,8 +530,6 @@ int cx18_s_input(struct file *file, void ret = v4l2_prio_check(&cx->prio, &id->prio); 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 { struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; - CX18_DEBUG_IOCTL("VIDIOC_G_FREQUENCY\n"); - if (vf->tuner != 0) return -EINVAL; @@ -630,8 +576,6 @@ int cx18_s_frequency(struct file *file, ret = v4l2_prio_check(&cx->prio, &id->prio); 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, { struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; - CX18_DEBUG_IOCTL("VIDIOC_G_STD\n"); - *std = cx->std; return 0; } @@ -662,8 +604,6 @@ int cx18_s_std(struct file *file, void * ret = v4l2_prio_check(&cx->prio, &id->prio); 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 *fil if (ret) return ret; - CX18_DEBUG_IOCTL("VIDIOC_S_TUNER\n"); - if (vt->index != 0) return -EINVAL; @@ -720,8 +658,6 @@ static int cx18_g_tuner(struct file *fil 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; @@ -747,8 +683,6 @@ static int cx18_g_sliced_vbi_cap(struct struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; 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++) { @@ -770,8 +704,6 @@ static int cx18_g_enc_index(struct file /* Supported by the cx23418 but not yet implemented. */ 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; @@ -793,8 +725,6 @@ static int cx18_encoder_cmd(struct file { 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: @@ -843,8 +773,6 @@ static int cx18_try_encoder_cmd(struct f { 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 * 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 *fil 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 @@ int cx18_v4l2_ioctl(struct inode *inode, 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 -r da6ab7fadef9 -r 2ea57f76416a linux/drivers/media/video/cx18/cx18-streams.c --- a/linux/drivers/media/video/cx18/cx18-streams.c Sun Jun 22 13:55:09 2008 +0200 +++ b/linux/drivers/media/video/cx18/cx18-streams.c Sun Jun 22 13:57:31 2008 +0200 @@ -192,8 +192,8 @@ static int cx18_prep_dev(struct cx18 *cx 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 -r da6ab7fadef9 -r 2ea57f76416a linux/drivers/media/video/ivtv/ivtv-controls.c --- a/linux/drivers/media/video/ivtv/ivtv-controls.c Sun Jun 22 13:55:09 2008 +0200 +++ b/linux/drivers/media/video/ivtv/ivtv-controls.c Sun Jun 22 13:57:31 2008 +0200 @@ -53,8 +53,6 @@ int ivtv_queryctrl(struct file *file, vo 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, vo 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_s_ctrl(struct file *file, void 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 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; @@ -133,8 +126,6 @@ int ivtv_g_ctrl(struct file *file, void 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 */ @@ -152,7 +143,7 @@ int ivtv_g_ctrl(struct file *file, void 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, } 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, } 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 { 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 -r da6ab7fadef9 -r 2ea57f76416a linux/drivers/media/video/ivtv/ivtv-ioctl.c --- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c Sun Jun 22 13:55:09 2008 +0200 +++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c Sun Jun 22 13:57:31 2008 +0200 @@ -1336,6 +1336,8 @@ static int ivtv_g_fbuf(struct file *file 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 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; @@ -1395,6 +1401,8 @@ static int ivtv_s_fbuf(struct file *file struct yuv_playback_info *yi = &itv->yuv_info; 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; @@ -1744,6 +1752,7 @@ static int ivtv_serialized_ioctl(struct 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 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 -r da6ab7fadef9 -r 2ea57f76416a linux/drivers/media/video/ivtv/ivtv-streams.c --- a/linux/drivers/media/video/ivtv/ivtv-streams.c Sun Jun 22 13:55:09 2008 +0200 +++ b/linux/drivers/media/video/ivtv/ivtv-streams.c Sun Jun 22 13:57:31 2008 +0200 @@ -217,8 +217,8 @@ static int ivtv_prep_dev(struct ivtv *it 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 -r da6ab7fadef9 -r 2ea57f76416a linux/drivers/media/video/ivtv/ivtvfb.c --- a/linux/drivers/media/video/ivtv/ivtvfb.c Sun Jun 22 13:55:09 2008 +0200 +++ b/linux/drivers/media/video/ivtv/ivtvfb.c Sun Jun 22 13:57:31 2008 +0200 @@ -789,6 +789,9 @@ static int _ivtvfb_check_var(struct fb_v 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, --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/2ea57f76416afe55e38fc204178e8252fab4860f _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits