]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
viafb: LCD bpp cleanup
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sun, 12 Feb 2012 20:34:17 +0000 (20:34 +0000)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sun, 4 Mar 2012 12:05:15 +0000 (12:05 +0000)
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>
drivers/video/via/chip.h
drivers/video/via/hw.c
drivers/video/via/hw.h
drivers/video/via/lcd.c
drivers/video/via/viafbdev.c

index c2ecdb5a94da061c37e8fb517208acdf21b9bbe0..d32a5076c20f3e895df46f8f8a496e9f113b9384 100644 (file)
@@ -146,7 +146,6 @@ struct tmds_setting_information {
 
 struct lvds_setting_information {
        int iga_path;
-       int bpp;
        int lcd_panel_hres;
        int lcd_panel_vres;
        int display_method;
index 4d799c89941bf681adf9630e44472323670d0bee..da80d202f52a9c53c1a64c02e7dff2553ece3f12 100644 (file)
@@ -1529,9 +1529,6 @@ void viafb_update_device_setting(int hres, int vres, int bpp, int flag)
        if (flag == 0) {
                viaparinfo->tmds_setting_info->h_active = hres;
                viaparinfo->tmds_setting_info->v_active = vres;
-
-               viaparinfo->lvds_setting_info->bpp = bpp;
-               viaparinfo->lvds_setting_info2->bpp = bpp;
        } else {
 
                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)
                        viaparinfo->tmds_setting_info->v_active = vres;
                }
 
-               if (viaparinfo->lvds_setting_info->iga_path == IGA2)
-                       viaparinfo->lvds_setting_info->bpp = bpp;
-
-               if (IGA2 == viaparinfo->lvds_setting_info2->iga_path)
-                       viaparinfo->lvds_setting_info2->bpp = bpp;
        }
 }
 
@@ -1834,7 +1826,7 @@ static void hw_init(void)
        load_fix_bit_crtc_reg();
 }
 
-int viafb_setmode(int video_bpp, int video_bpp1)
+int viafb_setmode(void)
 {
        int j, cxres = 0, cyres = 0;
        int port;
@@ -1923,7 +1915,6 @@ int viafb_setmode(int video_bpp, int video_bpp1)
        if (viafb_LCD_ON) {
                if (viafb_SAMM_ON &&
                        (viaparinfo->lvds_setting_info->iga_path == IGA2)) {
-                       viaparinfo->lvds_setting_info->bpp = video_bpp1;
                        viafb_lcd_set_mode(&var2, cxres, cyres,
                                viaparinfo->lvds_setting_info,
                                &viaparinfo->chip_info->lvds_chip_info);
@@ -1933,7 +1924,6 @@ int viafb_setmode(int video_bpp, int video_bpp1)
                                viaparinfo->lvds_setting_info->display_method =
                                    LCD_CENTERING;
                        }
-                       viaparinfo->lvds_setting_info->bpp = video_bpp;
                        viafb_lcd_set_mode(&viafbinfo->var, 0, 0,
                                viaparinfo->lvds_setting_info,
                                &viaparinfo->chip_info->lvds_chip_info);
@@ -1942,7 +1932,6 @@ int viafb_setmode(int video_bpp, int video_bpp1)
        if (viafb_LCD2_ON) {
                if (viafb_SAMM_ON &&
                        (viaparinfo->lvds_setting_info2->iga_path == IGA2)) {
-                       viaparinfo->lvds_setting_info2->bpp = video_bpp1;
                        viafb_lcd_set_mode(&var2, cxres, cyres,
                                viaparinfo->lvds_setting_info2,
                                &viaparinfo->chip_info->lvds_chip_info2);
@@ -1952,7 +1941,6 @@ int viafb_setmode(int video_bpp, int video_bpp1)
                                viaparinfo->lvds_setting_info2->display_method =
                                    LCD_CENTERING;
                        }
-                       viaparinfo->lvds_setting_info2->bpp = video_bpp;
                        viafb_lcd_set_mode(&viafbinfo->var, 0, 0,
                                viaparinfo->lvds_setting_info2,
                                &viaparinfo->chip_info->lvds_chip_info2);
@@ -1967,7 +1955,7 @@ int viafb_setmode(int video_bpp, int video_bpp1)
        if (!viafb_hotplug) {
                viafb_hotplug_Xres = viafbinfo->var.xres;
                viafb_hotplug_Yres = viafbinfo->var.yres;
-               viafb_hotplug_bpp = video_bpp;
+               viafb_hotplug_bpp = viafbinfo->var.bits_per_pixel;
                viafb_hotplug_refresh = viafb_refresh;
 
                if (viafb_DVI_ON)
index f8129e49aa2c1dae9f27072c59ab3075bce858a1..cacedc10699b02312cc6728d26d8dac1b5c4bebf 100644 (file)
@@ -658,7 +658,7 @@ void viafb_load_FIFO_reg(int set_iga, int hor_active, int ver_active);
 void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
                                        *p_gfx_dpa_setting);
 
-int viafb_setmode(int video_bpp, int video_bpp1);
+int viafb_setmode(void);
 void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
        struct crt_mode_table *mode);
 void __devinit viafb_init_chip_info(int chip_type);
index 02cfdc8d7edd78e12fbd111443bd020344ecdba9..6e52711e96391e89d70ad4e9550e7d94b0d5f15e 100644 (file)
@@ -53,9 +53,6 @@ static void __devinit fp_id_to_vindex(int panel_id);
 static int lvds_register_read(int index);
 static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
                      int panel_vres);
-static void via_pitch_alignment_patch_lcd(
-       struct lvds_setting_information *plvds_setting_info,
-       struct lvds_chip_information *plvds_chip_info, int hres);
 static void lcd_patch_skew_dvp0(struct lvds_setting_information
                         *plvds_setting_info,
                         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,
        }
 }
 
