diff options
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 45 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-streams.c | 6 |
2 files changed, 42 insertions, 9 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index de866d450ecd..ed5707660e0e 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -1217,9 +1217,19 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1217 | break; | 1217 | break; |
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | case VIDIOC_OVERLAY: { | ||
1221 | int *on = arg; | ||
1222 | |||
1223 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) | ||
1224 | return -EINVAL; | ||
1225 | ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, *on != 0); | ||
1226 | break; | ||
1227 | } | ||
1228 | |||
1220 | case VIDIOC_LOG_STATUS: | 1229 | case VIDIOC_LOG_STATUS: |
1221 | { | 1230 | { |
1222 | int has_output = itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT; | 1231 | int has_output = itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT; |
1232 | u32 data[CX2341X_MBOX_MAX_DATA]; | ||
1223 | struct v4l2_input vidin; | 1233 | struct v4l2_input vidin; |
1224 | struct v4l2_audio audin; | 1234 | struct v4l2_audio audin; |
1225 | int i; | 1235 | int i; |
@@ -1234,8 +1244,8 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1234 | ivtv_call_i2c_clients(itv, VIDIOC_LOG_STATUS, NULL); | 1244 | ivtv_call_i2c_clients(itv, VIDIOC_LOG_STATUS, NULL); |
1235 | ivtv_get_input(itv, itv->active_input, &vidin); | 1245 | ivtv_get_input(itv, itv->active_input, &vidin); |
1236 | ivtv_get_audio_input(itv, itv->audio_input, &audin); | 1246 | ivtv_get_audio_input(itv, itv->audio_input, &audin); |
1237 | IVTV_INFO("Video Input: %s\n", vidin.name); | 1247 | IVTV_INFO("Video Input: %s\n", vidin.name); |
1238 | IVTV_INFO("Audio Input: %s%s\n", audin.name, | 1248 | IVTV_INFO("Audio Input: %s%s\n", audin.name, |
1239 | (itv->dualwatch_stereo_mode & ~0x300) == 0x200 ? " (Bilingual)" : ""); | 1249 | (itv->dualwatch_stereo_mode & ~0x300) == 0x200 ? " (Bilingual)" : ""); |
1240 | if (has_output) { | 1250 | if (has_output) { |
1241 | struct v4l2_output vidout; | 1251 | struct v4l2_output vidout; |
@@ -1255,6 +1265,22 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1255 | "Mono", | 1265 | "Mono", |
1256 | "Swapped" | 1266 | "Swapped" |
1257 | }; | 1267 | }; |
1268 | static const char * const alpha_mode[] = { | ||
1269 | "None", | ||
1270 | "Global", | ||
1271 | "Local", | ||
1272 | "Global and Local" | ||
1273 | }; | ||
1274 | static const char * const pixel_format[] = { | ||
1275 | "Indexed", | ||
1276 | "RGB 5:6:5", | ||
1277 | "ARGB 1:5:5:5", | ||
1278 | "ARGB 1:4:4:4", | ||
1279 | "ARGB 8:8:8:8", | ||
1280 | "5", | ||
1281 | "6", | ||
1282 | "7", | ||
1283 | }; | ||
1258 | 1284 | ||
1259 | ivtv_get_output(itv, itv->active_output, &vidout); | 1285 | ivtv_get_output(itv, itv->active_output, &vidout); |
1260 | ivtv_get_audio_output(itv, 0, &audout); | 1286 | ivtv_get_audio_output(itv, 0, &audout); |
@@ -1264,12 +1290,17 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1264 | audio_modes[itv->audio_bilingual_mode]); | 1290 | audio_modes[itv->audio_bilingual_mode]); |
1265 | if (mode < 0 || mode > OUT_PASSTHROUGH) | 1291 | if (mode < 0 || mode > OUT_PASSTHROUGH) |
1266 | mode = OUT_NONE; | 1292 | mode = OUT_NONE; |
1267 | IVTV_INFO("Output Mode: %s\n", output_modes[mode]); | 1293 | IVTV_INFO("Output Mode: %s\n", output_modes[mode]); |
1294 | ivtv_vapi_result(itv, data, CX2341X_OSD_GET_STATE, 0); | ||
1295 | IVTV_INFO("Overlay: %s, Alpha: %s, Pixel Format: %s\n", | ||
1296 | data[0] & 1 ? "On" : "Off", | ||
1297 | alpha_mode[(data[0] >> 1) & 0x3], | ||
1298 | pixel_format[(data[0] >> 3) & 0x7]); | ||
1268 | } | 1299 | } |
1269 | IVTV_INFO("Tuner: %s\n", | 1300 | IVTV_INFO("Tuner: %s\n", |
1270 | test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ? "Radio" : "TV"); | 1301 | test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ? "Radio" : "TV"); |
1271 | cx2341x_log_status(&itv->params, itv->name); | 1302 | cx2341x_log_status(&itv->params, itv->name); |
1272 | IVTV_INFO("Status flags: 0x%08lx\n", itv->i_flags); | 1303 | IVTV_INFO("Status flags: 0x%08lx\n", itv->i_flags); |
1273 | for (i = 0; i < IVTV_MAX_STREAMS; i++) { | 1304 | for (i = 0; i < IVTV_MAX_STREAMS; i++) { |
1274 | struct ivtv_stream *s = &itv->streams[i]; | 1305 | struct ivtv_stream *s = &itv->streams[i]; |
1275 | 1306 | ||
@@ -1279,7 +1310,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1279 | (s->buffers - s->q_free.buffers) * 100 / s->buffers, | 1310 | (s->buffers - s->q_free.buffers) * 100 / s->buffers, |
1280 | (s->buffers * s->buf_size) / 1024, s->buffers); | 1311 | (s->buffers * s->buf_size) / 1024, s->buffers); |
1281 | } | 1312 | } |
1282 | IVTV_INFO("Read MPEG/VBI: %lld/%lld bytes\n", (long long)itv->mpg_data_received, (long long)itv->vbi_data_inserted); | 1313 | IVTV_INFO("Read MPG/VBI: %lld/%lld bytes\n", (long long)itv->mpg_data_received, (long long)itv->vbi_data_inserted); |
1283 | IVTV_INFO("================== END STATUS CARD #%d ==================\n", itv->num); | 1314 | IVTV_INFO("================== END STATUS CARD #%d ==================\n", itv->num); |
1284 | break; | 1315 | break; |
1285 | } | 1316 | } |
@@ -1501,6 +1532,7 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp, | |||
1501 | case VIDIOC_S_AUDOUT: | 1532 | case VIDIOC_S_AUDOUT: |
1502 | case VIDIOC_S_EXT_CTRLS: | 1533 | case VIDIOC_S_EXT_CTRLS: |
1503 | case VIDIOC_S_FBUF: | 1534 | case VIDIOC_S_FBUF: |
1535 | case VIDIOC_OVERLAY: | ||
1504 | ret = v4l2_prio_check(&itv->prio, &id->prio); | 1536 | ret = v4l2_prio_check(&itv->prio, &id->prio); |
1505 | if (ret) | 1537 | if (ret) |
1506 | return ret; | 1538 | return ret; |
@@ -1554,6 +1586,7 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp, | |||
1554 | case VIDIOC_TRY_ENCODER_CMD: | 1586 | case VIDIOC_TRY_ENCODER_CMD: |
1555 | case VIDIOC_G_FBUF: | 1587 | case VIDIOC_G_FBUF: |
1556 | case VIDIOC_S_FBUF: | 1588 | case VIDIOC_S_FBUF: |
1589 | case VIDIOC_OVERLAY: | ||
1557 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) { | 1590 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) { |
1558 | printk(KERN_INFO "ivtv%d ioctl: ", itv->num); | 1591 | printk(KERN_INFO "ivtv%d ioctl: ", itv->num); |
1559 | v4l_printk_ioctl(cmd); | 1592 | v4l_printk_ioctl(cmd); |
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index 65fa247e33c5..ebf925c549fd 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -75,7 +75,7 @@ static struct { | |||
75 | struct file_operations *fops; | 75 | struct file_operations *fops; |
76 | } ivtv_stream_info[] = { | 76 | } ivtv_stream_info[] = { |
77 | { /* IVTV_ENC_STREAM_TYPE_MPG */ | 77 | { /* IVTV_ENC_STREAM_TYPE_MPG */ |
78 | "encoder MPEG", | 78 | "encoder MPG", |
79 | VFL_TYPE_GRABBER, 0, | 79 | VFL_TYPE_GRABBER, 0, |
80 | PCI_DMA_FROMDEVICE, 0, V4L2_BUF_TYPE_VIDEO_CAPTURE, | 80 | PCI_DMA_FROMDEVICE, 0, V4L2_BUF_TYPE_VIDEO_CAPTURE, |
81 | &ivtv_v4l2_enc_fops | 81 | &ivtv_v4l2_enc_fops |
@@ -93,7 +93,7 @@ static struct { | |||
93 | &ivtv_v4l2_enc_fops | 93 | &ivtv_v4l2_enc_fops |
94 | }, | 94 | }, |
95 | { /* IVTV_ENC_STREAM_TYPE_PCM */ | 95 | { /* IVTV_ENC_STREAM_TYPE_PCM */ |
96 | "encoder PCM audio", | 96 | "encoder PCM", |
97 | VFL_TYPE_GRABBER, IVTV_V4L2_ENC_PCM_OFFSET, | 97 | VFL_TYPE_GRABBER, IVTV_V4L2_ENC_PCM_OFFSET, |
98 | PCI_DMA_FROMDEVICE, 0, V4L2_BUF_TYPE_PRIVATE, | 98 | PCI_DMA_FROMDEVICE, 0, V4L2_BUF_TYPE_PRIVATE, |
99 | &ivtv_v4l2_enc_fops | 99 | &ivtv_v4l2_enc_fops |
@@ -105,7 +105,7 @@ static struct { | |||
105 | &ivtv_v4l2_enc_fops | 105 | &ivtv_v4l2_enc_fops |
106 | }, | 106 | }, |
107 | { /* IVTV_DEC_STREAM_TYPE_MPG */ | 107 | { /* IVTV_DEC_STREAM_TYPE_MPG */ |
108 | "decoder MPEG", | 108 | "decoder MPG", |
109 | VFL_TYPE_GRABBER, IVTV_V4L2_DEC_MPG_OFFSET, | 109 | VFL_TYPE_GRABBER, IVTV_V4L2_DEC_MPG_OFFSET, |
110 | PCI_DMA_TODEVICE, 0, V4L2_BUF_TYPE_VIDEO_OUTPUT, | 110 | PCI_DMA_TODEVICE, 0, V4L2_BUF_TYPE_VIDEO_OUTPUT, |
111 | &ivtv_v4l2_dec_fops | 111 | &ivtv_v4l2_dec_fops |