diff options
author | Ian Armstrong <ian@iarmst.demon.co.uk> | 2007-10-17 14:09:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-22 10:01:52 -0400 |
commit | 6b1ec9da152c03106aa92fa045f5cf9b7912597c (patch) | |
tree | b1709b2dd97829e3626ee2bf3f9474a0c119bbd8 /drivers | |
parent | 0938e3194ae53d0b22f4031cfe4738e62308c7ce (diff) |
V4L/DVB (6380): ivtvfb: Removal of the 'osd_compat' module option
Due to changes in the core ivtv driver as of release 1.0, the osd_compat
module option has been rendered obsolete. This patch removes the option and
all code associated with it.
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')
-rw-r--r-- | drivers/media/video/ivtv/ivtvfb.c | 73 |
1 files changed, 18 insertions, 55 deletions
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c index 4a7512d90bc9..52ffd154a3d8 100644 --- a/drivers/media/video/ivtv/ivtvfb.c +++ b/drivers/media/video/ivtv/ivtvfb.c | |||
@@ -55,7 +55,6 @@ | |||
55 | static int ivtvfb_card_id = -1; | 55 | static int ivtvfb_card_id = -1; |
56 | static int ivtvfb_debug = 0; | 56 | static int ivtvfb_debug = 0; |
57 | static int osd_laced; | 57 | static int osd_laced; |
58 | static int osd_compat; | ||
59 | static int osd_depth; | 58 | static int osd_depth; |
60 | static int osd_upper; | 59 | static int osd_upper; |
61 | static int osd_left; | 60 | static int osd_left; |
@@ -65,7 +64,6 @@ static int osd_xres; | |||
65 | module_param(ivtvfb_card_id, int, 0444); | 64 | module_param(ivtvfb_card_id, int, 0444); |
66 | module_param_named(debug,ivtvfb_debug, int, 0644); | 65 | module_param_named(debug,ivtvfb_debug, int, 0644); |
67 | module_param(osd_laced, bool, 0444); | 66 | module_param(osd_laced, bool, 0444); |
68 | module_param(osd_compat, bool, 0444); | ||
69 | module_param(osd_depth, int, 0444); | 67 | module_param(osd_depth, int, 0444); |
70 | module_param(osd_upper, int, 0444); | 68 | module_param(osd_upper, int, 0444); |
71 | module_param(osd_left, int, 0444); | 69 | module_param(osd_left, int, 0444); |
@@ -80,12 +78,6 @@ MODULE_PARM_DESC(debug, | |||
80 | "Debug level (bitmask). Default: errors only\n" | 78 | "Debug level (bitmask). Default: errors only\n" |
81 | "\t\t\t(debug = 3 gives full debugging)"); | 79 | "\t\t\t(debug = 3 gives full debugging)"); |
82 | 80 | ||
83 | MODULE_PARM_DESC(osd_compat, | ||
84 | "Compatibility mode - Display size is locked (use for old X drivers)\n" | ||
85 | "\t\t\t0=off\n" | ||
86 | "\t\t\t1=on\n" | ||
87 | "\t\t\tdefault off"); | ||
88 | |||
89 | /* Why upper, left, xres, yres, depth, laced ? To match terminology used | 81 | /* Why upper, left, xres, yres, depth, laced ? To match terminology used |
90 | by fbset. | 82 | by fbset. |
91 | Why start at 1 for left & upper coordinate ? Because X doesn't allow 0 */ | 83 | Why start at 1 for left & upper coordinate ? Because X doesn't allow 0 */ |
@@ -574,14 +566,6 @@ static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv) | |||
574 | osd_height_limit = 480; | 566 | osd_height_limit = 480; |
575 | } | 567 | } |
576 | 568 | ||
577 | /* Check the bits per pixel */ | ||
578 | if (osd_compat) { | ||
579 | if (var->bits_per_pixel != 32) { | ||
580 | IVTVFB_DEBUG_WARN("Invalid colour mode: %d\n", var->bits_per_pixel); | ||
581 | return -EINVAL; | ||
582 | } | ||
583 | } | ||
584 | |||
585 | if (var->bits_per_pixel == 8 || var->bits_per_pixel == 32) { | 569 | if (var->bits_per_pixel == 8 || var->bits_per_pixel == 32) { |
586 | var->transp.offset = 24; | 570 | var->transp.offset = 24; |
587 | var->transp.length = 8; | 571 | var->transp.length = 8; |
@@ -633,32 +617,20 @@ static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv) | |||
633 | } | 617 | } |
634 | 618 | ||
635 | /* Check the resolution */ | 619 | /* Check the resolution */ |
636 | if (osd_compat) { | 620 | if (var->xres > IVTV_OSD_MAX_WIDTH || var->yres > osd_height_limit) { |
637 | if (var->xres != oi->ivtvfb_defined.xres || | 621 | IVTVFB_DEBUG_WARN("Invalid resolution: %dx%d\n", |
638 | var->yres != oi->ivtvfb_defined.yres || | 622 | var->xres, var->yres); |
639 | var->xres_virtual != oi->ivtvfb_defined.xres_virtual || | 623 | return -EINVAL; |
640 | var->yres_virtual != oi->ivtvfb_defined.yres_virtual) { | ||
641 | IVTVFB_DEBUG_WARN("Invalid resolution: %dx%d (virtual %dx%d)\n", | ||
642 | var->xres, var->yres, var->xres_virtual, var->yres_virtual); | ||
643 | return -EINVAL; | ||
644 | } | ||
645 | } | 624 | } |
646 | else { | ||
647 | if (var->xres > IVTV_OSD_MAX_WIDTH || var->yres > osd_height_limit) { | ||
648 | IVTVFB_DEBUG_WARN("Invalid resolution: %dx%d\n", | ||
649 | var->xres, var->yres); | ||
650 | return -EINVAL; | ||
651 | } | ||
652 | 625 | ||
653 | /* Max horizontal size is 1023 @ 32bpp, 2046 & 16bpp, 4092 @ 8bpp */ | 626 | /* Max horizontal size is 1023 @ 32bpp, 2046 & 16bpp, 4092 @ 8bpp */ |
654 | if (var->xres_virtual > 4095 / (var->bits_per_pixel / 8) || | 627 | if (var->xres_virtual > 4095 / (var->bits_per_pixel / 8) || |
655 | var->xres_virtual * var->yres_virtual * (var->bits_per_pixel / 8) > oi->video_buffer_size || | 628 | var->xres_virtual * var->yres_virtual * (var->bits_per_pixel / 8) > oi->video_buffer_size || |
656 | var->xres_virtual < var->xres || | 629 | var->xres_virtual < var->xres || |
657 | var->yres_virtual < var->yres) { | 630 | var->yres_virtual < var->yres) { |
658 | IVTVFB_DEBUG_WARN("Invalid virtual resolution: %dx%d\n", | 631 | IVTVFB_DEBUG_WARN("Invalid virtual resolution: %dx%d\n", |
659 | var->xres_virtual, var->yres_virtual); | 632 | var->xres_virtual, var->yres_virtual); |
660 | return -EINVAL; | 633 | return -EINVAL; |
661 | } | ||
662 | } | 634 | } |
663 | 635 | ||
664 | /* Some extra checks if in 8 bit mode */ | 636 | /* Some extra checks if in 8 bit mode */ |
@@ -872,14 +844,15 @@ static int ivtvfb_init_vidmode(struct ivtv *itv) | |||
872 | 844 | ||
873 | /* Color mode */ | 845 | /* Color mode */ |
874 | 846 | ||
875 | if (osd_compat) osd_depth = 32; | 847 | if (osd_depth != 8 && osd_depth != 16 && osd_depth != 32) |
876 | if (osd_depth != 8 && osd_depth != 16 && osd_depth != 32) osd_depth = 8; | 848 | osd_depth = 8; |
877 | oi->bits_per_pixel = osd_depth; | 849 | oi->bits_per_pixel = osd_depth; |
878 | oi->bytes_per_pixel = oi->bits_per_pixel / 8; | 850 | oi->bytes_per_pixel = oi->bits_per_pixel / 8; |
879 | 851 | ||
880 | /* Horizontal size & position */ | 852 | /* Horizontal size & position */ |
881 | 853 | ||
882 | if (osd_xres > 720) osd_xres = 720; | 854 | if (osd_xres > 720) |
855 | osd_xres = 720; | ||
883 | 856 | ||
884 | /* Must be a multiple of 4 for 8bpp & 2 for 16bpp */ | 857 | /* Must be a multiple of 4 for 8bpp & 2 for 16bpp */ |
885 | if (osd_depth == 8) | 858 | if (osd_depth == 8) |
@@ -887,10 +860,7 @@ static int ivtvfb_init_vidmode(struct ivtv *itv) | |||
887 | else if (osd_depth == 16) | 860 | else if (osd_depth == 16) |
888 | osd_xres &= ~1; | 861 | osd_xres &= ~1; |
889 | 862 | ||
890 | if (osd_xres) | 863 | start_window.width = osd_xres ? osd_xres : 640; |
891 | start_window.width = osd_xres; | ||
892 | else | ||
893 | start_window.width = osd_compat ? 720: 640; | ||
894 | 864 | ||
895 | /* Check horizontal start (osd_left). */ | 865 | /* Check horizontal start (osd_left). */ |
896 | if (osd_left && osd_left + start_window.width > 721) { | 866 | if (osd_left && osd_left + start_window.width > 721) { |
@@ -913,10 +883,7 @@ static int ivtvfb_init_vidmode(struct ivtv *itv) | |||
913 | if (osd_yres > max_height) | 883 | if (osd_yres > max_height) |
914 | osd_yres = max_height; | 884 | osd_yres = max_height; |
915 | 885 | ||
916 | if (osd_yres) | 886 | start_window.height = osd_yres ? osd_yres : itv->is_50hz ? 480 : 400; |
917 | start_window.height = osd_yres; | ||
918 | else | ||
919 | start_window.height = osd_compat ? max_height : (itv->is_50hz ? 480 : 400); | ||
920 | 887 | ||
921 | /* Check vertical start (osd_upper). */ | 888 | /* Check vertical start (osd_upper). */ |
922 | if (osd_upper + start_window.height > max_height + 1) { | 889 | if (osd_upper + start_window.height > max_height + 1) { |
@@ -1119,10 +1086,6 @@ static int ivtvfb_init_card(struct ivtv *itv) | |||
1119 | /* Enable the osd */ | 1086 | /* Enable the osd */ |
1120 | ivtvfb_blank(FB_BLANK_UNBLANK, &itv->osd_info->ivtvfb_info); | 1087 | ivtvfb_blank(FB_BLANK_UNBLANK, &itv->osd_info->ivtvfb_info); |
1121 | 1088 | ||
1122 | /* Note if we're running in compatibility mode */ | ||
1123 | if (osd_compat) | ||
1124 | IVTVFB_INFO("Running in compatibility mode. Display resize & mode change disabled\n"); | ||
1125 | |||
1126 | /* Allocate DMA */ | 1089 | /* Allocate DMA */ |
1127 | ivtv_udma_alloc(itv); | 1090 | ivtv_udma_alloc(itv); |
1128 | return 0; | 1091 | return 0; |