Lines Matching refs:itv

117 			printk(KERN_INFO "ivtvfb%d " type ": " fmt, itv->instance , ## args); \
123 #define IVTVFB_ERR(fmt, args...) printk(KERN_ERR "ivtvfb%d: " fmt, itv->instance , ## args)
124 #define IVTVFB_WARN(fmt, args...) printk(KERN_WARNING "ivtvfb%d: " fmt, itv->instance , ## args)
125 #define IVTVFB_INFO(fmt, args...) printk(KERN_INFO "ivtvfb%d: " fmt, itv->instance , ## args)
192 static int ivtvfb_get_framebuffer(struct ivtv *itv, u32 *fbbase,
198 ivtv_firmware_check(itv, "ivtvfb_get_framebuffer");
199 rc = ivtv_vapi_result(itv, data, CX2341X_OSD_GET_FRAMEBUFFER, 0);
205 static int ivtvfb_get_osd_coords(struct ivtv *itv,
208 struct osd_info *oi = itv->osd_info;
211 ivtv_vapi_result(itv, data, CX2341X_OSD_GET_OSD_COORDS, 0);
222 static int ivtvfb_set_osd_coords(struct ivtv *itv, const struct ivtv_osd_coords *osd)
224 struct osd_info *oi = itv->osd_info;
231 return ivtv_vapi(itv, CX2341X_OSD_SET_OSD_COORDS, 5,
237 static int ivtvfb_set_display_window(struct ivtv *itv, struct v4l2_rect *ivtv_window)
239 int osd_height_limit = itv->is_out_50hz ? 576 : 480;
265 itv->yuv_info.osd_vis_w = ivtv_window->width;
266 itv->yuv_info.osd_vis_h = ivtv_window->height;
267 itv->yuv_info.osd_x_offset = ivtv_window->left;
268 itv->yuv_info.osd_y_offset = ivtv_window->top;
273 static int ivtvfb_prep_dec_dma_to_device(struct ivtv *itv,
280 mutex_lock(&itv->udma.lock);
282 if (ivtv_udma_setup(itv, ivtv_dest_addr, userbuf, size_in_bytes) <= 0) {
283 mutex_unlock(&itv->udma.lock);
285 size_in_bytes, itv->udma.page_count);
292 size_in_bytes, itv->udma.page_count);
294 ivtv_udma_prepare(itv);
295 prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE);
298 while (test_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags) ||
299 test_bit(IVTV_F_I_UDMA, &itv->i_flags)) {
303 if (got_sig && test_and_clear_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags))
308 finish_wait(&itv->dma_waitq, &wait);
311 ivtv_udma_unmap(itv);
312 mutex_unlock(&itv->udma.lock);
321 static int ivtvfb_prep_frame(struct ivtv *itv, int cmd, void __user *source,
325 struct osd_info *oi = itv->osd_info;
364 return ivtvfb_prep_dec_dma_to_device(itv, dest_offset, source, count);
375 struct ivtv *itv = (struct ivtv *) info->par;
377 IVTV_DECODER_OFFSET + itv->osd_info->video_rbase;
425 dma_err = ivtvfb_prep_dec_dma_to_device(itv,
447 struct ivtv *itv = (struct ivtv *)info->par;
460 if (itv->is_out_50hz && trace > 312)
462 else if (itv->is_out_60hz && trace > 262)
466 vblank.count = itv->last_vsync_field;
475 prepare_to_wait(&itv->vsync_waitq, &wait, TASK_INTERRUPTIBLE);
478 finish_wait(&itv->vsync_waitq, &wait);
488 return ivtvfb_prep_frame(itv, cmd, args.source, args.dest_offset, args.count);
500 static int ivtvfb_set_var(struct ivtv *itv, struct fb_var_screeninfo *var)
502 struct osd_info *oi = itv->osd_info;
545 ivtv_vapi(itv, CX2341X_OSD_SET_PIXEL_FORMAT, 1, 0);
546 ivtv_vapi(itv, CX2341X_OSD_SET_PIXEL_FORMAT, 1, osd_mode);
555 ivtv_vapi(itv, CX2341X_OSD_SET_FLICKER_STATE, 1, 1);
558 ivtv_vapi(itv, CX2341X_OSD_SET_FLICKER_STATE, 1, 0);
565 ivtvfb_get_osd_coords(itv, &ivtv_osd);
572 ivtvfb_set_osd_coords(itv, &ivtv_osd);
587 ivtvfb_set_display_window(itv, &ivtv_window);
590 itv->yuv_info.osd_full_w = ivtv_osd.pixel_stride;
591 itv->yuv_info.osd_full_h = ivtv_osd.lines;
594 itv->yuv_info.yuv_forced_update = 1;
614 static int ivtvfb_get_fix(struct ivtv *itv, struct fb_fix_screeninfo *fix)
616 struct osd_info *oi = itv->osd_info;
636 static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv)
638 struct osd_info *oi = itv->osd_info;
645 if (itv->is_out_50hz) {
776 if (var->upper_margin + var->yres > (itv->is_out_50hz ? 577 : 481))
777 var->upper_margin = 1 + (((itv->is_out_50hz ? 576 : 480) -
796 itv->osd_rect.width = var->xres;
797 itv->osd_rect.height = var->yres;
815 struct ivtv *itv = (struct ivtv *) info->par;
817 return _ivtvfb_check_var(var, itv);
823 struct ivtv *itv = (struct ivtv *) info->par;
834 itv->yuv_info.osd_x_pan = var->xoffset;
835 itv->yuv_info.osd_y_pan = var->yoffset;
837 itv->yuv_info.yuv_forced_update = 1;
839 itv->osd_info->pan_cur = osd_pan_index;
846 struct ivtv *itv = (struct ivtv *) info->par;
850 rc = ivtvfb_set_var(itv, &info->var);
852 ivtvfb_get_fix(itv, &info->fix);
853 ivtv_firmware_check(itv, "ivtvfb_set_par");
862 struct ivtv *itv = (struct ivtv *)info->par;
871 itv->osd_info->palette_cur[regno] = color;
905 struct ivtv *itv = (struct ivtv *)info->par;
910 ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 1);
911 ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_stream, 1);
916 ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 0);
917 ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_stream, 1);
920 ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_stream, 0);
921 ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 0);
924 itv->osd_info->blank_cur = blank_mode;
944 static void ivtvfb_restore(struct ivtv *itv)
946 struct osd_info *oi = itv->osd_info;
949 ivtvfb_set_var(itv, &oi->fbvar_cur);
962 static int ivtvfb_init_vidmode(struct ivtv *itv)
964 struct osd_info *oi = itv->osd_info;
1005 max_height = itv->is_out_50hz ? 576 : 480;
1011 osd_yres : itv->is_out_50hz ? 480 : 400;
1042 _ivtvfb_check_var(&oi->ivtvfb_defined, itv);
1046 ivtvfb_get_fix(itv, &oi->ivtvfb_fix);
1051 oi->ivtvfb_info.par = itv;
1083 static int ivtvfb_init_io(struct ivtv *itv)
1085 struct osd_info *oi = itv->osd_info;
1089 mutex_lock(&itv->serialize_lock);
1090 if (ivtv_init_on_first_open(itv)) {
1091 mutex_unlock(&itv->serialize_lock);
1095 mutex_unlock(&itv->serialize_lock);
1097 if (ivtvfb_get_framebuffer(itv, &oi->video_rbase,
1108 oi->video_pbase = itv->base_addr + IVTV_DECODER_OFFSET + oi->video_rbase;
1109 oi->video_vbase = itv->dec_mem + oi->video_rbase;
1138 static void ivtvfb_release_buffers (struct ivtv *itv)
1140 struct osd_info *oi = itv->osd_info;
1150 itv->osd_info = NULL;
1155 static int ivtvfb_init_card(struct ivtv *itv)
1173 if (itv->osd_info) {
1178 itv->osd_info = kzalloc(sizeof(struct osd_info),
1180 if (itv->osd_info == NULL) {
1186 rc = ivtvfb_init_io(itv);
1188 ivtvfb_release_buffers(itv);
1193 if ((rc = ivtvfb_init_vidmode(itv))) {
1194 ivtvfb_release_buffers(itv);
1199 if (register_framebuffer(&itv->osd_info->ivtvfb_info) < 0) {
1200 ivtvfb_release_buffers(itv);
1204 itv->osd_video_pbase = itv->osd_info->video_pbase;
1207 ivtvfb_set_par(&itv->osd_info->ivtvfb_info);
1214 ivtvfb_blank(FB_BLANK_UNBLANK, &itv->osd_info->ivtvfb_info);
1217 itv->ivtvfb_restore = ivtvfb_restore;
1220 ivtv_udma_alloc(itv);
1221 itv->streams[IVTV_DEC_STREAM_TYPE_YUV].vdev.device_caps |=
1223 itv->streams[IVTV_DEC_STREAM_TYPE_MPG].vdev.device_caps |=
1225 itv->v4l2_cap |= V4L2_CAP_VIDEO_OUTPUT_OVERLAY;
1233 struct ivtv *itv = container_of(v4l2_dev, struct ivtv, v4l2_dev);
1235 if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
1236 if (ivtvfb_init_card(itv) == 0) {
1238 itv->v4l2_dev.name);
1248 struct ivtv *itv = container_of(v4l2_dev, struct ivtv, v4l2_dev);
1249 struct osd_info *oi = itv->osd_info;
1251 if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
1252 itv->streams[IVTV_DEC_STREAM_TYPE_YUV].vdev.device_caps &=
1254 itv->streams[IVTV_DEC_STREAM_TYPE_MPG].vdev.device_caps &=
1256 itv->v4l2_cap &= ~V4L2_CAP_VIDEO_OUTPUT_OVERLAY;
1257 unregister_framebuffer(&itv->osd_info->ivtvfb_info);
1258 IVTVFB_INFO("Unregister framebuffer %d\n", itv->instance);
1259 itv->ivtvfb_restore = NULL;
1261 ivtvfb_release_buffers(itv);
1262 itv->osd_video_pbase = 0;