-static void via_pitch_alignment_patch_lcd(
-       struct lvds_setting_information *plvds_setting_info,
-       struct lvds_chip_information *plvds_chip_info, int hres)
+static void via_pitch_alignment_patch_lcd(int iga_path, int hres, int bpp)
 {
        unsigned char cr13, cr35, cr65, cr66, cr67;
        unsigned long dwScreenPitch = 0;
        unsigned long dwPitch;
 
-       dwPitch = hres * (plvds_setting_info->bpp >> 3);
+       dwPitch = hres * (bpp >> 3);
        if (dwPitch & 0x1F) {
                dwScreenPitch = ((dwPitch + 31) & ~31) >> 3;
-               if (plvds_setting_info->iga_path == IGA2) {
-                       if (plvds_setting_info->bpp > 8) {
+               if (iga_path == IGA2) {
+                       if (bpp > 8) {
                                cr66 = (unsigned char)(dwScreenPitch & 0xFF);
                                viafb_write_reg(CR66, VIACR, cr66);
                                cr67 = viafb_read_reg(VIACR, CR67) & 0xFC;
@@ -483,7 +478,7 @@ static void via_pitch_alignment_patch_lcd(
                        cr65 += 2;
                        viafb_write_reg(CR65, VIACR, cr65);
                } else {
-                       if (plvds_setting_info->bpp > 8) {
+                       if (bpp > 8) {
                                cr13 = (unsigned char)(dwScreenPitch & 0xFF);
                                viafb_write_reg(CR13, VIACR, cr13);
                                cr35 = viafb_read_reg(VIACR, CR35) & 0x1F;
@@ -551,7 +546,7 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres,
        struct lvds_chip_information *plvds_chip_info)
 {
        int set_iga = plvds_setting_info->iga_path;
-       int mode_bpp = plvds_setting_info->bpp;
+       int mode_bpp = var->bits_per_pixel;
        int set_hres = cxres ? cxres : var->xres;
        int set_vres = cyres ? cyres : var->yres;
        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,
                viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0);
 
        /* Patch for non 32bit alignment mode */
-       via_pitch_alignment_patch_lcd(plvds_setting_info, plvds_chip_info,
-               set_hres);
+       via_pitch_alignment_patch_lcd(plvds_setting_info->iga_path, set_hres,
+               var->bits_per_pixel);
 }
 
 static void integrated_lvds_disable(struct lvds_setting_information
index 9cfa92ef6bd0d02a28f90c1d72e938bbac3dff33..7529340f4ea25fd3576f9884f77c215271455ae1 100644 (file)
@@ -303,7 +303,7 @@ static int viafb_set_par(struct fb_info *info)
                        info->flags &= ~FBINFO_HWACCEL_DISABLED;
                else
                        info->flags |= FBINFO_HWACCEL_DISABLED;
-               viafb_setmode(info->var.bits_per_pixel, viafb_bpp1);
+               viafb_setmode();
                viafb_pan_display(&info->var, info);
        }