aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-fb.c
diff options
context:
space:
mode:
authorIan Armstrong <ian@iarmst.demon.co.uk>2007-08-03 08:51:58 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:04:27 -0400
commit68a341a53ab5a3c5b7dad4b226124414c62c124d (patch)
tree08c1459da704bd875c14c528a4ac5a528249721e /drivers/media/video/ivtv/ivtv-fb.c
parentb4b38bd63c07c8927b43c6c378eca1db10fdaf2e (diff)
V4L/DVB (5971): ivtv-fb: framebuffer timings no longer locked on module load
Framebuffer timings are currently locked to the video format in use when the module is loaded. If the video format is then changed, the timings returned by the framebuffer will be for the original format. This patch ensures that the timings returned reflect the current video format. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> 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-fb.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-fb.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fb.c b/drivers/media/video/ivtv/ivtv-fb.c
index 00765da8a6a0..d2cc03172749 100644
--- a/drivers/media/video/ivtv/ivtv-fb.c
+++ b/drivers/media/video/ivtv/ivtv-fb.c
@@ -164,11 +164,6 @@ MODULE_LICENSE("GPL");
164#define IVTV_OSD_BPP_32 0x04 164#define IVTV_OSD_BPP_32 0x04
165 165
166struct osd_info { 166struct osd_info {
167 /* Timing info for modes */
168 u32 pixclock;
169 u32 hlimit;
170 u32 vlimit;
171
172 /* Physical base address */ 167 /* Physical base address */
173 unsigned long video_pbase; 168 unsigned long video_pbase;
174 /* Relative base address (relative to start of decoder memory) */ 169 /* Relative base address (relative to start of decoder memory) */
@@ -579,10 +574,25 @@ static int ivtvfb_get_fix(struct ivtv *itv, struct fb_fix_screeninfo *fix)
579static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv) 574static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv)
580{ 575{
581 struct osd_info *oi = itv->osd_info; 576 struct osd_info *oi = itv->osd_info;
582 int osd_height_limit = itv->is_50hz ? 576 : 480; 577 int osd_height_limit;
578 u32 pixclock, hlimit, vlimit;
583 579
584 IVTV_FB_DEBUG_INFO("ivtvfb_check_var\n"); 580 IVTV_FB_DEBUG_INFO("ivtvfb_check_var\n");
585 581
582 /* Set base references for mode calcs. */
583 if (itv->is_50hz) {
584 pixclock = 84316;
585 hlimit = 776;
586 vlimit = 591;
587 osd_height_limit = 576;
588 }
589 else {
590 pixclock = 83926;
591 hlimit = 776;
592 vlimit = 495;
593 osd_height_limit = 480;
594 }
595
586 /* Check the bits per pixel */ 596 /* Check the bits per pixel */
587 if (osd_compat) { 597 if (osd_compat) {
588 if (var->bits_per_pixel != 32) { 598 if (var->bits_per_pixel != 32) {
@@ -723,8 +733,8 @@ static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv)
723 } 733 }
724 734
725 /* Maintain overall 'size' for a constant refresh rate */ 735 /* Maintain overall 'size' for a constant refresh rate */
726 var->right_margin = oi->hlimit - var->left_margin - var->xres; 736 var->right_margin = hlimit - var->left_margin - var->xres;
727 var->lower_margin = oi->vlimit - var->upper_margin - var->yres; 737 var->lower_margin = vlimit - var->upper_margin - var->yres;
728 738
729 /* Fixed sync times */ 739 /* Fixed sync times */
730 var->hsync_len = 24; 740 var->hsync_len = 24;
@@ -733,9 +743,10 @@ static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv)
733 /* Non-interlaced / interlaced mode is used to switch the OSD filter 743 /* Non-interlaced / interlaced mode is used to switch the OSD filter
734 on or off. Adjust the clock timings to maintain a constant 744 on or off. Adjust the clock timings to maintain a constant
735 vertical refresh rate. */ 745 vertical refresh rate. */
736 var->pixclock = oi->pixclock;
737 if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) 746 if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED)
738 var->pixclock /= 2; 747 var->pixclock = pixclock / 2;
748 else
749 var->pixclock = pixclock;
739 750
740 IVTV_FB_DEBUG_INFO("Display size: %dx%d (virtual %dx%d) @ %dbpp\n", 751 IVTV_FB_DEBUG_INFO("Display size: %dx%d (virtual %dx%d) @ %dbpp\n",
741 var->xres, var->yres, 752 var->xres, var->yres,
@@ -875,18 +886,6 @@ static int ivtvfb_init_vidmode(struct ivtv *itv)
875 struct v4l2_rect start_window; 886 struct v4l2_rect start_window;
876 int max_height; 887 int max_height;
877 888
878 /* Set base references for mode calcs. */
879 if (itv->is_50hz) {
880 oi->pixclock = 84316;
881 oi->hlimit = 776;
882 oi->vlimit = 591;
883 }
884 else {
885 oi->pixclock = 83926;
886 oi->hlimit = 776;
887 oi->vlimit = 495;
888 }
889
890 /* Color mode */ 889 /* Color mode */
891 890
892 if (osd_compat) osd_depth = 32; 891 if (osd_compat) osd_depth = 32;