diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-02-12 15:34:17 -0500 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-03-04 07:05:15 -0500 |
commit | 91dc1be8f698eb016343d534159a919678e3889c (patch) | |
tree | 286944db798d0254314e9e346cf74fa9c87211d3 | |
parent | 70a27df1579b0e8d7d478d034980f8a7f8a20d54 (diff) |
viafb: LCD bpp cleanup
This patch removes redundant bits per pixel information by using the
one storged in var directly. Simplifies code without any functional
changes.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r-- | drivers/video/via/chip.h | 1 | ||||
-rw-r--r-- | drivers/video/via/hw.c | 16 | ||||
-rw-r--r-- | drivers/video/via/hw.h | 2 | ||||
-rw-r--r-- | drivers/video/via/lcd.c | 21 | ||||
-rw-r--r-- | drivers/video/via/viafbdev.c | 2 |
5 files changed, 12 insertions, 30 deletions
diff --git a/drivers/video/via/chip.h b/drivers/video/via/chip.h index c2ecdb5a94da..d32a5076c20f 100644 --- a/drivers/video/via/chip.h +++ b/drivers/video/via/chip.h | |||
@@ -146,7 +146,6 @@ struct tmds_setting_information { | |||
146 | 146 | ||
147 | struct lvds_setting_information { | 147 | struct lvds_setting_information { |
148 | int iga_path; | 148 | int iga_path; |
149 | int bpp; | ||
150 | int lcd_panel_hres; | 149 | int lcd_panel_hres; |
151 | int lcd_panel_vres; | 150 | int lcd_panel_vres; |
152 | int display_method; | 151 | int display_method; |
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index 4d799c89941b..da80d202f52a 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
@@ -1529,9 +1529,6 @@ void viafb_update_device_setting(int hres, int vres, int bpp, int flag) | |||
1529 | if (flag == 0) { | 1529 | if (flag == 0) { |
1530 | viaparinfo->tmds_setting_info->h_active = hres; | 1530 | viaparinfo->tmds_setting_info->h_active = hres; |
1531 | viaparinfo->tmds_setting_info->v_active = vres; | 1531 | viaparinfo->tmds_setting_info->v_active = vres; |
1532 | |||
1533 | viaparinfo->lvds_setting_info->bpp = bpp; | ||
1534 | viaparinfo->lvds_setting_info2->bpp = bpp; | ||
1535 | } else { | 1532 | } else { |
1536 | 1533 | ||
1537 | if (viaparinfo->tmds_setting_info->iga_path == IGA2) { | 1534 | if (viaparinfo->tmds_setting_info->iga_path == IGA2) { |
@@ -1539,11 +1536,6 @@ void viafb_update_device_setting(int hres, int vres, int bpp, int flag) | |||
1539 | viaparinfo->tmds_setting_info->v_active = vres; | 1536 | viaparinfo->tmds_setting_info->v_active = vres; |
1540 | } | 1537 | } |
1541 | 1538 | ||
1542 | if (viaparinfo->lvds_setting_info->iga_path == IGA2) | ||
1543 | viaparinfo->lvds_setting_info->bpp = bpp; | ||
1544 | |||
1545 | if (IGA2 == viaparinfo->lvds_setting_info2->iga_path) | ||
1546 | viaparinfo->lvds_setting_info2->bpp = bpp; | ||
1547 | } | 1539 | } |
1548 | } | 1540 | } |
1549 | 1541 | ||
@@ -1834,7 +1826,7 @@ static void hw_init(void) | |||
1834 | load_fix_bit_crtc_reg(); | 1826 | load_fix_bit_crtc_reg(); |
1835 | } | 1827 | } |
1836 | 1828 | ||
1837 | int viafb_setmode(int video_bpp, int video_bpp1) | 1829 | int viafb_setmode(void) |
1838 | { | 1830 | { |
1839 | int j, cxres = 0, cyres = 0; | 1831 | int j, cxres = 0, cyres = 0; |
1840 | int port; | 1832 | int port; |
@@ -1923,7 +1915,6 @@ int viafb_setmode(int video_bpp, int video_bpp1) | |||
1923 | if (viafb_LCD_ON) { | 1915 | if (viafb_LCD_ON) { |
1924 | if (viafb_SAMM_ON && | 1916 | if (viafb_SAMM_ON && |
1925 | (viaparinfo->lvds_setting_info->iga_path == IGA2)) { | 1917 | (viaparinfo->lvds_setting_info->iga_path == IGA2)) { |
1926 | viaparinfo->lvds_setting_info->bpp = video_bpp1; | ||
1927 | viafb_lcd_set_mode(&var2, cxres, cyres, | 1918 | viafb_lcd_set_mode(&var2, cxres, cyres, |
1928 | viaparinfo->lvds_setting_info, | 1919 | viaparinfo->lvds_setting_info, |
1929 | &viaparinfo->chip_info->lvds_chip_info); | 1920 | &viaparinfo->chip_info->lvds_chip_info); |
@@ -1933,7 +1924,6 @@ int viafb_setmode(int video_bpp, int video_bpp1) | |||
1933 | viaparinfo->lvds_setting_info->display_method = | 1924 | viaparinfo->lvds_setting_info->display_method = |
1934 | LCD_CENTERING; | 1925 | LCD_CENTERING; |
1935 | } | 1926 | } |
1936 | viaparinfo->lvds_setting_info->bpp = video_bpp; | ||
1937 | viafb_lcd_set_mode(&viafbinfo->var, 0, 0, | 1927 | viafb_lcd_set_mode(&viafbinfo->var, 0, 0, |
1938 | viaparinfo->lvds_setting_info, | 1928 | viaparinfo->lvds_setting_info, |
1939 | &viaparinfo->chip_info->lvds_chip_info); | 1929 | &viaparinfo->chip_info->lvds_chip_info); |
@@ -1942,7 +1932,6 @@ int viafb_setmode(int video_bpp, int video_bpp1) | |||
1942 | if (viafb_LCD2_ON) { | 1932 | if (viafb_LCD2_ON) { |
1943 | if (viafb_SAMM_ON && | 1933 | if (viafb_SAMM_ON && |
1944 | (viaparinfo->lvds_setting_info2->iga_path == IGA2)) { | 1934 | (viaparinfo->lvds_setting_info2->iga_path == IGA2)) { |
1945 | viaparinfo->lvds_setting_info2->bpp = video_bpp1; | ||
1946 | viafb_lcd_set_mode(&var2, cxres, cyres, | 1935 | viafb_lcd_set_mode(&var2, cxres, cyres, |
1947 | viaparinfo->lvds_setting_info2, | 1936 | viaparinfo->lvds_setting_info2, |
1948 | &viaparinfo->chip_info->lvds_chip_info2); | 1937 | &viaparinfo->chip_info->lvds_chip_info2); |
@@ -1952,7 +1941,6 @@ int viafb_setmode(int video_bpp, int video_bpp1) | |||
1952 | viaparinfo->lvds_setting_info2->display_method = | 1941 | viaparinfo->lvds_setting_info2->display_method = |
1953 | LCD_CENTERING; | 1942 | LCD_CENTERING; |
1954 | } | 1943 | } |
1955 | viaparinfo->lvds_setting_info2->bpp = video_bpp; | ||
1956 | viafb_lcd_set_mode(&viafbinfo->var, 0, 0, | 1944 | viafb_lcd_set_mode(&viafbinfo->var, 0, 0, |
1957 | viaparinfo->lvds_setting_info2, | 1945 | viaparinfo->lvds_setting_info2, |
1958 | &viaparinfo->chip_info->lvds_chip_info2); | 1946 | &viaparinfo->chip_info->lvds_chip_info2); |
@@ -1967,7 +1955,7 @@ int viafb_setmode(int video_bpp, int video_bpp1) | |||
1967 | if (!viafb_hotplug) { | 1955 | if (!viafb_hotplug) { |
1968 | viafb_hotplug_Xres = viafbinfo->var.xres; | 1956 | viafb_hotplug_Xres = viafbinfo->var.xres; |
1969 | viafb_hotplug_Yres = viafbinfo->var.yres; | 1957 | viafb_hotplug_Yres = viafbinfo->var.yres; |
1970 | viafb_hotplug_bpp = video_bpp; | 1958 | viafb_hotplug_bpp = viafbinfo->var.bits_per_pixel; |
1971 | viafb_hotplug_refresh = viafb_refresh; | 1959 | viafb_hotplug_refresh = viafb_refresh; |
1972 | 1960 | ||
1973 | if (viafb_DVI_ON) | 1961 | if (viafb_DVI_ON) |
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h index f8129e49aa2c..cacedc10699b 100644 --- a/drivers/video/via/hw.h +++ b/drivers/video/via/hw.h | |||
@@ -658,7 +658,7 @@ void viafb_load_FIFO_reg(int set_iga, int hor_active, int ver_active); | |||
658 | void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\ | 658 | void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\ |
659 | *p_gfx_dpa_setting); | 659 | *p_gfx_dpa_setting); |
660 | 660 | ||
661 | int viafb_setmode(int video_bpp, int video_bpp1); | 661 | int viafb_setmode(void); |
662 | void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, | 662 | void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, |
663 | struct crt_mode_table *mode); | 663 | struct crt_mode_table *mode); |
664 | void __devinit viafb_init_chip_info(int chip_type); | 664 | void __devinit viafb_init_chip_info(int chip_type); |
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c index 02cfdc8d7edd..6e52711e9639 100644 --- a/drivers/video/via/lcd.c +++ b/drivers/video/via/lcd.c | |||
@@ -53,9 +53,6 @@ static void __devinit fp_id_to_vindex(int panel_id); | |||
53 | static int lvds_register_read(int index); | 53 | static int lvds_register_read(int index); |
54 | static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, | 54 | static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, |
55 | int panel_vres); | 55 | int panel_vres); |
56 | static void via_pitch_alignment_patch_lcd( | ||
57 | struct lvds_setting_information *plvds_setting_info, | ||
58 | struct lvds_chip_information *plvds_chip_info, int hres); | ||
59 | static void lcd_patch_skew_dvp0(struct lvds_setting_information | 56 | static void lcd_patch_skew_dvp0(struct lvds_setting_information |
60 | *plvds_setting_info, | 57 | *plvds_setting_info, |
61 | struct lvds_chip_information *plvds_chip_info); | 58 | struct lvds_chip_information *plvds_chip_info); |
@@ -453,19 +450,17 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, | |||
453 | } | 450 | } |
454 | } | 451 | } |
455 | 452 | ||
456 | static void via_pitch_alignment_patch_lcd( | 453 | static void via_pitch_alignment_patch_lcd(int iga_path, int hres, int bpp) |
457 | struct lvds_setting_information *plvds_setting_info, | ||
458 | struct lvds_chip_information *plvds_chip_info, int hres) | ||
459 | { | 454 | { |
460 | unsigned char cr13, cr35, cr65, cr66, cr67; | 455 | unsigned char cr13, cr35, cr65, cr66, cr67; |
461 | unsigned long dwScreenPitch = 0; | 456 | unsigned long dwScreenPitch = 0; |
462 | unsigned long dwPitch; | 457 | unsigned long dwPitch; |
463 | 458 | ||
464 | dwPitch = hres * (plvds_setting_info->bpp >> 3); | 459 | dwPitch = hres * (bpp >> 3); |
465 | if (dwPitch & 0x1F) { | 460 | if (dwPitch & 0x1F) { |
466 | dwScreenPitch = ((dwPitch + 31) & ~31) >> 3; | 461 | dwScreenPitch = ((dwPitch + 31) & ~31) >> 3; |
467 | if (plvds_setting_info->iga_path == IGA2) { | 462 | if (iga_path == IGA2) { |
468 | if (plvds_setting_info->bpp > 8) { | 463 | if (bpp > 8) { |
469 | cr66 = (unsigned char)(dwScreenPitch & 0xFF); | 464 | cr66 = (unsigned char)(dwScreenPitch & 0xFF); |
470 | viafb_write_reg(CR66, VIACR, cr66); | 465 | viafb_write_reg(CR66, VIACR, cr66); |
471 | cr67 = viafb_read_reg(VIACR, CR67) & 0xFC; | 466 | cr67 = viafb_read_reg(VIACR, CR67) & 0xFC; |
@@ -483,7 +478,7 @@ static void via_pitch_alignment_patch_lcd( | |||
483 | cr65 += 2; | 478 | cr65 += 2; |
484 | viafb_write_reg(CR65, VIACR, cr65); | 479 | viafb_write_reg(CR65, VIACR, cr65); |
485 | } else { | 480 | } else { |
486 | if (plvds_setting_info->bpp > 8) { | 481 | if (bpp > 8) { |
487 | cr13 = (unsigned char)(dwScreenPitch & 0xFF); | 482 | cr13 = (unsigned char)(dwScreenPitch & 0xFF); |
488 | viafb_write_reg(CR13, VIACR, cr13); | 483 | viafb_write_reg(CR13, VIACR, cr13); |
489 | cr35 = viafb_read_reg(VIACR, CR35) & 0x1F; | 484 | cr35 = viafb_read_reg(VIACR, CR35) & 0x1F; |
@@ -551,7 +546,7 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres, | |||
551 | struct lvds_chip_information *plvds_chip_info) | 546 | struct lvds_chip_information *plvds_chip_info) |
552 | { | 547 | { |
553 | int set_iga = plvds_setting_info->iga_path; | 548 | int set_iga = plvds_setting_info->iga_path; |
554 | int mode_bpp = plvds_setting_info->bpp; | 549 | int mode_bpp = var->bits_per_pixel; |
555 | int set_hres = cxres ? cxres : var->xres; | 550 | int set_hres = cxres ? cxres : var->xres; |
556 | int set_vres = cyres ? cyres : var->yres; | 551 | int set_vres = cyres ? cyres : var->yres; |
557 | int panel_hres = plvds_setting_info->lcd_panel_hres; | 552 | int panel_hres = plvds_setting_info->lcd_panel_hres; |
@@ -612,8 +607,8 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres, | |||
612 | viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0); | 607 | viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0); |
613 | 608 | ||
614 | /* Patch for non 32bit alignment mode */ | 609 | /* Patch for non 32bit alignment mode */ |
615 | via_pitch_alignment_patch_lcd(plvds_setting_info, plvds_chip_info, | 610 | via_pitch_alignment_patch_lcd(plvds_setting_info->iga_path, set_hres, |
616 | set_hres); | 611 | var->bits_per_pixel); |
617 | } | 612 | } |
618 | 613 | ||
619 | static void integrated_lvds_disable(struct lvds_setting_information | 614 | static void integrated_lvds_disable(struct lvds_setting_information |
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 9cfa92ef6bd0..7529340f4ea2 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -303,7 +303,7 @@ static int viafb_set_par(struct fb_info *info) | |||
303 | info->flags &= ~FBINFO_HWACCEL_DISABLED; | 303 | info->flags &= ~FBINFO_HWACCEL_DISABLED; |
304 | else | 304 | else |
305 | info->flags |= FBINFO_HWACCEL_DISABLED; | 305 | info->flags |= FBINFO_HWACCEL_DISABLED; |
306 | viafb_setmode(info->var.bits_per_pixel, viafb_bpp1); | 306 | viafb_setmode(); |
307 | viafb_pan_display(&info->var, info); | 307 | viafb_pan_display(&info->var, info); |
308 | } | 308 | } |
309 | 309 | ||