Commit e1d49330 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] PA-RISC STI video updates

 - currcon seems to have disappeared.  We weren't using it, just initialising
   it.
 - parisc_driver names no longer need to be different from pci_driver names.
 - DUMMY_CONSOLE_COLUMNS and DUMMY_CONSOLE_ROWS aren't used by the STI_CONSOLE
   at all.  In fact, they're used by the DUMMY_CONSOLE as their name implies.
 - STI_CONSOLE doesn't need to depend on FRAMEBUFFER_CONSOLE
 - sticore.o uses functions from fonts.o
 - PA-RISC doesn't have an MDA_CONSOLE
Signed-off-by: default avatarMatthew Wilcox <willy@parisc-linux.org>

 - Move STI_CONSOLE after FRAMEBUFFER_CONSOLE
 - Convert sticore.c to using gsc_(read|write)X instead of __raw_(read|write)X.
 - Convert pci_device_id table to use PCI_DEVICE().
Signed-Off-By: default avatarKyle McMartin <kyle@parisc-linux.org>

 - apply patch by Andy Walker <ajwalker@broadpark.no> to fix stifb=
   bpp:x:y handling
From: Helge Deller <deller@parisc-linux.org>
Signed-off-by: default avatarMatthew Wilcox <willy@parisc-linux.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 30fa4fec
...@@ -43,7 +43,7 @@ config VIDEO_SELECT ...@@ -43,7 +43,7 @@ config VIDEO_SELECT
about the Video mode selection support. If unsure, say N. about the Video mode selection support. If unsure, say N.
config MDA_CONSOLE config MDA_CONSOLE
depends on !M68K && ISA depends on !M68K && !PARISC && ISA
tristate "MDA text console (dual-headed) (EXPERIMENTAL)" tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
---help--- ---help---
Say Y here if you have an old MDA or monochrome Hercules graphics Say Y here if you have an old MDA or monochrome Hercules graphics
...@@ -65,30 +65,6 @@ config SGI_NEWPORT_CONSOLE ...@@ -65,30 +65,6 @@ config SGI_NEWPORT_CONSOLE
card of your Indy. Most people say Y here. card of your Indy. Most people say Y here.
# bool 'IODC console' CONFIG_IODC_CONSOLE # bool 'IODC console' CONFIG_IODC_CONSOLE
config STI_CONSOLE
tristate "STI text console"
depends on PARISC && FRAMEBUFFER_CONSOLE
default y
help
The STI console is the builtin display/keyboard on HP-PARISC
machines. Say Y here to build support for it into your kernel.
The alternative is to use your primary serial port as a console.
config DUMMY_CONSOLE_COLUMNS
int "Initial number of console screen columns" if STI_CONSOLE
depends on PARISC
default "160"
help
The default value is 160, which should fit a 1280x1024 monitor.
Select 80 if you use a 640x480 resolution by default.
config DUMMY_CONSOLE_ROWS
int "Initial number of console screen rows" if STI_CONSOLE
depends on PARISC
default "64"
help
The default value is 64, which should fit a 1280x1024 monitor.
Select 25 if you use a 640x480 resolution by default.
config PROM_CONSOLE config PROM_CONSOLE
bool "PROM console" bool "PROM console"
...@@ -102,11 +78,36 @@ config DUMMY_CONSOLE ...@@ -102,11 +78,36 @@ config DUMMY_CONSOLE
depends on PROM_CONSOLE!=y || VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y depends on PROM_CONSOLE!=y || VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y
default y default y
config DUMMY_CONSOLE_COLUMNS
int "Initial number of console screen columns"
depends on PARISC && DUMMY_CONSOLE
default "160"
help
The default value is 160, which should fit a 1280x1024 monitor.
Select 80 if you use a 640x480 resolution by default.
config DUMMY_CONSOLE_ROWS
int "Initial number of console screen rows"
depends on PARISC && DUMMY_CONSOLE
default "64"
help
The default value is 64, which should fit a 1280x1024 monitor.
Select 25 if you use a 640x480 resolution by default.
config FRAMEBUFFER_CONSOLE config FRAMEBUFFER_CONSOLE
tristate "Framebuffer Console support" tristate "Framebuffer Console support"
depends on FB depends on FB
select CRC32 select CRC32
config STI_CONSOLE
tristate "STI text console"
depends on PARISC
default y
help
The STI console is the builtin display/keyboard on HP-PARISC
machines. Say Y here to build support for it into your kernel.
The alternative is to use your primary serial port as a console.
config FONTS config FONTS
bool "Select compiled-in fonts" bool "Select compiled-in fonts"
depends on FRAMEBUFFER_CONSOLE depends on FRAMEBUFFER_CONSOLE
......
...@@ -21,7 +21,7 @@ font-objs += $(font-objs-y) ...@@ -21,7 +21,7 @@ font-objs += $(font-objs-y)
obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o font.o obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o font.o
obj-$(CONFIG_PROM_CONSOLE) += promcon.o promcon_tbl.o obj-$(CONFIG_PROM_CONSOLE) += promcon.o promcon_tbl.o
obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o font.o
obj-$(CONFIG_VGA_CONSOLE) += vgacon.o obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
obj-$(CONFIG_MDA_CONSOLE) += mdacon.o obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o bitblit.o font.o obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o bitblit.o font.o
...@@ -29,7 +29,7 @@ ifeq ($(CONFIG_FB_TILEBLITTING),y) ...@@ -29,7 +29,7 @@ ifeq ($(CONFIG_FB_TILEBLITTING),y)
obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += tileblit.o obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += tileblit.o
endif endif
obj-$(CONFIG_FB_STI) += sticore.o obj-$(CONFIG_FB_STI) += sticore.o font.o
# Targets that kbuild needs to know about # Targets that kbuild needs to know about
targets := promcon_tbl.c targets := promcon_tbl.c
......
...@@ -249,13 +249,13 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest) ...@@ -249,13 +249,13 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest)
/* this still needs to be revisited (see arch/parisc/mm/init.c:246) ! */ /* this still needs to be revisited (see arch/parisc/mm/init.c:246) ! */
while (count >= 4) { while (count >= 4) {
count -= 4; count -= 4;
*(u32 *)dest = __raw_readl(base); *(u32 *)dest = gsc_readl(base);
base += 4; base += 4;
dest += 4; dest += 4;
} }
while (count) { while (count) {
count--; count--;
*(u8 *)dest = __raw_readb(base); *(u8 *)dest = gsc_readb(base);
base++; base++;
dest++; dest++;
} }
...@@ -460,12 +460,20 @@ sti_init_glob_cfg(struct sti_struct *sti, ...@@ -460,12 +460,20 @@ sti_init_glob_cfg(struct sti_struct *sti,
/* remap virtually */ /* remap virtually */
/* FIXME: add BTLB support if btlb==1 */ /* FIXME: add BTLB support if btlb==1 */
len = sti->regions[i].region_desc.length * 4096; len = sti->regions[i].region_desc.length * 4096;
/* XXX: Enabling IOREMAP debugging causes a crash, so we must be passing
* a virtual address to something expecting a physical address that doesn't
* go through a readX macro */
#if 0
if (len) if (len)
glob_cfg->region_ptrs[i] = (unsigned long) ( glob_cfg->region_ptrs[i] = (unsigned long) (
sti->regions[i].region_desc.cache ? sti->regions[i].region_desc.cache ?
ioremap(sti->regions_phys[i], len) : ioremap(sti->regions_phys[i], len) :
ioremap_nocache(sti->regions_phys[i], len) ); ioremap_nocache(sti->regions_phys[i], len) );
#else
if (len)
glob_cfg->region_ptrs[i] = sti->regions_phys[i];
#endif
DPRINTK(("region #%d: phys %08lx, virt %08x, len=%lukB, " DPRINTK(("region #%d: phys %08lx, virt %08x, len=%lukB, "
"btlb=%d, sysonly=%d, cache=%d, last=%d\n", "btlb=%d, sysonly=%d, cache=%d, last=%d\n",
...@@ -680,7 +688,7 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) ...@@ -680,7 +688,7 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest)
while (count) { while (count) {
count--; count--;
*(u8 *)dest = __raw_readl(base); *(u8 *)dest = gsc_readl(base);
base += 4; base += 4;
dest++; dest++;
} }
...@@ -730,7 +738,7 @@ sti_get_wmode_rom (unsigned long address) ...@@ -730,7 +738,7 @@ sti_get_wmode_rom (unsigned long address)
unsigned long size; unsigned long size;
/* read the ROM size directly from the struct in ROM */ /* read the ROM size directly from the struct in ROM */
size = __raw_readl(address + offsetof(struct sti_rom,last_addr)); size = gsc_readl(address + offsetof(struct sti_rom,last_addr));
raw = kmalloc(size, GFP_KERNEL); raw = kmalloc(size, GFP_KERNEL);
if(raw) if(raw)
...@@ -825,13 +833,13 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd ...@@ -825,13 +833,13 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd
if (pdc_add_valid(address)) if (pdc_add_valid(address))
goto out_err; goto out_err;
sig = __raw_readl(address); sig = gsc_readl(address);
/* check for a PCI ROM structure */ /* check for a PCI ROM structure */
if ((le32_to_cpu(sig)==0xaa55)) { if ((le32_to_cpu(sig)==0xaa55)) {
unsigned int i, rm_offset; unsigned int i, rm_offset;
u32 *rm; u32 *rm;
i = __raw_readl(address+0x04); i = gsc_readl(address+0x04);
if (i != 1) { if (i != 1) {
/* The ROM could have multiple architecture /* The ROM could have multiple architecture
* dependent images (e.g. i386, parisc,...) */ * dependent images (e.g. i386, parisc,...) */
...@@ -842,17 +850,17 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd ...@@ -842,17 +850,17 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd
sti->pd = pd; sti->pd = pd;
i = __raw_readl(address+0x0c); i = gsc_readl(address+0x0c);
DPRINTK(("PCI ROM size (from header) = %d kB\n", DPRINTK(("PCI ROM size (from header) = %d kB\n",
le16_to_cpu(i>>16)*512/1024)); le16_to_cpu(i>>16)*512/1024));
rm_offset = le16_to_cpu(i & 0xffff); rm_offset = le16_to_cpu(i & 0xffff);
if (rm_offset) { if (rm_offset) {
/* read 16 bytes from the pci region mapper array */ /* read 16 bytes from the pci region mapper array */
rm = (u32*) &sti->rm_entry; rm = (u32*) &sti->rm_entry;
*rm++ = __raw_readl(address+rm_offset+0x00); *rm++ = gsc_readl(address+rm_offset+0x00);
*rm++ = __raw_readl(address+rm_offset+0x04); *rm++ = gsc_readl(address+rm_offset+0x04);
*rm++ = __raw_readl(address+rm_offset+0x08); *rm++ = gsc_readl(address+rm_offset+0x08);
*rm++ = __raw_readl(address+rm_offset+0x0c); *rm++ = gsc_readl(address+rm_offset+0x0c);
DPRINTK(("PCI region Mapper offset = %08x: ", DPRINTK(("PCI region Mapper offset = %08x: ",
rm_offset)); rm_offset));
for (i=0; i<16; i++) for (i=0; i<16; i++)
...@@ -860,7 +868,7 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd ...@@ -860,7 +868,7 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd
DPRINTK(("\n")); DPRINTK(("\n"));
} }
address += le32_to_cpu(__raw_readl(address+8)); address += le32_to_cpu(gsc_readl(address+8));
DPRINTK(("sig %04x, PCI STI ROM at %08lx\n", sig, address)); DPRINTK(("sig %04x, PCI STI ROM at %08lx\n", sig, address));
goto test_rom; goto test_rom;
} }
...@@ -1003,17 +1011,17 @@ static void __devexit sticore_pci_remove(struct pci_dev *pd) ...@@ -1003,17 +1011,17 @@ static void __devexit sticore_pci_remove(struct pci_dev *pd)
static struct pci_device_id sti_pci_tbl[] = { static struct pci_device_id sti_pci_tbl[] = {
{ PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_EG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_EG) },
{ PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX6) },
{ PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX4) },
{ PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX2) },
{ PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FXE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FXE) },
{ 0, } /* terminate list */ { 0, } /* terminate list */
}; };
MODULE_DEVICE_TABLE(pci, sti_pci_tbl); MODULE_DEVICE_TABLE(pci, sti_pci_tbl);
static struct pci_driver pci_sti_driver = { static struct pci_driver pci_sti_driver = {
.name = "sti (pci)", .name = "sti",
.id_table = sti_pci_tbl, .id_table = sti_pci_tbl,
.probe = sticore_pci_init, .probe = sticore_pci_init,
.remove = sticore_pci_remove, .remove = sticore_pci_remove,
...@@ -1026,7 +1034,7 @@ static struct parisc_device_id sti_pa_tbl[] = { ...@@ -1026,7 +1034,7 @@ static struct parisc_device_id sti_pa_tbl[] = {
}; };
static struct parisc_driver pa_sti_driver = { static struct parisc_driver pa_sti_driver = {
.name = "sti (native)", .name = "sti",
.id_table = sti_pa_tbl, .id_table = sti_pa_tbl,
.probe = sticore_pa_init, .probe = sticore_pa_init,
}; };
......
...@@ -112,11 +112,10 @@ struct stifb_info { ...@@ -112,11 +112,10 @@ struct stifb_info {
ngle_rom_t ngle_rom; ngle_rom_t ngle_rom;
struct sti_struct *sti; struct sti_struct *sti;
int deviceSpecificConfig; int deviceSpecificConfig;
u32 pseudo_palette[16]; u32 pseudo_palette[256];
}; };
static int __initdata bpp = 8; /* parameter from modprobe */ static int __initdata stifb_bpp_pref[MAX_STI_ROMS];
static int __initdata stifb_force_bpp[MAX_STI_ROMS];
/* ------------------- chipset specific functions -------------------------- */ /* ------------------- chipset specific functions -------------------------- */
...@@ -155,15 +154,15 @@ static int __initdata stifb_force_bpp[MAX_STI_ROMS]; ...@@ -155,15 +154,15 @@ static int __initdata stifb_force_bpp[MAX_STI_ROMS];
#define REG_44 0x210030 #define REG_44 0x210030
#define REG_45 0x210034 #define REG_45 0x210034
#define READ_BYTE(fb,reg) __raw_readb((fb)->info.fix.mmio_start + (reg)) #define READ_BYTE(fb,reg) gsc_readb((fb)->info.fix.mmio_start + (reg))
#define READ_WORD(fb,reg) __raw_readl((fb)->info.fix.mmio_start + (reg)) #define READ_WORD(fb,reg) gsc_readl((fb)->info.fix.mmio_start + (reg))
#ifndef DEBUG_STIFB_REGS #ifndef DEBUG_STIFB_REGS
# define DEBUG_OFF() # define DEBUG_OFF()
# define DEBUG_ON() # define DEBUG_ON()
# define WRITE_BYTE(value,fb,reg) __raw_writeb((value),(fb)->info.fix.mmio_start + (reg)) # define WRITE_BYTE(value,fb,reg) gsc_writeb((value),(fb)->info.fix.mmio_start + (reg))
# define WRITE_WORD(value,fb,reg) __raw_writel((value),(fb)->info.fix.mmio_start + (reg)) # define WRITE_WORD(value,fb,reg) gsc_writel((value),(fb)->info.fix.mmio_start + (reg))
#else #else
static int debug_on = 1; static int debug_on = 1;
# define DEBUG_OFF() debug_on=0 # define DEBUG_OFF() debug_on=0
...@@ -171,11 +170,11 @@ static int __initdata stifb_force_bpp[MAX_STI_ROMS]; ...@@ -171,11 +170,11 @@ static int __initdata stifb_force_bpp[MAX_STI_ROMS];
# define WRITE_BYTE(value,fb,reg) do { if (debug_on) \ # define WRITE_BYTE(value,fb,reg) do { if (debug_on) \
printk(KERN_DEBUG "%30s: WRITE_BYTE(0x%06x) = 0x%02x (old=0x%02x)\n", \ printk(KERN_DEBUG "%30s: WRITE_BYTE(0x%06x) = 0x%02x (old=0x%02x)\n", \
__FUNCTION__, reg, value, READ_BYTE(fb,reg)); \ __FUNCTION__, reg, value, READ_BYTE(fb,reg)); \
__raw_writeb((value),(fb)->info.fix.mmio_start + (reg)); } while (0) gsc_writeb((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
# define WRITE_WORD(value,fb,reg) do { if (debug_on) \ # define WRITE_WORD(value,fb,reg) do { if (debug_on) \
printk(KERN_DEBUG "%30s: WRITE_WORD(0x%06x) = 0x%08x (old=0x%08x)\n", \ printk(KERN_DEBUG "%30s: WRITE_WORD(0x%06x) = 0x%08x (old=0x%08x)\n", \
__FUNCTION__, reg, value, READ_WORD(fb,reg)); \ __FUNCTION__, reg, value, READ_WORD(fb,reg)); \
__raw_writel((value),(fb)->info.fix.mmio_start + (reg)); } while (0) gsc_writel((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
#endif /* DEBUG_STIFB_REGS */ #endif /* DEBUG_STIFB_REGS */
...@@ -1018,6 +1017,15 @@ stifb_setcolreg(u_int regno, u_int red, u_int green, ...@@ -1018,6 +1017,15 @@ stifb_setcolreg(u_int regno, u_int red, u_int green,
(blue)); (blue));
} }
if (info->var.bits_per_pixel == 32) {
((u32 *)(info->pseudo_palette))[regno] =
(red << info->var.red.offset) |
(green << info->var.green.offset) |
(blue << info->var.blue.offset);
} else {
((u32 *)(info->pseudo_palette))[regno] = regno;
}
WRITE_IMAGE_COLOR(fb, regno, color); WRITE_IMAGE_COLOR(fb, regno, color);
if (fb->id == S9000_ID_HCRX) { if (fb->id == S9000_ID_HCRX) {
...@@ -1031,14 +1039,6 @@ stifb_setcolreg(u_int regno, u_int red, u_int green, ...@@ -1031,14 +1039,6 @@ stifb_setcolreg(u_int regno, u_int red, u_int green,
/* 0x100 is same as used in WRITE_IMAGE_COLOR() */ /* 0x100 is same as used in WRITE_IMAGE_COLOR() */
START_COLORMAPLOAD(fb, lutBltCtl.all); START_COLORMAPLOAD(fb, lutBltCtl.all);
SETUP_FB(fb); SETUP_FB(fb);
/* info->var.bits_per_pixel == 32 */
if (regno < 16)
((u32 *)(info->pseudo_palette))[regno] =
(red << info->var.red.offset) |
(green << info->var.green.offset) |
(blue << info->var.blue.offset);
} else { } else {
/* cleanup colormap hardware */ /* cleanup colormap hardware */
FINISH_IMAGE_COLORMAP_ACCESS(fb); FINISH_IMAGE_COLORMAP_ACCESS(fb);
...@@ -1156,7 +1156,7 @@ static struct fb_ops stifb_ops = { ...@@ -1156,7 +1156,7 @@ static struct fb_ops stifb_ops = {
*/ */
int __init int __init
stifb_init_fb(struct sti_struct *sti, int force_bpp) stifb_init_fb(struct sti_struct *sti, int bpp_pref)
{ {
struct fb_fix_screeninfo *fix; struct fb_fix_screeninfo *fix;
struct fb_var_screeninfo *var; struct fb_var_screeninfo *var;
...@@ -1257,10 +1257,10 @@ stifb_init_fb(struct sti_struct *sti, int force_bpp) ...@@ -1257,10 +1257,10 @@ stifb_init_fb(struct sti_struct *sti, int force_bpp)
#ifdef __LP64__ #ifdef __LP64__
sti_rom_address |= 0xffffffff00000000; sti_rom_address |= 0xffffffff00000000;
#endif #endif
fb->deviceSpecificConfig = __raw_readl(sti_rom_address); fb->deviceSpecificConfig = gsc_readl(sti_rom_address);
if (IS_24_DEVICE(fb)) { if (IS_24_DEVICE(fb)) {
if (force_bpp == 8 || force_bpp == 32) if (bpp_pref == 8 || bpp_pref == 32)
bpp = force_bpp; bpp = bpp_pref;
else else
bpp = 32; bpp = 32;
} else } else
...@@ -1409,21 +1409,24 @@ stifb_init(void) ...@@ -1409,21 +1409,24 @@ stifb_init(void)
def_sti = sti_get_rom(0); def_sti = sti_get_rom(0);
if (def_sti) { if (def_sti) {
for (i = 1; i < MAX_STI_ROMS; i++) { for (i = 1; i <= MAX_STI_ROMS; i++) {
sti = sti_get_rom(i); sti = sti_get_rom(i);
if (sti == def_sti && bpp > 0) if (!sti)
stifb_force_bpp[i] = bpp; break;
if (sti == def_sti) {
stifb_init_fb(sti, stifb_bpp_pref[i - 1]);
break;
}
} }
stifb_init_fb(def_sti, stifb_force_bpp[i]);
} }
for (i = 1; i < MAX_STI_ROMS; i++) { for (i = 1; i <= MAX_STI_ROMS; i++) {
sti = sti_get_rom(i); sti = sti_get_rom(i);
if (!sti || sti==def_sti) if (!sti)
break; break;
if (bpp > 0) if (sti == def_sti)
stifb_force_bpp[i] = bpp; continue;
stifb_init_fb(sti, stifb_force_bpp[i]); stifb_init_fb(sti, stifb_bpp_pref[i - 1]);
} }
return 0; return 0;
} }
...@@ -1438,7 +1441,7 @@ stifb_cleanup(void) ...@@ -1438,7 +1441,7 @@ stifb_cleanup(void)
struct sti_struct *sti; struct sti_struct *sti;
int i; int i;
for (i = 1; i < MAX_STI_ROMS; i++) { for (i = 1; i <= MAX_STI_ROMS; i++) {
sti = sti_get_rom(i); sti = sti_get_rom(i);
if (!sti) if (!sti)
break; break;
...@@ -1470,11 +1473,9 @@ stifb_setup(char *options) ...@@ -1470,11 +1473,9 @@ stifb_setup(char *options)
if (strncmp(options, "bpp", 3) == 0) { if (strncmp(options, "bpp", 3) == 0) {
options += 3; options += 3;
for (i = 0; i < MAX_STI_ROMS; i++) { for (i = 0; i < MAX_STI_ROMS; i++) {
if (*options++ == ':') { if (*options++ != ':')
stifb_force_bpp[i] = simple_strtoul(options, &options, 10);
bpp = -1;
} else
break; break;
stifb_bpp_pref[i] = simple_strtoul(options, &options, 10);
} }
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment