提交 defd574e 编写于 作者: O Oliver Endriss 提交者: Mauro Carvalho Chehab

V4L/DVB (5836): dvb-ttpci: re-initialize aspect ratio and pan scan after arm crash

Re-initialize aspect ratio and pan scan after arm crash.
Signed-off-by: NOliver Endriss <o.endriss@gmx.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 804b4458
...@@ -137,6 +137,15 @@ static void init_av7110_av(struct av7110 *av7110) ...@@ -137,6 +137,15 @@ static void init_av7110_av(struct av7110 *av7110)
if (ret < 0) if (ret < 0)
printk("dvb-ttpci:cannot set internal volume to maximum:%d\n",ret); printk("dvb-ttpci:cannot set internal volume to maximum:%d\n",ret);
ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetMonitorType,
1, (u16) av7110->display_ar);
if (ret < 0)
printk("dvb-ttpci: unable to set aspect ratio\n");
ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetPanScanType,
1, av7110->display_panscan);
if (ret < 0)
printk("dvb-ttpci: unable to set pan scan\n");
ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetWSSConfig, 2, 2, wss_cfg_4_3); ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetWSSConfig, 2, 2, wss_cfg_4_3);
if (ret < 0) if (ret < 0)
printk("dvb-ttpci: unable to configure 4:3 wss\n"); printk("dvb-ttpci: unable to configure 4:3 wss\n");
...@@ -2639,12 +2648,12 @@ static int __devinit av7110_attach(struct saa7146_dev* dev, ...@@ -2639,12 +2648,12 @@ static int __devinit av7110_attach(struct saa7146_dev* dev,
av7110->mixer.volume_left = volume; av7110->mixer.volume_left = volume;
av7110->mixer.volume_right = volume; av7110->mixer.volume_right = volume;
init_av7110_av(av7110);
ret = av7110_register(av7110); ret = av7110_register(av7110);
if (ret < 0) if (ret < 0)
goto err_arm_thread_stop_10; goto err_arm_thread_stop_10;
init_av7110_av(av7110);
/* special case DVB-C: these cards have an analog tuner /* special case DVB-C: these cards have an analog tuner
plus need some special handling, so we have separate plus need some special handling, so we have separate
saa7146_ext_vv data for these... */ saa7146_ext_vv data for these... */
......
...@@ -194,6 +194,7 @@ struct av7110 { ...@@ -194,6 +194,7 @@ struct av7110 {
int video_blank; int video_blank;
struct video_status videostate; struct video_status videostate;
u16 display_panscan;
int display_ar; int display_ar;
int trickmode; int trickmode;
#define TRICK_NONE 0 #define TRICK_NONE 0
......
...@@ -1082,19 +1082,18 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, ...@@ -1082,19 +1082,18 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
case VIDEO_SET_DISPLAY_FORMAT: case VIDEO_SET_DISPLAY_FORMAT:
{ {
video_displayformat_t format = (video_displayformat_t) arg; video_displayformat_t format = (video_displayformat_t) arg;
u16 val = 0;
switch (format) { switch (format) {
case VIDEO_PAN_SCAN: case VIDEO_PAN_SCAN:
val = VID_PAN_SCAN_PREF; av7110->display_panscan = VID_PAN_SCAN_PREF;
break; break;
case VIDEO_LETTER_BOX: case VIDEO_LETTER_BOX:
val = VID_VC_AND_PS_PREF; av7110->display_panscan = VID_VC_AND_PS_PREF;
break; break;
case VIDEO_CENTER_CUT_OUT: case VIDEO_CENTER_CUT_OUT:
val = VID_CENTRE_CUT_PREF; av7110->display_panscan = VID_CENTRE_CUT_PREF;
break; break;
default: default:
...@@ -1104,7 +1103,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, ...@@ -1104,7 +1103,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
break; break;
av7110->videostate.display_format = format; av7110->videostate.display_format = format;
ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetPanScanType, ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetPanScanType,
1, (u16) val); 1, av7110->display_panscan);
break; break;
} }
...@@ -1466,8 +1465,9 @@ int av7110_av_register(struct av7110 *av7110) ...@@ -1466,8 +1465,9 @@ int av7110_av_register(struct av7110 *av7110)
av7110->videostate.play_state = VIDEO_STOPPED; av7110->videostate.play_state = VIDEO_STOPPED;
av7110->videostate.stream_source = VIDEO_SOURCE_DEMUX; av7110->videostate.stream_source = VIDEO_SOURCE_DEMUX;
av7110->videostate.video_format = VIDEO_FORMAT_4_3; av7110->videostate.video_format = VIDEO_FORMAT_4_3;
av7110->videostate.display_format = VIDEO_CENTER_CUT_OUT; av7110->videostate.display_format = VIDEO_LETTER_BOX;
av7110->display_ar = VIDEO_FORMAT_4_3; av7110->display_ar = VIDEO_FORMAT_4_3;
av7110->display_panscan = VID_VC_AND_PS_PREF;
init_waitqueue_head(&av7110->video_events.wait_queue); init_waitqueue_head(&av7110->video_events.wait_queue);
spin_lock_init(&av7110->video_events.lock); spin_lock_init(&av7110->video_events.lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册