diff options
Diffstat (limited to 'drivers/video/via/hw.c')
-rw-r--r-- | drivers/video/via/hw.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index 47d9024d7c3..1823253a6f4 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c @@ -691,7 +691,7 @@ void viafb_set_primary_color_depth(u8 depth) DEBUG_MSG(KERN_DEBUG "viafb_set_primary_color_depth(%d)\n", depth); switch (depth) { - case 6: + case 8: value = 0x00; break; case 16: @@ -715,7 +715,7 @@ void viafb_set_secondary_color_depth(u8 depth) DEBUG_MSG(KERN_DEBUG "viafb_set_secondary_color_depth(%d)\n", depth); switch (depth) { - case 6: + case 8: value = 0x00; break; case 16: @@ -733,6 +733,27 @@ void viafb_set_secondary_color_depth(u8 depth) viafb_write_reg_mask(0x67, VIACR, value, 0xC0); } +static void set_color_register(u8 index, u8 red, u8 green, u8 blue) +{ + outb(0xFF, 0x3C6); /* bit mask of palette */ + outb(index, 0x3C8); + outb(red, 0x3C9); + outb(green, 0x3C9); + outb(blue, 0x3C9); +} + +void viafb_set_primary_color_register(u8 index, u8 red, u8 green, u8 blue) +{ + viafb_write_reg_mask(0x1A, VIASR, 0x00, 0x01); + set_color_register(index, red, green, blue); +} + +void viafb_set_secondary_color_register(u8 index, u8 red, u8 green, u8 blue) +{ + viafb_write_reg_mask(0x1A, VIASR, 0x01, 0x01); + set_color_register(index, red, green, blue); +} + void viafb_set_output_path(int device, int set_iga, int output_interface) { switch (device) { @@ -2210,8 +2231,7 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, outb(VPIT.SR[i - 1], VIASR + 1); } - viafb_write_reg_mask(0x15, VIASR, viafbinfo->fix.visual - == FB_VISUAL_PSEUDOCOLOR ? 0x22 : 0xA2, 0xA2); + viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2); viafb_set_iga_path(); /* Write CRTC */ |