Commit 0d556f1f authored by Thomas Zimmermann's avatar Thomas Zimmermann

video: Remove trailing whitespaces

Fix trailing whitespaces. No functional changes.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarHelge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-11-tzimmermann@suse.de
parent 910994c0
...@@ -282,7 +282,7 @@ static void sticon_init(struct vc_data *c, int init) ...@@ -282,7 +282,7 @@ static void sticon_init(struct vc_data *c, int init)
vc_cols = sti_onscreen_x(sti) / sti->font->width; vc_cols = sti_onscreen_x(sti) / sti->font->width;
vc_rows = sti_onscreen_y(sti) / sti->font->height; vc_rows = sti_onscreen_y(sti) / sti->font->height;
c->vc_can_do_color = 1; c->vc_can_do_color = 1;
if (init) { if (init) {
c->vc_cols = vc_cols; c->vc_cols = vc_cols;
c->vc_rows = vc_rows; c->vc_rows = vc_rows;
...@@ -374,7 +374,7 @@ static const struct consw sti_con = { ...@@ -374,7 +374,7 @@ static const struct consw sti_con = {
.con_font_set = sticon_font_set, .con_font_set = sticon_font_set,
.con_font_default = sticon_font_default, .con_font_default = sticon_font_default,
.con_build_attr = sticon_build_attr, .con_build_attr = sticon_build_attr,
.con_invert_region = sticon_invert_region, .con_invert_region = sticon_invert_region,
}; };
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org> * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
* Copyright (C) 2001-2020 Helge Deller <deller@gmx.de> * Copyright (C) 2001-2020 Helge Deller <deller@gmx.de>
* Copyright (C) 2001-2002 Thomas Bogendoerfer <tsbogend@alpha.franken.de> * Copyright (C) 2001-2002 Thomas Bogendoerfer <tsbogend@alpha.franken.de>
* *
* TODO: * TODO:
* - call STI in virtual mode rather than in real mode * - call STI in virtual mode rather than in real mode
* - screen blanking with state_mgmt() in text mode STI ? * - screen blanking with state_mgmt() in text mode STI ?
* - try to make it work on m68k hp workstations ;) * - try to make it work on m68k hp workstations ;)
* *
*/ */
#define pr_fmt(fmt) "%s: " fmt, KBUILD_MODNAME #define pr_fmt(fmt) "%s: " fmt, KBUILD_MODNAME
...@@ -66,12 +66,12 @@ static const u8 col_trans[8] = { ...@@ -66,12 +66,12 @@ static const u8 col_trans[8] = {
#define c_index(sti, c) ((c) & 0xff) #define c_index(sti, c) ((c) & 0xff)
static const struct sti_init_flags default_init_flags = { static const struct sti_init_flags default_init_flags = {
.wait = STI_WAIT, .wait = STI_WAIT,
.reset = 1, .reset = 1,
.text = 1, .text = 1,
.nontext = 1, .nontext = 1,
.no_chg_bet = 1, .no_chg_bet = 1,
.no_chg_bei = 1, .no_chg_bei = 1,
.init_cmap_tx = 1, .init_cmap_tx = 1,
}; };
...@@ -104,7 +104,7 @@ static int sti_init_graph(struct sti_struct *sti) ...@@ -104,7 +104,7 @@ static int sti_init_graph(struct sti_struct *sti)
pr_err("STI init_graph failed (ret %d, errno %d)\n", ret, err); pr_err("STI init_graph failed (ret %d, errno %d)\n", ret, err);
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -120,7 +120,7 @@ static void sti_inq_conf(struct sti_struct *sti) ...@@ -120,7 +120,7 @@ static void sti_inq_conf(struct sti_struct *sti)
s32 ret; s32 ret;
outptr->ext_ptr = STI_PTR(&sti->sti_data->inq_outptr_ext); outptr->ext_ptr = STI_PTR(&sti->sti_data->inq_outptr_ext);
do { do {
spin_lock_irqsave(&sti->lock, flags); spin_lock_irqsave(&sti->lock, flags);
memset(inptr, 0, sizeof(*inptr)); memset(inptr, 0, sizeof(*inptr));
...@@ -162,9 +162,9 @@ sti_putc(struct sti_struct *sti, int c, int y, int x, ...@@ -162,9 +162,9 @@ sti_putc(struct sti_struct *sti, int c, int y, int x,
} }
static const struct sti_blkmv_flags clear_blkmv_flags = { static const struct sti_blkmv_flags clear_blkmv_flags = {
.wait = STI_WAIT, .wait = STI_WAIT,
.color = 1, .color = 1,
.clear = 1, .clear = 1,
}; };
void void
...@@ -185,7 +185,7 @@ sti_set(struct sti_struct *sti, int src_y, int src_x, ...@@ -185,7 +185,7 @@ sti_set(struct sti_struct *sti, int src_y, int src_x,
struct sti_blkmv_outptr *outptr = &sti->sti_data->blkmv_outptr; struct sti_blkmv_outptr *outptr = &sti->sti_data->blkmv_outptr;
s32 ret; s32 ret;
unsigned long flags; unsigned long flags;
do { do {
spin_lock_irqsave(&sti->lock, flags); spin_lock_irqsave(&sti->lock, flags);
*inptr = inptr_default; *inptr = inptr_default;
...@@ -224,7 +224,7 @@ sti_clear(struct sti_struct *sti, int src_y, int src_x, ...@@ -224,7 +224,7 @@ sti_clear(struct sti_struct *sti, int src_y, int src_x,
} }
static const struct sti_blkmv_flags default_blkmv_flags = { static const struct sti_blkmv_flags default_blkmv_flags = {
.wait = STI_WAIT, .wait = STI_WAIT,
}; };
void void
...@@ -291,14 +291,14 @@ static int __init sti_setup(char *str) ...@@ -291,14 +291,14 @@ static int __init sti_setup(char *str)
{ {
if (str) if (str)
strscpy(default_sti_path, str, sizeof(default_sti_path)); strscpy(default_sti_path, str, sizeof(default_sti_path));
return 1; return 1;
} }
/* Assuming the machine has multiple STI consoles (=graphic cards) which /* Assuming the machine has multiple STI consoles (=graphic cards) which
* all get detected by sticon, the user may define with the linux kernel * all get detected by sticon, the user may define with the linux kernel
* parameter sti=<x> which of them will be the initial boot-console. * parameter sti=<x> which of them will be the initial boot-console.
* <x> is a number between 0 and MAX_STI_ROMS, with 0 as the default * <x> is a number between 0 and MAX_STI_ROMS, with 0 as the default
* STI screen. * STI screen.
*/ */
__setup("sti=", sti_setup); __setup("sti=", sti_setup);
...@@ -341,13 +341,13 @@ static int sti_font_setup(char *str) ...@@ -341,13 +341,13 @@ static int sti_font_setup(char *str)
* should be used by the sticon driver to draw characters to the screen. * should be used by the sticon driver to draw characters to the screen.
* Possible values are: * Possible values are:
* - sti_font=<fb_fontname>: * - sti_font=<fb_fontname>:
* <fb_fontname> is the name of one of the linux-kernel built-in * <fb_fontname> is the name of one of the linux-kernel built-in
* framebuffer font names (e.g. VGA8x16, SUN22x18). * framebuffer font names (e.g. VGA8x16, SUN22x18).
* This is only available if the fonts have been statically compiled * This is only available if the fonts have been statically compiled
* in with e.g. the CONFIG_FONT_8x16 or CONFIG_FONT_SUN12x22 options. * in with e.g. the CONFIG_FONT_8x16 or CONFIG_FONT_SUN12x22 options.
* - sti_font=<number> (<number> = 1,2,3,...) * - sti_font=<number> (<number> = 1,2,3,...)
* most STI ROMs have built-in HP specific fonts, which can be selected * most STI ROMs have built-in HP specific fonts, which can be selected
* by giving the desired number to the sticon driver. * by giving the desired number to the sticon driver.
* NOTE: This number is machine and STI ROM dependend. * NOTE: This number is machine and STI ROM dependend.
* - sti_font=<height>x<width> (e.g. sti_font=16x8) * - sti_font=<height>x<width> (e.g. sti_font=16x8)
* <height> and <width> gives hints to the height and width of the * <height> and <width> gives hints to the height and width of the
...@@ -359,12 +359,12 @@ __setup("sti_font=", sti_font_setup); ...@@ -359,12 +359,12 @@ __setup("sti_font=", sti_font_setup);
#endif #endif
static void sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, static void sti_dump_globcfg(struct sti_glob_cfg *glob_cfg,
unsigned int sti_mem_request) unsigned int sti_mem_request)
{ {
struct sti_glob_cfg_ext *cfg; struct sti_glob_cfg_ext *cfg;
pr_debug("%d text planes\n" pr_debug("%d text planes\n"
"%4d x %4d screen resolution\n" "%4d x %4d screen resolution\n"
"%4d x %4d offscreen\n" "%4d x %4d offscreen\n"
...@@ -384,7 +384,7 @@ static void sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, ...@@ -384,7 +384,7 @@ static void sti_dump_globcfg(struct sti_glob_cfg *glob_cfg,
glob_cfg->reent_lvl, glob_cfg->reent_lvl,
glob_cfg->save_addr); glob_cfg->save_addr);
/* dump extended cfg */ /* dump extended cfg */
cfg = PTR_STI((unsigned long)glob_cfg->ext_ptr); cfg = PTR_STI((unsigned long)glob_cfg->ext_ptr);
pr_debug("monitor %d\n" pr_debug("monitor %d\n"
"in friendly mode: %d\n" "in friendly mode: %d\n"
...@@ -437,10 +437,10 @@ static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address, ...@@ -437,10 +437,10 @@ static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address,
glob_cfg->save_addr = STI_PTR(save_addr); glob_cfg->save_addr = STI_PTR(save_addr);
for (i=0; i<8; i++) { for (i=0; i<8; i++) {
unsigned long newhpa, len; unsigned long newhpa, len;
if (sti->pd) { if (sti->pd) {
unsigned char offs = sti->rm_entry[i]; unsigned char offs = sti->rm_entry[i];
if (offs == 0) if (offs == 0)
continue; continue;
if (offs != PCI_ROM_ADDRESS && if (offs != PCI_ROM_ADDRESS &&
...@@ -456,18 +456,18 @@ static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address, ...@@ -456,18 +456,18 @@ static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address,
sti->regions_phys[i] = sti->regions_phys[i] =
REGION_OFFSET_TO_PHYS(sti->regions[i], newhpa); REGION_OFFSET_TO_PHYS(sti->regions[i], newhpa);
len = sti->regions[i].region_desc.length * 4096; len = sti->regions[i].region_desc.length * 4096;
if (len) if (len)
glob_cfg->region_ptrs[i] = sti->regions_phys[i]; glob_cfg->region_ptrs[i] = sti->regions_phys[i];
pr_debug("region #%d: phys %08lx, region_ptr %08x, len=%lukB, " pr_debug("region #%d: phys %08lx, region_ptr %08x, len=%lukB, "
"btlb=%d, sysonly=%d, cache=%d, last=%d\n", "btlb=%d, sysonly=%d, cache=%d, last=%d\n",
i, sti->regions_phys[i], glob_cfg->region_ptrs[i], i, sti->regions_phys[i], glob_cfg->region_ptrs[i],
len/1024, len/1024,
sti->regions[i].region_desc.btlb, sti->regions[i].region_desc.btlb,
sti->regions[i].region_desc.sys_only, sti->regions[i].region_desc.sys_only,
sti->regions[i].region_desc.cache, sti->regions[i].region_desc.cache,
sti->regions[i].region_desc.last); sti->regions[i].region_desc.last);
/* last entry reached ? */ /* last entry reached ? */
...@@ -482,7 +482,7 @@ static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address, ...@@ -482,7 +482,7 @@ static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address,
glob_cfg_ext->sti_mem_addr = STI_PTR(sti_mem_addr); glob_cfg_ext->sti_mem_addr = STI_PTR(sti_mem_addr);
sti->glob_cfg = glob_cfg; sti->glob_cfg = glob_cfg;
return 0; return 0;
} }
...@@ -495,7 +495,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) ...@@ -495,7 +495,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
void *dest; void *dest;
struct sti_rom_font *nf; struct sti_rom_font *nf;
struct sti_cooked_font *cooked_font; struct sti_cooked_font *cooked_font;
if (fbfont_name && strlen(fbfont_name)) if (fbfont_name && strlen(fbfont_name))
fbfont = find_font(fbfont_name); fbfont = find_font(fbfont_name);
if (!fbfont) if (!fbfont)
...@@ -505,8 +505,8 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) ...@@ -505,8 +505,8 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
pr_info(" using %ux%u framebuffer font %s\n", pr_info(" using %ux%u framebuffer font %s\n",
fbfont->width, fbfont->height, fbfont->name); fbfont->width, fbfont->height, fbfont->name);
bpc = ((fbfont->width+7)/8) * fbfont->height; bpc = ((fbfont->width+7)/8) * fbfont->height;
size = bpc * fbfont->charcount; size = bpc * fbfont->charcount;
size += sizeof(struct sti_rom_font); size += sizeof(struct sti_rom_font);
...@@ -533,7 +533,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) ...@@ -533,7 +533,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
kfree(nf); kfree(nf);
return NULL; return NULL;
} }
cooked_font->raw = nf; cooked_font->raw = nf;
cooked_font->raw_ptr = nf; cooked_font->raw_ptr = nf;
cooked_font->next_font = NULL; cooked_font->next_font = NULL;
...@@ -617,9 +617,9 @@ static void sti_dump_rom(struct sti_struct *sti) ...@@ -617,9 +617,9 @@ static void sti_dump_rom(struct sti_struct *sti)
int nr; int nr;
pr_info(" id %04x-%04x, conforms to spec rev. %d.%02x\n", pr_info(" id %04x-%04x, conforms to spec rev. %d.%02x\n",
rom->graphics_id[0], rom->graphics_id[0],
rom->graphics_id[1], rom->graphics_id[1],
rom->revno[0] >> 4, rom->revno[0] >> 4,
rom->revno[0] & 0x0f); rom->revno[0] & 0x0f);
pr_debug(" supports %d monitors\n", rom->num_mons); pr_debug(" supports %d monitors\n", rom->num_mons);
pr_debug(" font start %08x\n", rom->font_start); pr_debug(" font start %08x\n", rom->font_start);
...@@ -647,7 +647,7 @@ static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom, ...@@ -647,7 +647,7 @@ static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
{ {
struct sti_rom_font *raw_font, *font_start; struct sti_rom_font *raw_font, *font_start;
struct sti_cooked_font *cooked_font; struct sti_cooked_font *cooked_font;
cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL);
if (!cooked_font) if (!cooked_font)
return 0; return 0;
...@@ -745,7 +745,7 @@ static struct sti_rom *sti_get_bmode_rom (unsigned long address) ...@@ -745,7 +745,7 @@ static struct sti_rom *sti_get_bmode_rom (unsigned long address)
raw_font = ((void *)raw) + raw->font_start; raw_font = ((void *)raw) + raw->font_start;
font_start = raw_font; font_start = raw_font;
while (raw_font->next_font) { while (raw_font->next_font) {
BMODE_RELOCATE (raw_font->next_font); BMODE_RELOCATE (raw_font->next_font);
raw_font = ((void *)font_start) + raw_font->next_font; raw_font = ((void *)font_start) + raw_font->next_font;
...@@ -759,7 +759,7 @@ static struct sti_rom *sti_get_wmode_rom(unsigned long address) ...@@ -759,7 +759,7 @@ static struct sti_rom *sti_get_wmode_rom(unsigned long address)
struct sti_rom *raw; struct sti_rom *raw;
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 = gsc_readl(address + offsetof(struct sti_rom,last_addr)); size = gsc_readl(address + offsetof(struct sti_rom,last_addr));
raw = kmalloc(size, STI_LOWMEM); raw = kmalloc(size, STI_LOWMEM);
...@@ -869,7 +869,7 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address, ...@@ -869,7 +869,7 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address,
pr_warn("maximum number of STI ROMS reached !\n"); pr_warn("maximum number of STI ROMS reached !\n");
return NULL; return NULL;
} }
sti = kzalloc(sizeof(*sti), GFP_KERNEL); sti = kzalloc(sizeof(*sti), GFP_KERNEL);
if (!sti) if (!sti)
return NULL; return NULL;
...@@ -890,19 +890,19 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address, ...@@ -890,19 +890,19 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address,
u32 *rm; u32 *rm;
i = gsc_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,...) */
pr_warn("PCI ROM is not a STI ROM type image (0x%8x)\n", i); pr_warn("PCI ROM is not a STI ROM type image (0x%8x)\n", i);
goto out_err; goto out_err;
} }
sti->pd = pd; sti->pd = pd;
i = gsc_readl(address+0x0c); i = gsc_readl(address+0x0c);
pr_debug("PCI ROM size (from header) = %d kB\n", pr_debug("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++ = gsc_readl(address+rm_offset+0x00); *rm++ = gsc_readl(address+rm_offset+0x00);
...@@ -915,9 +915,9 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address, ...@@ -915,9 +915,9 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address,
pr_debug("sig %04x, PCI STI ROM at %08lx\n", sig, address); pr_debug("sig %04x, PCI STI ROM at %08lx\n", sig, address);
goto test_rom; goto test_rom;
} }
ok = 0; ok = 0;
if ((sig & 0xff) == 0x01) { if ((sig & 0xff) == 0x01) {
pr_debug(" byte mode ROM at %08lx, hpa at %08lx\n", pr_debug(" byte mode ROM at %08lx, hpa at %08lx\n",
address, hpa); address, hpa);
...@@ -941,7 +941,7 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address, ...@@ -941,7 +941,7 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address,
*/ */
if (sti->pd) { if (sti->pd) {
unsigned long rom_base; unsigned long rom_base;
rom_base = pci_resource_start(sti->pd, PCI_ROM_RESOURCE); rom_base = pci_resource_start(sti->pd, PCI_ROM_RESOURCE);
pci_write_config_dword(sti->pd, PCI_ROM_ADDRESS, rom_base & ~PCI_ROM_ADDRESS_ENABLE); pci_write_config_dword(sti->pd, PCI_ROM_ADDRESS, rom_base & ~PCI_ROM_ADDRESS_ENABLE);
pr_debug("STI PCI ROM disabled\n"); pr_debug("STI PCI ROM disabled\n");
} }
...@@ -952,13 +952,13 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address, ...@@ -952,13 +952,13 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address,
sti_inq_conf(sti); sti_inq_conf(sti);
sti_dump_globcfg(sti->glob_cfg, sti->sti_mem_request); sti_dump_globcfg(sti->glob_cfg, sti->sti_mem_request);
sti_dump_outptr(sti); sti_dump_outptr(sti);
pr_info(" graphics card name: %s\n", pr_info(" graphics card name: %s\n",
sti->sti_data->inq_outptr.dev_name); sti->sti_data->inq_outptr.dev_name);
sti_roms[num_sti_roms] = sti; sti_roms[num_sti_roms] = sti;
num_sti_roms++; num_sti_roms++;
return sti; return sti;
out_err: out_err:
...@@ -974,9 +974,9 @@ static void sticore_check_for_default_sti(struct sti_struct *sti, char *path) ...@@ -974,9 +974,9 @@ static void sticore_check_for_default_sti(struct sti_struct *sti, char *path)
} }
/* /*
* on newer systems PDC gives the address of the ROM * on newer systems PDC gives the address of the ROM
* in the additional address field addr[1] while on * in the additional address field addr[1] while on
* older Systems the PDC stores it in page0->proc_sti * older Systems the PDC stores it in page0->proc_sti
*/ */
static int __init sticore_pa_init(struct parisc_device *dev) static int __init sticore_pa_init(struct parisc_device *dev)
{ {
...@@ -1005,7 +1005,7 @@ static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent) ...@@ -1005,7 +1005,7 @@ static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent)
unsigned int fb_len, rom_len; unsigned int fb_len, rom_len;
int err; int err;
struct sti_struct *sti; struct sti_struct *sti;
err = pci_enable_device(pd); err = pci_enable_device(pd);
if (err < 0) { if (err < 0) {
dev_err(&pd->dev, "Cannot enable PCI device\n"); dev_err(&pd->dev, "Cannot enable PCI device\n");
...@@ -1032,7 +1032,7 @@ static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent) ...@@ -1032,7 +1032,7 @@ static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent)
print_pci_hwpath(pd, sti->pa_path); print_pci_hwpath(pd, sti->pa_path);
sticore_check_for_default_sti(sti, sti->pa_path); sticore_check_for_default_sti(sti, sti->pa_path);
} }
if (!sti) { if (!sti) {
pr_warn("Unable to handle STI device '%s'\n", pci_name(pd)); pr_warn("Unable to handle STI device '%s'\n", pci_name(pd));
return -ENODEV; return -ENODEV;
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
* *
* Probably the best solution to all this is have the generic code manage * Probably the best solution to all this is have the generic code manage
* the screen buffer and a kernel thread to call STI occasionally. * the screen buffer and a kernel thread to call STI occasionally.
* *
* Luckily, the frame buffer guys have the same problem so we can just wait * Luckily, the frame buffer guys have the same problem so we can just wait
* for them to fix it and steal their solution. prumpf * for them to fix it and steal their solution. prumpf
*/ */
#include <asm/io.h> #include <asm/io.h>
#define STI_WAIT 1 #define STI_WAIT 1
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
/* STI function configuration structs */ /* STI function configuration structs */
typedef union region { typedef union region {
struct { struct {
u32 offset : 14; /* offset in 4kbyte page */ u32 offset : 14; /* offset in 4kbyte page */
u32 sys_only : 1; /* don't map to user space */ u32 sys_only : 1; /* don't map to user space */
u32 cache : 1; /* map to data cache */ u32 cache : 1; /* map to data cache */
...@@ -154,7 +154,7 @@ struct sti_conf_inptr { ...@@ -154,7 +154,7 @@ struct sti_conf_inptr {
}; };
struct sti_conf_outptr_ext { struct sti_conf_outptr_ext {
u32 crt_config[3]; /* hardware specific X11/OGL information */ u32 crt_config[3]; /* hardware specific X11/OGL information */
u32 crt_hdw[3]; u32 crt_hdw[3];
u32 future_ptr; u32 future_ptr;
}; };
...@@ -211,7 +211,7 @@ struct sti_rom { ...@@ -211,7 +211,7 @@ struct sti_rom {
u32 set_cm_entry; u32 set_cm_entry;
u32 dma_ctrl; u32 dma_ctrl;
u8 res040[7 * 4]; u8 res040[7 * 4];
u32 init_graph_addr; u32 init_graph_addr;
u32 state_mgmt_addr; u32 state_mgmt_addr;
u32 font_unp_addr; u32 font_unp_addr;
...@@ -271,7 +271,7 @@ struct sti_font_flags { ...@@ -271,7 +271,7 @@ struct sti_font_flags {
u32 pad : 30; /* pad to word boundary */ u32 pad : 30; /* pad to word boundary */
u32 future_ptr; /* pointer to future data */ u32 future_ptr; /* pointer to future data */
}; };
struct sti_font_outptr { struct sti_font_outptr {
s32 errno; /* error number on failure */ s32 errno; /* error number on failure */
u32 future_ptr; /* pointer to future data */ u32 future_ptr; /* pointer to future data */
...@@ -338,7 +338,7 @@ struct sti_all_data { ...@@ -338,7 +338,7 @@ struct sti_all_data {
struct sti_struct { struct sti_struct {
spinlock_t lock; spinlock_t lock;
/* char **mon_strings; */ /* char **mon_strings; */
int sti_mem_request; int sti_mem_request;
u32 graphics_id[2]; u32 graphics_id[2];
......
/* /*
* linux/drivers/video/stifb.c - * linux/drivers/video/stifb.c -
* Low level Frame buffer driver for HP workstations with * Low level Frame buffer driver for HP workstations with
* STI (standard text interface) video firmware. * STI (standard text interface) video firmware.
* *
* Copyright (C) 2001-2006 Helge Deller <deller@gmx.de> * Copyright (C) 2001-2006 Helge Deller <deller@gmx.de>
* Portions Copyright (C) 2001 Thomas Bogendoerfer <tsbogend@alpha.franken.de> * Portions Copyright (C) 2001 Thomas Bogendoerfer <tsbogend@alpha.franken.de>
* *
* Based on: * Based on:
* - linux/drivers/video/artistfb.c -- Artist frame buffer driver * - linux/drivers/video/artistfb.c -- Artist frame buffer driver
* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org> * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* - HP Xhp cfb-based X11 window driver for XFree86 * - HP Xhp cfb-based X11 window driver for XFree86
* (c)Copyright 1992 Hewlett-Packard Co. * (c)Copyright 1992 Hewlett-Packard Co.
* *
* *
* The following graphics display devices (NGLE family) are supported by this driver: * The following graphics display devices (NGLE family) are supported by this driver:
* *
* HPA4070A known as "HCRX", a 1280x1024 color device with 8 planes * HPA4070A known as "HCRX", a 1280x1024 color device with 8 planes
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* supports 1280x1024 color displays with 8 planes. * supports 1280x1024 color displays with 8 planes.
* HP710G same as HP710C, 1280x1024 grayscale only * HP710G same as HP710C, 1280x1024 grayscale only
* HP710L same as HP710C, 1024x768 color only * HP710L same as HP710C, 1024x768 color only
* HP712 internal graphics support on HP9000s712 SPU, supports 640x480, * HP712 internal graphics support on HP9000s712 SPU, supports 640x480,
* 1024x768 or 1280x1024 color displays on 8 planes (Artist) * 1024x768 or 1280x1024 color displays on 8 planes (Artist)
* *
* This file is subject to the terms and conditions of the GNU General Public * This file is subject to the terms and conditions of the GNU General Public
...@@ -92,7 +92,7 @@ typedef struct { ...@@ -92,7 +92,7 @@ typedef struct {
__s32 misc_video_end; __s32 misc_video_end;
} video_setup_t; } video_setup_t;
typedef struct { typedef struct {
__s16 sizeof_ngle_data; __s16 sizeof_ngle_data;
__s16 x_size_visible; /* visible screen dim in pixels */ __s16 x_size_visible; /* visible screen dim in pixels */
__s16 y_size_visible; __s16 y_size_visible;
...@@ -177,10 +177,10 @@ static int __initdata stifb_bpp_pref[MAX_STI_ROMS]; ...@@ -177,10 +177,10 @@ static int __initdata stifb_bpp_pref[MAX_STI_ROMS];
#endif /* DEBUG_STIFB_REGS */ #endif /* DEBUG_STIFB_REGS */
#define ENABLE 1 /* for enabling/disabling screen */ #define ENABLE 1 /* for enabling/disabling screen */
#define DISABLE 0 #define DISABLE 0
#define NGLE_LOCK(fb_info) do { } while (0) #define NGLE_LOCK(fb_info) do { } while (0)
#define NGLE_UNLOCK(fb_info) do { } while (0) #define NGLE_UNLOCK(fb_info) do { } while (0)
static void static void
...@@ -198,9 +198,9 @@ SETUP_HW(struct stifb_info *fb) ...@@ -198,9 +198,9 @@ SETUP_HW(struct stifb_info *fb)
static void static void
SETUP_FB(struct stifb_info *fb) SETUP_FB(struct stifb_info *fb)
{ {
unsigned int reg10_value = 0; unsigned int reg10_value = 0;
SETUP_HW(fb); SETUP_HW(fb);
switch (fb->id) switch (fb->id)
{ {
...@@ -210,15 +210,15 @@ SETUP_FB(struct stifb_info *fb) ...@@ -210,15 +210,15 @@ SETUP_FB(struct stifb_info *fb)
reg10_value = 0x13601000; reg10_value = 0x13601000;
break; break;
case S9000_ID_A1439A: case S9000_ID_A1439A:
if (fb->info.var.bits_per_pixel == 32) if (fb->info.var.bits_per_pixel == 32)
reg10_value = 0xBBA0A000; reg10_value = 0xBBA0A000;
else else
reg10_value = 0x13601000; reg10_value = 0x13601000;
break; break;
case S9000_ID_HCRX: case S9000_ID_HCRX:
if (fb->info.var.bits_per_pixel == 32) if (fb->info.var.bits_per_pixel == 32)
reg10_value = 0xBBA0A000; reg10_value = 0xBBA0A000;
else else
reg10_value = 0x13602000; reg10_value = 0x13602000;
break; break;
case S9000_ID_TIMBER: case S9000_ID_TIMBER:
...@@ -243,7 +243,7 @@ START_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb) ...@@ -243,7 +243,7 @@ START_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb)
} }
static void static void
WRITE_IMAGE_COLOR(struct stifb_info *fb, int index, int color) WRITE_IMAGE_COLOR(struct stifb_info *fb, int index, int color)
{ {
SETUP_HW(fb); SETUP_HW(fb);
WRITE_WORD(((0x100+index)<<2), fb, REG_3); WRITE_WORD(((0x100+index)<<2), fb, REG_3);
...@@ -251,30 +251,30 @@ WRITE_IMAGE_COLOR(struct stifb_info *fb, int index, int color) ...@@ -251,30 +251,30 @@ WRITE_IMAGE_COLOR(struct stifb_info *fb, int index, int color)
} }
static void static void
FINISH_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb) FINISH_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb)
{ {
WRITE_WORD(0x400, fb, REG_2); WRITE_WORD(0x400, fb, REG_2);
if (fb->info.var.bits_per_pixel == 32) { if (fb->info.var.bits_per_pixel == 32) {
WRITE_WORD(0x83000100, fb, REG_1); WRITE_WORD(0x83000100, fb, REG_1);
} else { } else {
if (fb->id == S9000_ID_ARTIST || fb->id == CRT_ID_VISUALIZE_EG) if (fb->id == S9000_ID_ARTIST || fb->id == CRT_ID_VISUALIZE_EG)
WRITE_WORD(0x80000100, fb, REG_26); WRITE_WORD(0x80000100, fb, REG_26);
else else
WRITE_WORD(0x80000100, fb, REG_1); WRITE_WORD(0x80000100, fb, REG_1);
} }
SETUP_FB(fb); SETUP_FB(fb);
} }
static void static void
SETUP_RAMDAC(struct stifb_info *fb) SETUP_RAMDAC(struct stifb_info *fb)
{ {
SETUP_HW(fb); SETUP_HW(fb);
WRITE_WORD(0x04000000, fb, 0x1020); WRITE_WORD(0x04000000, fb, 0x1020);
WRITE_WORD(0xff000000, fb, 0x1028); WRITE_WORD(0xff000000, fb, 0x1028);
} }
static void static void
CRX24_SETUP_RAMDAC(struct stifb_info *fb) CRX24_SETUP_RAMDAC(struct stifb_info *fb)
{ {
SETUP_HW(fb); SETUP_HW(fb);
WRITE_WORD(0x04000000, fb, 0x1000); WRITE_WORD(0x04000000, fb, 0x1000);
...@@ -286,14 +286,14 @@ CRX24_SETUP_RAMDAC(struct stifb_info *fb) ...@@ -286,14 +286,14 @@ CRX24_SETUP_RAMDAC(struct stifb_info *fb)
} }
#if 0 #if 0
static void static void
HCRX_SETUP_RAMDAC(struct stifb_info *fb) HCRX_SETUP_RAMDAC(struct stifb_info *fb)
{ {
WRITE_WORD(0xffffffff, fb, REG_32); WRITE_WORD(0xffffffff, fb, REG_32);
} }
#endif #endif
static void static void
CRX24_SET_OVLY_MASK(struct stifb_info *fb) CRX24_SET_OVLY_MASK(struct stifb_info *fb)
{ {
SETUP_HW(fb); SETUP_HW(fb);
...@@ -314,7 +314,7 @@ ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) ...@@ -314,7 +314,7 @@ ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
WRITE_WORD(value, fb, 0x1038); WRITE_WORD(value, fb, 0x1038);
} }
static void static void
CRX24_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) CRX24_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
{ {
unsigned int value = enable ? 0x10000000 : 0x30000000; unsigned int value = enable ? 0x10000000 : 0x30000000;
...@@ -325,11 +325,11 @@ CRX24_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) ...@@ -325,11 +325,11 @@ CRX24_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
} }
static void static void
ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
{ {
u32 DregsMiscVideo = REG_21; u32 DregsMiscVideo = REG_21;
u32 DregsMiscCtl = REG_27; u32 DregsMiscCtl = REG_27;
SETUP_HW(fb); SETUP_HW(fb);
if (enable) { if (enable) {
WRITE_WORD(READ_WORD(fb, DregsMiscVideo) | 0x0A000000, fb, DregsMiscVideo); WRITE_WORD(READ_WORD(fb, DregsMiscVideo) | 0x0A000000, fb, DregsMiscVideo);
...@@ -344,7 +344,7 @@ ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) ...@@ -344,7 +344,7 @@ ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
(READ_BYTE(fb, REG_16b3) - 1) (READ_BYTE(fb, REG_16b3) - 1)
#define HYPER_CONFIG_PLANES_24 0x00000100 #define HYPER_CONFIG_PLANES_24 0x00000100
#define IS_24_DEVICE(fb) \ #define IS_24_DEVICE(fb) \
(fb->deviceSpecificConfig & HYPER_CONFIG_PLANES_24) (fb->deviceSpecificConfig & HYPER_CONFIG_PLANES_24)
...@@ -470,15 +470,15 @@ SETUP_ATTR_ACCESS(struct stifb_info *fb, unsigned BufferNumber) ...@@ -470,15 +470,15 @@ SETUP_ATTR_ACCESS(struct stifb_info *fb, unsigned BufferNumber)
} }
static void static void
SET_ATTR_SIZE(struct stifb_info *fb, int width, int height) SET_ATTR_SIZE(struct stifb_info *fb, int width, int height)
{ {
/* REG_6 seems to have special values when run on a /* REG_6 seems to have special values when run on a
RDI precisionbook parisc laptop (INTERNAL_EG_DX1024 or RDI precisionbook parisc laptop (INTERNAL_EG_DX1024 or
INTERNAL_EG_X1024). The values are: INTERNAL_EG_X1024). The values are:
0x2f0: internal (LCD) & external display enabled 0x2f0: internal (LCD) & external display enabled
0x2a0: external display only 0x2a0: external display only
0x000: zero on standard artist graphic cards 0x000: zero on standard artist graphic cards
*/ */
WRITE_WORD(0x00000000, fb, REG_6); WRITE_WORD(0x00000000, fb, REG_6);
WRITE_WORD((width<<16) | height, fb, REG_9); WRITE_WORD((width<<16) | height, fb, REG_9);
WRITE_WORD(0x05000000, fb, REG_6); WRITE_WORD(0x05000000, fb, REG_6);
...@@ -486,7 +486,7 @@ SET_ATTR_SIZE(struct stifb_info *fb, int width, int height) ...@@ -486,7 +486,7 @@ SET_ATTR_SIZE(struct stifb_info *fb, int width, int height)
} }
static void static void
FINISH_ATTR_ACCESS(struct stifb_info *fb) FINISH_ATTR_ACCESS(struct stifb_info *fb)
{ {
SETUP_HW(fb); SETUP_HW(fb);
WRITE_WORD(0x00000000, fb, REG_12); WRITE_WORD(0x00000000, fb, REG_12);
...@@ -499,7 +499,7 @@ elkSetupPlanes(struct stifb_info *fb) ...@@ -499,7 +499,7 @@ elkSetupPlanes(struct stifb_info *fb)
SETUP_FB(fb); SETUP_FB(fb);
} }
static void static void
ngleSetupAttrPlanes(struct stifb_info *fb, int BufferNumber) ngleSetupAttrPlanes(struct stifb_info *fb, int BufferNumber)
{ {
SETUP_ATTR_ACCESS(fb, BufferNumber); SETUP_ATTR_ACCESS(fb, BufferNumber);
...@@ -519,7 +519,7 @@ rattlerSetupPlanes(struct stifb_info *fb) ...@@ -519,7 +519,7 @@ rattlerSetupPlanes(struct stifb_info *fb)
* read mask register for overlay planes, not image planes). * read mask register for overlay planes, not image planes).
*/ */
CRX24_SETUP_RAMDAC(fb); CRX24_SETUP_RAMDAC(fb);
/* change fb->id temporarily to fool SETUP_FB() */ /* change fb->id temporarily to fool SETUP_FB() */
saved_id = fb->id; saved_id = fb->id;
fb->id = CRX24_OVERLAY_PLANES; fb->id = CRX24_OVERLAY_PLANES;
...@@ -565,7 +565,7 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) ...@@ -565,7 +565,7 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length)
lutBltCtl.all = 0x80000000; lutBltCtl.all = 0x80000000;
lutBltCtl.fields.length = length; lutBltCtl.fields.length = length;
switch (fb->id) switch (fb->id)
{ {
case S9000_ID_A1439A: /* CRX24 */ case S9000_ID_A1439A: /* CRX24 */
if (fb->var.bits_per_pixel == 8) { if (fb->var.bits_per_pixel == 8) {
...@@ -576,12 +576,12 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) ...@@ -576,12 +576,12 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length)
lutBltCtl.fields.lutOffset = 0 * 256; lutBltCtl.fields.lutOffset = 0 * 256;
} }
break; break;
case S9000_ID_ARTIST: case S9000_ID_ARTIST:
lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE; lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE;
lutBltCtl.fields.lutOffset = 0 * 256; lutBltCtl.fields.lutOffset = 0 * 256;
break; break;
default: default:
lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE; lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE;
lutBltCtl.fields.lutOffset = 0; lutBltCtl.fields.lutOffset = 0;
...@@ -596,7 +596,7 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) ...@@ -596,7 +596,7 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length)
#endif #endif
static NgleLutBltCtl static NgleLutBltCtl
setHyperLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) setHyperLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length)
{ {
NgleLutBltCtl lutBltCtl; NgleLutBltCtl lutBltCtl;
...@@ -633,7 +633,7 @@ static void hyperUndoITE(struct stifb_info *fb) ...@@ -633,7 +633,7 @@ static void hyperUndoITE(struct stifb_info *fb)
/* Hardware setup for full-depth write to "magic" location */ /* Hardware setup for full-depth write to "magic" location */
GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7); GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7);
NGLE_QUICK_SET_DST_BM_ACCESS(fb, NGLE_QUICK_SET_DST_BM_ACCESS(fb,
BA(IndexedDcd, Otc04, Ots08, AddrLong, BA(IndexedDcd, Otc04, Ots08, AddrLong,
BAJustPoint(0), BINovly, BAIndexBase(0))); BAJustPoint(0), BINovly, BAIndexBase(0)));
NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb,
...@@ -653,13 +653,13 @@ static void hyperUndoITE(struct stifb_info *fb) ...@@ -653,13 +653,13 @@ static void hyperUndoITE(struct stifb_info *fb)
NGLE_UNLOCK(fb); NGLE_UNLOCK(fb);
} }
static void static void
ngleDepth8_ClearImagePlanes(struct stifb_info *fb) ngleDepth8_ClearImagePlanes(struct stifb_info *fb)
{ {
/* FIXME! */ /* FIXME! */
} }
static void static void
ngleDepth24_ClearImagePlanes(struct stifb_info *fb) ngleDepth24_ClearImagePlanes(struct stifb_info *fb)
{ {
/* FIXME! */ /* FIXME! */
...@@ -675,7 +675,7 @@ ngleResetAttrPlanes(struct stifb_info *fb, unsigned int ctlPlaneReg) ...@@ -675,7 +675,7 @@ ngleResetAttrPlanes(struct stifb_info *fb, unsigned int ctlPlaneReg)
NGLE_LOCK(fb); NGLE_LOCK(fb);
GET_FIFO_SLOTS(fb, nFreeFifoSlots, 4); GET_FIFO_SLOTS(fb, nFreeFifoSlots, 4);
NGLE_QUICK_SET_DST_BM_ACCESS(fb, NGLE_QUICK_SET_DST_BM_ACCESS(fb,
BA(IndexedDcd, Otc32, OtsIndirect, BA(IndexedDcd, Otc32, OtsIndirect,
AddrLong, BAJustPoint(0), AddrLong, BAJustPoint(0),
BINattr, BAIndexBase(0))); BINattr, BAIndexBase(0)));
...@@ -713,22 +713,22 @@ ngleResetAttrPlanes(struct stifb_info *fb, unsigned int ctlPlaneReg) ...@@ -713,22 +713,22 @@ ngleResetAttrPlanes(struct stifb_info *fb, unsigned int ctlPlaneReg)
/**** Finally, set the Control Plane Register back to zero: ****/ /**** Finally, set the Control Plane Register back to zero: ****/
GET_FIFO_SLOTS(fb, nFreeFifoSlots, 1); GET_FIFO_SLOTS(fb, nFreeFifoSlots, 1);
NGLE_QUICK_SET_CTL_PLN_REG(fb, 0); NGLE_QUICK_SET_CTL_PLN_REG(fb, 0);
NGLE_UNLOCK(fb); NGLE_UNLOCK(fb);
} }
static void static void
ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data) ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data)
{ {
int nFreeFifoSlots = 0; int nFreeFifoSlots = 0;
u32 packed_dst; u32 packed_dst;
u32 packed_len; u32 packed_len;
NGLE_LOCK(fb); NGLE_LOCK(fb);
/* Hardware setup */ /* Hardware setup */
GET_FIFO_SLOTS(fb, nFreeFifoSlots, 8); GET_FIFO_SLOTS(fb, nFreeFifoSlots, 8);
NGLE_QUICK_SET_DST_BM_ACCESS(fb, NGLE_QUICK_SET_DST_BM_ACCESS(fb,
BA(IndexedDcd, Otc04, Ots08, AddrLong, BA(IndexedDcd, Otc04, Ots08, AddrLong,
BAJustPoint(0), BINovly, BAIndexBase(0))); BAJustPoint(0), BINovly, BAIndexBase(0)));
...@@ -736,23 +736,23 @@ ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data) ...@@ -736,23 +736,23 @@ ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data)
NGLE_REALLY_SET_IMAGE_FG_COLOR(fb, data); NGLE_REALLY_SET_IMAGE_FG_COLOR(fb, data);
NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, mask); NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, mask);
packed_dst = 0; packed_dst = 0;
packed_len = (fb->info.var.xres << 16) | fb->info.var.yres; packed_len = (fb->info.var.xres << 16) | fb->info.var.yres;
NGLE_SET_DSTXY(fb, packed_dst); NGLE_SET_DSTXY(fb, packed_dst);
/* Write zeroes to overlay planes */ /* Write zeroes to overlay planes */
NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb,
IBOvals(RopSrc, MaskAddrOffset(0), IBOvals(RopSrc, MaskAddrOffset(0),
BitmapExtent08, StaticReg(0), BitmapExtent08, StaticReg(0),
DataDynamic, MaskOtc, BGx(0), FGx(0))); DataDynamic, MaskOtc, BGx(0), FGx(0)));
SET_LENXY_START_RECFILL(fb, packed_len); SET_LENXY_START_RECFILL(fb, packed_len);
NGLE_UNLOCK(fb); NGLE_UNLOCK(fb);
} }
static void static void
hyperResetPlanes(struct stifb_info *fb, int enable) hyperResetPlanes(struct stifb_info *fb, int enable)
{ {
unsigned int controlPlaneReg; unsigned int controlPlaneReg;
...@@ -783,7 +783,7 @@ hyperResetPlanes(struct stifb_info *fb, int enable) ...@@ -783,7 +783,7 @@ hyperResetPlanes(struct stifb_info *fb, int enable)
ngleClearOverlayPlanes(fb, 0xff, 255); ngleClearOverlayPlanes(fb, 0xff, 255);
/************************************************** /**************************************************
** Also need to counteract ITE settings ** Also need to counteract ITE settings
**************************************************/ **************************************************/
hyperUndoITE(fb); hyperUndoITE(fb);
break; break;
...@@ -803,13 +803,13 @@ hyperResetPlanes(struct stifb_info *fb, int enable) ...@@ -803,13 +803,13 @@ hyperResetPlanes(struct stifb_info *fb, int enable)
ngleResetAttrPlanes(fb, controlPlaneReg); ngleResetAttrPlanes(fb, controlPlaneReg);
break; break;
} }
NGLE_UNLOCK(fb); NGLE_UNLOCK(fb);
} }
/* Return pointer to in-memory structure holding ELK device-dependent ROM values. */ /* Return pointer to in-memory structure holding ELK device-dependent ROM values. */
static void static void
ngleGetDeviceRomData(struct stifb_info *fb) ngleGetDeviceRomData(struct stifb_info *fb)
{ {
#if 0 #if 0
...@@ -821,7 +821,7 @@ XXX: FIXME: !!! ...@@ -821,7 +821,7 @@ XXX: FIXME: !!!
char *pCard8; char *pCard8;
int i; int i;
char *mapOrigin = NULL; char *mapOrigin = NULL;
int romTableIdx; int romTableIdx;
pPackedDevRomData = fb->ngle_rom; pPackedDevRomData = fb->ngle_rom;
...@@ -888,7 +888,7 @@ SETUP_HCRX(struct stifb_info *fb) ...@@ -888,7 +888,7 @@ SETUP_HCRX(struct stifb_info *fb)
/* Initialize Hyperbowl registers */ /* Initialize Hyperbowl registers */
GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7); GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7);
if (IS_24_DEVICE(fb)) { if (IS_24_DEVICE(fb)) {
hyperbowl = (fb->info.var.bits_per_pixel == 32) ? hyperbowl = (fb->info.var.bits_per_pixel == 32) ?
HYPERBOWL_MODE01_8_24_LUT0_TRANSPARENT_LUT1_OPAQUE : HYPERBOWL_MODE01_8_24_LUT0_TRANSPARENT_LUT1_OPAQUE :
...@@ -897,9 +897,9 @@ SETUP_HCRX(struct stifb_info *fb) ...@@ -897,9 +897,9 @@ SETUP_HCRX(struct stifb_info *fb)
/* First write to Hyperbowl must happen twice (bug) */ /* First write to Hyperbowl must happen twice (bug) */
WRITE_WORD(hyperbowl, fb, REG_40); WRITE_WORD(hyperbowl, fb, REG_40);
WRITE_WORD(hyperbowl, fb, REG_40); WRITE_WORD(hyperbowl, fb, REG_40);
WRITE_WORD(HYPERBOWL_MODE2_8_24, fb, REG_39); WRITE_WORD(HYPERBOWL_MODE2_8_24, fb, REG_39);
WRITE_WORD(0x014c0148, fb, REG_42); /* Set lut 0 to be the direct color */ WRITE_WORD(0x014c0148, fb, REG_42); /* Set lut 0 to be the direct color */
WRITE_WORD(0x404c4048, fb, REG_43); WRITE_WORD(0x404c4048, fb, REG_43);
WRITE_WORD(0x034c0348, fb, REG_44); WRITE_WORD(0x034c0348, fb, REG_44);
...@@ -990,7 +990,7 @@ stifb_setcolreg(u_int regno, u_int red, u_int green, ...@@ -990,7 +990,7 @@ stifb_setcolreg(u_int regno, u_int red, u_int green,
0, /* Offset w/i LUT */ 0, /* Offset w/i LUT */
256); /* Load entire LUT */ 256); /* Load entire LUT */
NGLE_BINC_SET_SRCADDR(fb, NGLE_BINC_SET_SRCADDR(fb,
NGLE_LONG_FB_ADDRESS(0, 0x100, 0)); NGLE_LONG_FB_ADDRESS(0, 0x100, 0));
/* 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);
...@@ -1028,7 +1028,7 @@ stifb_blank(int blank_mode, struct fb_info *info) ...@@ -1028,7 +1028,7 @@ stifb_blank(int blank_mode, struct fb_info *info)
ENABLE_DISABLE_DISPLAY(fb, enable); ENABLE_DISABLE_DISPLAY(fb, enable);
break; break;
} }
SETUP_FB(fb); SETUP_FB(fb);
return 0; return 0;
} }
...@@ -1114,15 +1114,15 @@ stifb_init_display(struct stifb_info *fb) ...@@ -1114,15 +1114,15 @@ stifb_init_display(struct stifb_info *fb)
/* HCRX specific initialization */ /* HCRX specific initialization */
SETUP_HCRX(fb); SETUP_HCRX(fb);
/* /*
if (id == S9000_ID_HCRX) if (id == S9000_ID_HCRX)
hyperInitSprite(fb); hyperInitSprite(fb);
else else
ngleInitSprite(fb); ngleInitSprite(fb);
*/ */
/* Initialize the image planes. */ /* Initialize the image planes. */
switch (id) { switch (id) {
case S9000_ID_HCRX: case S9000_ID_HCRX:
hyperResetPlanes(fb, ENABLE); hyperResetPlanes(fb, ENABLE);
...@@ -1194,7 +1194,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1194,7 +1194,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
fb = kzalloc(sizeof(*fb), GFP_ATOMIC); fb = kzalloc(sizeof(*fb), GFP_ATOMIC);
if (!fb) if (!fb)
return -ENOMEM; return -ENOMEM;
info = &fb->info; info = &fb->info;
/* set struct to a known state */ /* set struct to a known state */
...@@ -1235,7 +1235,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1235,7 +1235,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
dev_name, fb->id); dev_name, fb->id);
goto out_err0; goto out_err0;
} }
/* default to 8 bpp on most graphic chips */ /* default to 8 bpp on most graphic chips */
bpp = 8; bpp = 8;
xres = sti_onscreen_x(fb->sti); xres = sti_onscreen_x(fb->sti);
...@@ -1256,7 +1256,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1256,7 +1256,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
fb->id = S9000_ID_A1659A; fb->id = S9000_ID_A1659A;
break; break;
case S9000_ID_TIMBER: /* HP9000/710 Any (may be a grayscale device) */ case S9000_ID_TIMBER: /* HP9000/710 Any (may be a grayscale device) */
if (strstr(dev_name, "GRAYSCALE") || if (strstr(dev_name, "GRAYSCALE") ||
strstr(dev_name, "Grayscale") || strstr(dev_name, "Grayscale") ||
strstr(dev_name, "grayscale")) strstr(dev_name, "grayscale"))
var->grayscale = 1; var->grayscale = 1;
...@@ -1295,16 +1295,16 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1295,16 +1295,16 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
case CRT_ID_VISUALIZE_EG: case CRT_ID_VISUALIZE_EG:
case S9000_ID_ARTIST: /* Artist */ case S9000_ID_ARTIST: /* Artist */
break; break;
default: default:
#ifdef FALLBACK_TO_1BPP #ifdef FALLBACK_TO_1BPP
printk(KERN_WARNING printk(KERN_WARNING
"stifb: Unsupported graphics card (id=0x%08x) " "stifb: Unsupported graphics card (id=0x%08x) "
"- now trying 1bpp mode instead\n", "- now trying 1bpp mode instead\n",
fb->id); fb->id);
bpp = 1; /* default to 1 bpp */ bpp = 1; /* default to 1 bpp */
break; break;
#else #else
printk(KERN_WARNING printk(KERN_WARNING
"stifb: Unsupported graphics card (id=0x%08x) " "stifb: Unsupported graphics card (id=0x%08x) "
"- skipping.\n", "- skipping.\n",
fb->id); fb->id);
...@@ -1320,11 +1320,11 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1320,11 +1320,11 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
fix->line_length = (fb->sti->glob_cfg->total_x * bpp) / 8; fix->line_length = (fb->sti->glob_cfg->total_x * bpp) / 8;
if (!fix->line_length) if (!fix->line_length)
fix->line_length = 2048; /* default */ fix->line_length = 2048; /* default */
/* limit fbsize to max visible screen size */ /* limit fbsize to max visible screen size */
if (fix->smem_len > yres*fix->line_length) if (fix->smem_len > yres*fix->line_length)
fix->smem_len = ALIGN(yres*fix->line_length, 4*1024*1024); fix->smem_len = ALIGN(yres*fix->line_length, 4*1024*1024);
fix->accel = FB_ACCEL_NONE; fix->accel = FB_ACCEL_NONE;
switch (bpp) { switch (bpp) {
...@@ -1350,7 +1350,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1350,7 +1350,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
default: default:
break; break;
} }
var->xres = var->xres_virtual = xres; var->xres = var->xres_virtual = xres;
var->yres = var->yres_virtual = yres; var->yres = var->yres_virtual = yres;
var->bits_per_pixel = bpp; var->bits_per_pixel = bpp;
...@@ -1379,7 +1379,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1379,7 +1379,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
fix->smem_start, fix->smem_start+fix->smem_len); fix->smem_start, fix->smem_start+fix->smem_len);
goto out_err2; goto out_err2;
} }
if (!request_mem_region(fix->mmio_start, fix->mmio_len, "stifb mmio")) { if (!request_mem_region(fix->mmio_start, fix->mmio_len, "stifb mmio")) {
printk(KERN_ERR "stifb: cannot reserve sti mmio region 0x%04lx-0x%04lx\n", printk(KERN_ERR "stifb: cannot reserve sti mmio region 0x%04lx-0x%04lx\n",
fix->mmio_start, fix->mmio_start+fix->mmio_len); fix->mmio_start, fix->mmio_start+fix->mmio_len);
...@@ -1393,11 +1393,11 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1393,11 +1393,11 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
fb_info(&fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n", fb_info(&fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n",
fix->id, fix->id,
var->xres, var->xres,
var->yres, var->yres,
var->bits_per_pixel, var->bits_per_pixel,
dev_name, dev_name,
fb->id, fb->id,
fix->mmio_start); fix->mmio_start);
return 0; return 0;
...@@ -1426,7 +1426,7 @@ static int __init stifb_init(void) ...@@ -1426,7 +1426,7 @@ static int __init stifb_init(void)
struct sti_struct *sti; struct sti_struct *sti;
struct sti_struct *def_sti; struct sti_struct *def_sti;
int i; int i;
#ifndef MODULE #ifndef MODULE
char *option = NULL; char *option = NULL;
...@@ -1438,7 +1438,7 @@ static int __init stifb_init(void) ...@@ -1438,7 +1438,7 @@ static int __init stifb_init(void)
printk(KERN_INFO "stifb: disabled by \"stifb=off\" kernel parameter\n"); printk(KERN_INFO "stifb: disabled by \"stifb=off\" kernel parameter\n");
return -ENXIO; return -ENXIO;
} }
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++) {
...@@ -1472,7 +1472,7 @@ stifb_cleanup(void) ...@@ -1472,7 +1472,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)
...@@ -1495,10 +1495,10 @@ int __init ...@@ -1495,10 +1495,10 @@ int __init
stifb_setup(char *options) stifb_setup(char *options)
{ {
int i; int i;
if (!options || !*options) if (!options || !*options)
return 1; return 1;
if (strncmp(options, "off", 3) == 0) { if (strncmp(options, "off", 3) == 0) {
stifb_disabled = 1; stifb_disabled = 1;
options += 3; options += 3;
......
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