Lines Matching refs:sti

60 #define c_fg(sti, c) col_trans[((c>> 8) & 7)]  argument
61 #define c_bg(sti, c) col_trans[((c>>11) & 7)] argument
62 #define c_index(sti, c) ((c) & 0xff) argument
74 static int sti_init_graph(struct sti_struct *sti) in sti_init_graph() argument
76 struct sti_init_inptr *inptr = &sti->sti_data->init_inptr; in sti_init_graph()
77 struct sti_init_inptr_ext *inptr_ext = &sti->sti_data->init_inptr_ext; in sti_init_graph()
78 struct sti_init_outptr *outptr = &sti->sti_data->init_outptr; in sti_init_graph()
82 spin_lock_irqsave(&sti->lock, flags); in sti_init_graph()
90 ret = sti_call(sti, sti->init_graph, &default_init_flags, inptr, in sti_init_graph()
91 outptr, sti->glob_cfg); in sti_init_graph()
94 sti->text_planes = outptr->text_planes; in sti_init_graph()
97 spin_unlock_irqrestore(&sti->lock, flags); in sti_init_graph()
111 static void sti_inq_conf(struct sti_struct *sti) in sti_inq_conf() argument
113 struct sti_conf_inptr *inptr = &sti->sti_data->inq_inptr; in sti_inq_conf()
114 struct sti_conf_outptr *outptr = &sti->sti_data->inq_outptr; in sti_inq_conf()
118 outptr->ext_ptr = STI_PTR(&sti->sti_data->inq_outptr_ext); in sti_inq_conf()
121 spin_lock_irqsave(&sti->lock, flags); in sti_inq_conf()
123 ret = sti_call(sti, sti->inq_conf, &default_conf_flags, in sti_inq_conf()
124 inptr, outptr, sti->glob_cfg); in sti_inq_conf()
125 spin_unlock_irqrestore(&sti->lock, flags); in sti_inq_conf()
135 sti_putc(struct sti_struct *sti, int c, int y, int x) in sti_putc() argument
137 struct sti_font_inptr *inptr = &sti->sti_data->font_inptr; in sti_putc()
139 .font_start_addr= STI_PTR(sti->font->raw), in sti_putc()
140 .index = c_index(sti, c), in sti_putc()
141 .fg_color = c_fg(sti, c), in sti_putc()
142 .bg_color = c_bg(sti, c), in sti_putc()
143 .dest_x = x * sti->font_width, in sti_putc()
144 .dest_y = y * sti->font_height, in sti_putc()
146 struct sti_font_outptr *outptr = &sti->sti_data->font_outptr; in sti_putc()
151 spin_lock_irqsave(&sti->lock, flags); in sti_putc()
153 ret = sti_call(sti, sti->font_unpmv, &default_font_flags, in sti_putc()
154 inptr, outptr, sti->glob_cfg); in sti_putc()
155 spin_unlock_irqrestore(&sti->lock, flags); in sti_putc()
166 sti_set(struct sti_struct *sti, int src_y, int src_x, in sti_set() argument
169 struct sti_blkmv_inptr *inptr = &sti->sti_data->blkmv_inptr; in sti_set()
180 struct sti_blkmv_outptr *outptr = &sti->sti_data->blkmv_outptr; in sti_set()
185 spin_lock_irqsave(&sti->lock, flags); in sti_set()
187 ret = sti_call(sti, sti->block_move, &clear_blkmv_flags, in sti_set()
188 inptr, outptr, sti->glob_cfg); in sti_set()
189 spin_unlock_irqrestore(&sti->lock, flags); in sti_set()
194 sti_clear(struct sti_struct *sti, int src_y, int src_x, in sti_clear() argument
197 struct sti_blkmv_inptr *inptr = &sti->sti_data->blkmv_inptr; in sti_clear()
199 .fg_color = c_fg(sti, c), in sti_clear()
200 .bg_color = c_bg(sti, c), in sti_clear()
201 .src_x = src_x * sti->font_width, in sti_clear()
202 .src_y = src_y * sti->font_height, in sti_clear()
203 .dest_x = src_x * sti->font_width, in sti_clear()
204 .dest_y = src_y * sti->font_height, in sti_clear()
205 .width = width * sti->font_width, in sti_clear()
206 .height = height* sti->font_height, in sti_clear()
208 struct sti_blkmv_outptr *outptr = &sti->sti_data->blkmv_outptr; in sti_clear()
213 spin_lock_irqsave(&sti->lock, flags); in sti_clear()
215 ret = sti_call(sti, sti->block_move, &clear_blkmv_flags, in sti_clear()
216 inptr, outptr, sti->glob_cfg); in sti_clear()
217 spin_unlock_irqrestore(&sti->lock, flags); in sti_clear()
226 sti_bmove(struct sti_struct *sti, int src_y, int src_x, in sti_bmove() argument
229 struct sti_blkmv_inptr *inptr = &sti->sti_data->blkmv_inptr; in sti_bmove()
231 .src_x = src_x * sti->font_width, in sti_bmove()
232 .src_y = src_y * sti->font_height, in sti_bmove()
233 .dest_x = dst_x * sti->font_width, in sti_bmove()
234 .dest_y = dst_y * sti->font_height, in sti_bmove()
235 .width = width * sti->font_width, in sti_bmove()
236 .height = height* sti->font_height, in sti_bmove()
238 struct sti_blkmv_outptr *outptr = &sti->sti_data->blkmv_outptr; in sti_bmove()
243 spin_lock_irqsave(&sti->lock, flags); in sti_bmove()
245 ret = sti_call(sti, sti->block_move, &default_blkmv_flags, in sti_bmove()
246 inptr, outptr, sti->glob_cfg); in sti_bmove()
247 spin_unlock_irqrestore(&sti->lock, flags); in sti_bmove()
401 static void sti_dump_outptr(struct sti_struct *sti) in sti_dump_outptr() argument
408 sti->sti_data->inq_outptr.bits_per_pixel, in sti_dump_outptr()
409 sti->sti_data->inq_outptr.bits_used, in sti_dump_outptr()
410 sti->sti_data->inq_outptr.planes, in sti_dump_outptr()
411 sti->sti_data->inq_outptr.attributes)); in sti_dump_outptr()
414 static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address, in sti_init_glob_cfg() argument
423 if (sti->sti_mem_request < 256) in sti_init_glob_cfg()
424 sti->sti_mem_request = 256; /* STI default */ in sti_init_glob_cfg()
426 size = sizeof(struct sti_all_data) + sti->sti_mem_request - 256; in sti_init_glob_cfg()
428 sti->sti_data = kzalloc(size, STI_LOWMEM); in sti_init_glob_cfg()
429 if (!sti->sti_data) in sti_init_glob_cfg()
432 glob_cfg = &sti->sti_data->glob_cfg; in sti_init_glob_cfg()
433 glob_cfg_ext = &sti->sti_data->glob_cfg_ext; in sti_init_glob_cfg()
434 save_addr = &sti->sti_data->save_addr; in sti_init_glob_cfg()
435 sti_mem_addr = &sti->sti_data->sti_mem_addr; in sti_init_glob_cfg()
442 if (sti->pd) { in sti_init_glob_cfg()
443 unsigned char offs = sti->rm_entry[i]; in sti_init_glob_cfg()
452 i,sti->rm_entry[i]); in sti_init_glob_cfg()
455 newhpa = pci_resource_start (sti->pd, (offs - PCI_BASE_ADDRESS_0) / 4); in sti_init_glob_cfg()
459 sti->regions_phys[i] = in sti_init_glob_cfg()
460 REGION_OFFSET_TO_PHYS(sti->regions[i], newhpa); in sti_init_glob_cfg()
462 len = sti->regions[i].region_desc.length * 4096; in sti_init_glob_cfg()
464 glob_cfg->region_ptrs[i] = sti->regions_phys[i]; in sti_init_glob_cfg()
468 i, sti->regions_phys[i], glob_cfg->region_ptrs[i], in sti_init_glob_cfg()
470 sti->regions[i].region_desc.btlb, in sti_init_glob_cfg()
471 sti->regions[i].region_desc.sys_only, in sti_init_glob_cfg()
472 sti->regions[i].region_desc.cache, in sti_init_glob_cfg()
473 sti->regions[i].region_desc.last)); in sti_init_glob_cfg()
476 if (sti->regions[i].region_desc.last) in sti_init_glob_cfg()
480 if (++i<8 && sti->regions[i].region) in sti_init_glob_cfg()
482 __FILE__, sti->regions[i].region); in sti_init_glob_cfg()
486 sti->glob_cfg = glob_cfg; in sti_init_glob_cfg()
729 static int sti_read_rom(int wordmode, struct sti_struct *sti, in sti_read_rom() argument
754 memcpy(sti->regions, ((void *)raw)+raw->region_list, sizeof(sti->regions)); in sti_read_rom()
762 sti->font_unpmv = address + (raw->font_unpmv & 0x03ffffff); in sti_read_rom()
763 sti->block_move = address + (raw->block_move & 0x03ffffff); in sti_read_rom()
764 sti->init_graph = address + (raw->init_graph & 0x03ffffff); in sti_read_rom()
765 sti->inq_conf = address + (raw->inq_conf & 0x03ffffff); in sti_read_rom()
767 sti->rom = cooked; in sti_read_rom()
768 sti->rom->raw = raw; in sti_read_rom()
770 sti->font = sti_select_font(sti->rom, sti_search_font); in sti_read_rom()
771 sti->font_width = sti->font->raw->width; in sti_read_rom()
772 sti->font_height = sti->font->raw->height; in sti_read_rom()
774 sti->font->raw = sti_bmode_font_raw(sti->font); in sti_read_rom()
776 sti->sti_mem_request = raw->sti_mem_req; in sti_read_rom()
777 sti->graphics_id[0] = raw->graphics_id[0]; in sti_read_rom()
778 sti->graphics_id[1] = raw->graphics_id[1]; in sti_read_rom()
783 if (wordmode || sti->graphics_id[1] != 0x09A02587) in sti_read_rom()
788 switch (sti->graphics_id[0]) { in sti_read_rom()
820 struct sti_struct *sti; in sti_try_rom_generic() local
829 sti = kzalloc(sizeof(*sti), GFP_KERNEL); in sti_try_rom_generic()
830 if (!sti) in sti_try_rom_generic()
833 spin_lock_init(&sti->lock); in sti_try_rom_generic()
856 sti->pd = pd; in sti_try_rom_generic()
864 rm = (u32*) &sti->rm_entry; in sti_try_rom_generic()
872 DPRINTK(("%02x ", sti->rm_entry[i])); in sti_try_rom_generic()
886 ok = sti_read_rom(0, sti, address); in sti_try_rom_generic()
892 ok = sti_read_rom(1, sti, address); in sti_try_rom_generic()
898 if (sti_init_glob_cfg(sti, address, hpa)) in sti_try_rom_generic()
904 if (sti->pd) { in sti_try_rom_generic()
906 rom_base = pci_resource_start(sti->pd, PCI_ROM_RESOURCE); in sti_try_rom_generic()
907 pci_write_config_dword(sti->pd, PCI_ROM_ADDRESS, rom_base & ~PCI_ROM_ADDRESS_ENABLE); in sti_try_rom_generic()
911 if (sti_init_graph(sti)) in sti_try_rom_generic()
914 sti_inq_conf(sti); in sti_try_rom_generic()
915 sti_dump_globcfg(sti->glob_cfg, sti->sti_mem_request); in sti_try_rom_generic()
916 sti_dump_outptr(sti); in sti_try_rom_generic()
919 sti->sti_data->inq_outptr.dev_name); in sti_try_rom_generic()
921 sti_roms[num_sti_roms] = sti; in sti_try_rom_generic()
924 return sti; in sti_try_rom_generic()
927 kfree(sti); in sti_try_rom_generic()
931 static void sticore_check_for_default_sti(struct sti_struct *sti, char *path) in sticore_check_for_default_sti() argument
934 default_sti = sti; in sticore_check_for_default_sti()
945 struct sti_struct *sti = NULL; in sticore_pa_init() local
949 sti = sti_try_rom_generic(dev->addr[0], hpa, NULL); in sticore_pa_init()
950 if (!sti) in sticore_pa_init()
951 sti = sti_try_rom_generic(hpa, hpa, NULL); in sticore_pa_init()
952 if (!sti) in sticore_pa_init()
953 sti = sti_try_rom_generic(PAGE0->proc_sti, hpa, NULL); in sticore_pa_init()
954 if (!sti) in sticore_pa_init()
958 sticore_check_for_default_sti(sti, pa_path); in sticore_pa_init()
969 struct sti_struct *sti; in sticore_pci_init() local
992 sti = sti_try_rom_generic(rom_base, fb_base, pd); in sticore_pci_init()
993 if (sti) { in sticore_pci_init()
996 sticore_check_for_default_sti(sti, pa_path); in sticore_pci_init()
999 if (!sti) { in sticore_pci_init()
1093 int sti_call(const struct sti_struct *sti, unsigned long func, in sti_call() argument