aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-19 17:59:42 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:05:53 -0400
commit7c03a4488bf6d28078488c70c82357d4286cacc5 (patch)
tree440b0dbadc93d06c70a1aa6176debc259f134113 /drivers/media/video/ivtv/ivtv-ioctl.c
parent8beb058f1ecde7bc0554d18ce1baa18b5dfb02d3 (diff)
V4L/DVB (6061): ivtv: add VIDIOC_OVERLAY
Add VIDIOC_OVERLAY to enable/disable the OSD. Also add the OSD state to the log status report. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-ioctl.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c45
1 files changed, 39 insertions, 6 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);