Lines Matching defs:sti

44 static void *store_sti_val(struct sti_struct *sti, void *ptr, unsigned long val)
48 if (IS_ENABLED(CONFIG_64BIT) && sti->do_call64) {
62 #define store_sti_ptr(sti, dest, ptr) \
63 store_sti_val(sti, dest, STI_PTR(ptr))
83 #define c_fg(sti, c) col_trans[((c>> 8) & 7)]
84 #define c_bg(sti, c) col_trans[((c>>11) & 7)]
85 #define c_index(sti, c) ((c) & 0xff)
97 static int sti_init_graph(struct sti_struct *sti)
99 struct sti_init_inptr *inptr = &sti->sti_data->init_inptr;
100 struct sti_init_inptr_ext *inptr_ext = &sti->sti_data->init_inptr_ext;
101 struct sti_init_outptr *outptr = &sti->sti_data->init_outptr;
105 spin_lock_irqsave(&sti->lock, flags);
110 store_sti_ptr(sti, &inptr->ext_ptr, inptr_ext);
113 ret = sti_call(sti, sti->init_graph, &default_init_flags, inptr,
114 outptr, sti->glob_cfg);
117 sti->text_planes = outptr->text_planes;
120 spin_unlock_irqrestore(&sti->lock, flags);
134 static void sti_inq_conf(struct sti_struct *sti)
136 struct sti_conf_inptr *inptr = &sti->sti_data->inq_inptr;
137 struct sti_conf_outptr *outptr = &sti->sti_data->inq_outptr;
141 store_sti_ptr(sti, &outptr->ext_ptr, &sti->sti_data->inq_outptr_ext);
144 spin_lock_irqsave(&sti->lock, flags);
146 ret = sti_call(sti, sti->inq_conf, &default_conf_flags,
147 inptr, outptr, sti->glob_cfg);
148 spin_unlock_irqrestore(&sti->lock, flags);
158 sti_putc(struct sti_struct *sti, int c, int y, int x,
164 .index = c_index(sti, c),
165 .fg_color = c_fg(sti, c),
166 .bg_color = c_bg(sti, c),
170 struct sti_font_outptr *outptr = &sti->sti_data->font_outptr;
175 spin_lock_irqsave(&sti->lock, flags);
177 if (IS_ENABLED(CONFIG_64BIT) && !sti->do_call64) {
179 inptr = &sti->sti_data->font_inptr;
184 ret = sti_call(sti, sti->font_unpmv, &default_font_flags,
185 inptr, outptr, sti->glob_cfg);
186 spin_unlock_irqrestore(&sti->lock, flags);
197 sti_set(struct sti_struct *sti, int src_y, int src_x,
211 struct sti_blkmv_outptr *outptr = &sti->sti_data->blkmv_outptr;
216 spin_lock_irqsave(&sti->lock, flags);
218 if (IS_ENABLED(CONFIG_64BIT) && !sti->do_call64) {
220 inptr = &sti->sti_data->blkmv_inptr;
223 ret = sti_call(sti, sti->block_move, &clear_blkmv_flags,
224 inptr, outptr, sti->glob_cfg);
225 spin_unlock_irqrestore(&sti->lock, flags);
230 sti_clear(struct sti_struct *sti, int src_y, int src_x,
235 .fg_color = c_fg(sti, c),
236 .bg_color = c_bg(sti, c),
244 struct sti_blkmv_outptr *outptr = &sti->sti_data->blkmv_outptr;
249 spin_lock_irqsave(&sti->lock, flags);
251 if (IS_ENABLED(CONFIG_64BIT) && !sti->do_call64) {
253 inptr = &sti->sti_data->blkmv_inptr;
256 ret = sti_call(sti, sti->block_move, &clear_blkmv_flags,
257 inptr, outptr, sti->glob_cfg);
258 spin_unlock_irqrestore(&sti->lock, flags);
267 sti_bmove(struct sti_struct *sti, int src_y, int src_x,
280 struct sti_blkmv_outptr *outptr = &sti->sti_data->blkmv_outptr;
285 spin_lock_irqsave(&sti->lock, flags);
287 if (IS_ENABLED(CONFIG_64BIT) && !sti->do_call64) {
289 inptr = &sti->sti_data->blkmv_inptr;
292 ret = sti_call(sti, sti->block_move, &default_blkmv_flags,
293 inptr, outptr, sti->glob_cfg);
294 spin_unlock_irqrestore(&sti->lock, flags);
341 * parameter sti=<x> which of them will be the initial boot-console.
345 __setup("sti=", sti_setup);
404 static void sti_dump_globcfg(struct sti_struct *sti)
406 struct sti_glob_cfg *glob_cfg = sti->glob_cfg;
407 struct sti_glob_cfg_ext *cfg = &sti->sti_data->glob_cfg_ext;
428 cfg->sti_mem_addr, sti->sti_mem_request);
431 static void sti_dump_outptr(struct sti_struct *sti)
437 sti->sti_data->inq_outptr.bits_per_pixel,
438 sti->sti_data->inq_outptr.bits_used,
439 sti->sti_data->inq_outptr.planes,
440 sti->sti_data->inq_outptr.attributes);
443 static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address,
452 if (sti->sti_mem_request < 256)
453 sti->sti_mem_request = 256; /* STI default */
455 size = sizeof(struct sti_all_data) + sti->sti_mem_request - 256;
457 sti->sti_data = kzalloc(size, STI_LOWMEM);
458 if (!sti->sti_data)
461 glob_cfg = &sti->sti_data->glob_cfg;
462 glob_cfg_ext = &sti->sti_data->glob_cfg_ext;
463 save_addr = &sti->sti_data->save_addr;
464 sti_mem_addr = &sti->sti_data->sti_mem_addr;
469 if (sti->pd) {
470 unsigned char offs = sti->rm_entry[i];
478 i,sti->rm_entry[i]);
481 newhpa = pci_resource_start (sti->pd, (offs - PCI_BASE_ADDRESS_0) / 4);
485 sti->regions_phys[i] =
486 REGION_OFFSET_TO_PHYS(sti->regions[i], newhpa);
488 len = sti->regions[i].region_desc.length * 4096;
492 i, sti->regions_phys[i], len / 1024,
493 sti->regions[i].region_desc.btlb,
494 sti->regions[i].region_desc.sys_only,
495 sti->regions[i].region_desc.cache,
496 sti->regions[i].region_desc.last);
499 if (sti->regions[i].region_desc.last)
505 ptr = store_sti_val(sti, ptr, sti->regions_phys[i]);
509 ptr = store_sti_ptr(sti, ptr, save_addr);
510 ptr = store_sti_ptr(sti, ptr, glob_cfg_ext);
512 store_sti_ptr(sti, &glob_cfg_ext->sti_mem_addr, sti_mem_addr);
514 sti->glob_cfg = glob_cfg;
643 static void sti_dump_rom(struct sti_struct *sti)
645 struct sti_rom *rom = sti->rom->raw;
662 font_start = sti->rom->font_start;
711 void sti_font_convert_bytemode(struct sti_struct *sti, struct sti_cooked_font *f)
717 if (sti->wordmode)
802 static int sti_read_rom(int wordmode, struct sti_struct *sti,
827 memcpy(sti->regions, ((void *)raw)+raw->region_list, sizeof(sti->regions));
838 sti->do_call64 = 1;
839 sti->font_unpmv = address + (raw->font_unp_addr & 0x03ffffff);
840 sti->block_move = address + (raw->block_move_addr & 0x03ffffff);
841 sti->init_graph = address + (raw->init_graph_addr & 0x03ffffff);
842 sti->inq_conf = address + (raw->inq_conf_addr & 0x03ffffff);
844 sti->font_unpmv = address + (raw->font_unpmv & 0x03ffffff);
845 sti->block_move = address + (raw->block_move & 0x03ffffff);
846 sti->init_graph = address + (raw->init_graph & 0x03ffffff);
847 sti->inq_conf = address + (raw->inq_conf & 0x03ffffff);
850 sti->rom = cooked;
851 sti->rom->raw = raw;
852 sti_dump_rom(sti);
854 sti->wordmode = wordmode;
855 sti->font = sti_select_font(sti->rom);
856 sti->font->width = sti->font->raw->width;
857 sti->font->height = sti->font->raw->height;
858 sti_font_convert_bytemode(sti, sti->font);
859 sti_dump_font(sti->font);
862 (IS_ENABLED(CONFIG_64BIT) && sti->do_call64) ? 64 : 32);
864 sti->sti_mem_request = raw->sti_mem_req;
866 sti->sti_mem_request, raw->reentsize);
868 sti->graphics_id[0] = raw->graphics_id[0];
869 sti->graphics_id[1] = raw->graphics_id[1];
872 if (wordmode || sti->graphics_id[1] != 0x09A02587)
877 switch (sti->graphics_id[0]) {
909 struct sti_struct *sti;
918 sti = kzalloc(sizeof(*sti), GFP_KERNEL);
919 if (!sti)
922 spin_lock_init(&sti->lock);
946 sti->pd = pd;
954 rm = (u32*) &sti->rm_entry;
971 ok = sti_read_rom(0, sti, address);
977 ok = sti_read_rom(1, sti, address);
983 if (sti_init_glob_cfg(sti, address, hpa))
989 if (sti->pd) {
991 rom_base = pci_resource_start(sti->pd, PCI_ROM_RESOURCE);
992 pci_write_config_dword(sti->pd, PCI_ROM_ADDRESS, rom_base & ~PCI_ROM_ADDRESS_ENABLE);
996 if (sti_init_graph(sti))
999 sti_inq_conf(sti);
1000 sti_dump_globcfg(sti);
1001 sti_dump_outptr(sti);
1004 sti->sti_data->inq_outptr.dev_name);
1006 sti_roms[num_sti_roms] = sti;
1009 return sti;
1012 kfree(sti);
1016 static void sticore_check_for_default_sti(struct sti_struct *sti, char *path)
1018 pr_info(" located at [%s]\n", sti->pa_path);
1020 default_sti = sti;
1030 struct sti_struct *sti = NULL;
1034 sti = sti_try_rom_generic(dev->addr[0], hpa, NULL);
1035 if (!sti)
1036 sti = sti_try_rom_generic(hpa, hpa, NULL);
1037 if (!sti)
1038 sti = sti_try_rom_generic(PAGE0->proc_sti, hpa, NULL);
1039 if (!sti)
1042 print_pa_hwpath(dev, sti->pa_path);
1043 sticore_check_for_default_sti(sti, sti->pa_path);
1054 struct sti_struct *sti;
1077 sti = sti_try_rom_generic(rom_base, fb_base, pd);
1078 if (sti) {
1079 print_pci_hwpath(pd, sti->pa_path);
1080 sticore_check_for_default_sti(sti, sti->pa_path);
1083 if (!sti) {
1110 .name = "sti",
1124 .name = "sti",
1150 /* if we didn't find the given default sti, take the first one */
1157 * index = 0 gives default sti
1176 int sti_call(const struct sti_struct *sti, unsigned long func,
1187 if (WARN_ONCE(IS_ENABLED(CONFIG_64BIT) && !sti->do_call64 &&
1194 sti->do_call64);