Lines Matching +full:1 +full:p

99 	results = 1;  in PAR_EQUAL()
149 struct fb_info_control *p = in controlfb_setcolreg() local
154 return 1; in controlfb_setcolreg()
160 out_8(&p->cmap_regs->addr, regno); /* tell clut what addr to fill */ in controlfb_setcolreg()
161 out_8(&p->cmap_regs->lut, r); /* send one color channel at */ in controlfb_setcolreg()
162 out_8(&p->cmap_regs->lut, g); /* a time... */ in controlfb_setcolreg()
163 out_8(&p->cmap_regs->lut, b); in controlfb_setcolreg()
167 switch (p->par.cmode) { in controlfb_setcolreg()
169 p->pseudo_palette[regno] = in controlfb_setcolreg()
174 p->pseudo_palette[regno] = (i << 16) | i; in controlfb_setcolreg()
195 0x50, i + 1, params[i]); in set_control_clock()
206 struct fb_info_control *p) in set_screen_start() argument
208 struct fb_par_control *par = &p->par; in set_screen_start()
212 out_le32(CNTRL_REG(p,start_addr), in set_screen_start()
217 out_8(&p->cmap_regs->addr, (a)); \
218 out_8(&p->cmap_regs->dat, (d))
222 static void control_set_hardware(struct fb_info_control *p, struct fb_par_control *par) in control_set_hardware() argument
228 if (PAR_EQUAL(&p->par, par)) { in control_set_hardware()
233 if (p->par.xoffset != par->xoffset || in control_set_hardware()
234 p->par.yoffset != par->yoffset) in control_set_hardware()
235 set_screen_start(par->xoffset, par->yoffset, p); in control_set_hardware()
240 p->par = *par; in control_set_hardware()
241 cmode = p->par.cmode; in control_set_hardware()
245 out_le32(CNTRL_REG(p,ctrl), 0x400 | par->ctrl); in control_set_hardware()
250 RADACAL_WRITE(0x21, p->control_use_bank2 ? 0 : 1); in control_set_hardware()
254 rp = &p->control_regs->vswin; in control_set_hardware()
258 out_le32(CNTRL_REG(p,pitch), par->pitch); in control_set_hardware()
259 out_le32(CNTRL_REG(p,mode), r->mode); in control_set_hardware()
260 out_le32(CNTRL_REG(p,vram_attr), p->vram_attr); in control_set_hardware()
261 out_le32(CNTRL_REG(p,start_addr), par->yoffset * par->pitch in control_set_hardware()
263 out_le32(CNTRL_REG(p,rfrcnt), 0x1e5); in control_set_hardware()
264 out_le32(CNTRL_REG(p,intr_ena), 0); in control_set_hardware()
267 out_le32(CNTRL_REG(p,ctrl), par->ctrl); in control_set_hardware()
270 btext_update_display(p->frame_buffer_phys + CTRLFB_OFF, in control_set_hardware()
271 p->par.xres, p->par.yres, in control_set_hardware()
273 p->par.pitch); in control_set_hardware()
280 static void __init find_vram_size(struct fb_info_control *p) in find_vram_size() argument
285 * Set VRAM in 2MB (bank 1) mode in find_vram_size()
287 * and VRAM Bank 1 will not respond at that offset even if present in find_vram_size()
289 out_le32(CNTRL_REG(p,vram_attr), 0x31); in find_vram_size()
291 out_8(&p->frame_buffer[0x600000], 0xb3); in find_vram_size()
292 out_8(&p->frame_buffer[0x600001], 0x71); in find_vram_size()
293 invalid_vram_cache(&p->frame_buffer[0x600000]); in find_vram_size()
295 bank2 = (in_8(&p->frame_buffer[0x600000]) == 0xb3) in find_vram_size()
296 && (in_8(&p->frame_buffer[0x600001]) == 0x71); in find_vram_size()
300 * VRAM Bank 1 will be accessible through offset 0x000000 if present in find_vram_size()
303 out_le32(CNTRL_REG(p,vram_attr), 0x39); in find_vram_size()
305 out_8(&p->frame_buffer[0], 0x5a); in find_vram_size()
306 out_8(&p->frame_buffer[1], 0xc7); in find_vram_size()
307 invalid_vram_cache(&p->frame_buffer[0]); in find_vram_size()
309 bank1 = (in_8(&p->frame_buffer[0]) == 0x5a) in find_vram_size()
310 && (in_8(&p->frame_buffer[1]) == 0xc7); in find_vram_size()
317 p->control_use_bank2 = 1; in find_vram_size()
318 p->vram_attr = 0x39; in find_vram_size()
319 p->frame_buffer += 0x600000; in find_vram_size()
320 p->frame_buffer_phys += 0x600000; in find_vram_size()
325 p->vram_attr = 0x51; in find_vram_size()
329 * vram bank 1 only in find_vram_size()
331 p->vram_attr = 0x31; in find_vram_size()
334 p->total_vram = (bank1 + bank2) * 0x200000; in find_vram_size()
337 "(%dMB @ bank 1, %dMB @ bank 2)\n", in find_vram_size()
338 (bank1 + bank2) << 1, bank1 << 1, bank2 << 1); in find_vram_size()
346 static int read_control_sense(struct fb_info_control *p) in read_control_sense() argument
350 out_le32(CNTRL_REG(p,mon_sense), 7); /* drive all lines high */ in read_control_sense()
352 out_le32(CNTRL_REG(p,mon_sense), 077); /* turn off drivers */ in read_control_sense()
354 sense = (in_le32(CNTRL_REG(p,mon_sense)) & 0x1c0) << 2; in read_control_sense()
357 out_le32(CNTRL_REG(p,mon_sense), 033); /* drive A low */ in read_control_sense()
359 sense |= (in_le32(CNTRL_REG(p,mon_sense)) & 0xc0) >> 2; in read_control_sense()
360 out_le32(CNTRL_REG(p,mon_sense), 055); /* drive B low */ in read_control_sense()
362 sense |= ((in_le32(CNTRL_REG(p,mon_sense)) & 0x100) >> 5) in read_control_sense()
363 | ((in_le32(CNTRL_REG(p,mon_sense)) & 0x40) >> 4); in read_control_sense()
364 out_le32(CNTRL_REG(p,mon_sense), 066); /* drive C low */ in read_control_sense()
366 sense |= (in_le32(CNTRL_REG(p,mon_sense)) & 0x180) >> 7; in read_control_sense()
368 out_le32(CNTRL_REG(p,mon_sense), 077); /* turn off drivers */ in read_control_sense()
387 return 1; in calc_clock_params()
393 for (k = 1, min = l; k < 32; k++) { in calc_clock_params()
406 return 1; in calc_clock_params()
409 param[1] = p1; in calc_clock_params()
428 struct fb_info_control *p = in control_var_to_par() local
435 if (p->total_vram > 0x200000) { in control_var_to_par()
448 if (p->total_vram > 0x200000) { in control_var_to_par()
453 r->mode = 1; in control_var_to_par()
460 if (p->total_vram > 0x200000) { in control_var_to_par()
461 r->mode = 1; in control_var_to_par()
467 piped_diff = 1; in control_var_to_par()
493 if (par->pitch * par->vyres + CTRLFB_OFF > p->total_vram) in control_var_to_par()
507 + var->hsync_len) >> 1) - 2; in control_var_to_par()
508 hssync = hperiod + 1; in control_var_to_par()
509 hsblank = hssync - (var->right_margin >> 1); in control_var_to_par()
510 hesync = (var->hsync_len >> 1) - 1; in control_var_to_par()
511 heblank = (var->left_margin >> 1) + hesync; in control_var_to_par()
514 hlfln = (hperiod+2) >> 1; in control_var_to_par()
517 + var->upper_margin) << 1; in control_var_to_par()
519 vesync = (var->vsync_len << 1) - vperiod + vssync; in control_var_to_par()
520 veblank = (var->upper_margin << 1) + vesync; in control_var_to_par()
521 vsblank = vssync - (var->lower_margin << 1); in control_var_to_par()
522 vswin = (vsblank+vssync) >> 1; in control_var_to_par()
523 vewin = (vesync+veblank) >> 1; in control_var_to_par()
526 r->regs[1] = vsblank; in control_var_to_par()
599 var->height = -1; in control_par_to_var()
600 var->width = -1; in control_par_to_var()
603 var->left_margin = (rv->heblank - rv->hesync) << 1; in control_par_to_var()
604 var->right_margin = (rv->hssync - rv->hsblank) << 1; in control_par_to_var()
605 var->hsync_len = (rv->hperiod + 2 - rv->hssync + rv->hesync) << 1; in control_par_to_var()
607 var->upper_margin = (rv->veblank - rv->vesync) >> 1; in control_par_to_var()
608 var->lower_margin = (rv->vssync - rv->vsblank) >> 1; in control_par_to_var()
609 var->vsync_len = (rv->vperiod - rv->vssync + rv->vesync) >> 1; in control_par_to_var()
614 * 10^12 * clock_params[0] / (3906400 * clock_params[1] in control_par_to_var()
616 * (10^12 * clock_params[0] / (3906400 * clock_params[1])) in control_par_to_var()
619 /* (255990.17 * clock_params[0] / clock_params[1]) >> clock_params[2] */ in control_par_to_var()
621 var->pixclock /= par->regvals.clock_params[1]; in control_par_to_var()
648 struct fb_info_control *p = in controlfb_set_par() local
659 control_set_hardware(p, &par); in controlfb_set_par()
661 info->fix.visual = (p->par.cmode == CMODE_8) ? in controlfb_set_par()
663 info->fix.line_length = p->par.pitch; in controlfb_set_par()
664 info->fix.xpanstep = 32 >> p->par.cmode; in controlfb_set_par()
665 info->fix.ypanstep = 1; in controlfb_set_par()
674 struct fb_info_control *p = in controlfb_pan_display() local
676 struct fb_par_control *par = &p->par; in controlfb_pan_display()
688 set_screen_start(xoffset, var->yoffset, p); in controlfb_pan_display()
695 struct fb_info_control __maybe_unused *p = in controlfb_blank() local
699 ctrl = in_le32(CNTRL_REG(p, ctrl)); in controlfb_blank()
721 out_le32(CNTRL_REG(p,ctrl), ctrl); in controlfb_blank()
771 static void __init control_init_info(struct fb_info *info, struct fb_info_control *p) in control_init_info() argument
774 info->par = &p->par; in control_init_info()
776 info->pseudo_palette = p->pseudo_palette; in control_init_info()
778 info->screen_base = p->frame_buffer + CTRLFB_OFF; in control_init_info()
784 info->fix.mmio_start = p->control_regs_phys; in control_init_info()
787 info->fix.smem_start = p->frame_buffer_phys + CTRLFB_OFF; in control_init_info()
788 info->fix.smem_len = p->total_vram - CTRLFB_OFF; in control_init_info()
808 control_mac_modes[vmode - 1].m[1] >= 0) in control_setup()
837 static int __init init_control(struct fb_info_control *p) in init_control() argument
845 full = p->total_vram == 0x400000; in init_control()
857 if (vmode < 1 || vmode > VMODE_MAX || in init_control()
858 control_mac_modes[vmode - 1].m[full] < cmode) { in init_control()
859 sense = read_control_sense(p); in init_control()
862 if (control_mac_modes[vmode - 1].m[full] < 0) in init_control()
864 cmode = min(cmode, control_mac_modes[vmode - 1].m[full]); in init_control()
868 control_init_info(&p->info, p); in init_control()
885 vyres = (p->total_vram - CTRLFB_OFF) / (var.xres << cmode); in init_control()
891 rc = fb_set_var(&p->info, &var); in init_control()
896 if (register_framebuffer(&p->info) < 0) in init_control()
899 fb_info(&p->info, "control display adapter\n"); in init_control()
906 struct fb_info_control *p = control_fb; in control_cleanup() local
908 if (!p) in control_cleanup()
911 if (p->cmap_regs) in control_cleanup()
912 iounmap(p->cmap_regs); in control_cleanup()
913 if (p->control_regs) in control_cleanup()
914 iounmap(p->control_regs); in control_cleanup()
915 if (p->frame_buffer) { in control_cleanup()
916 if (p->control_use_bank2) in control_cleanup()
917 p->frame_buffer -= 0x600000; in control_cleanup()
918 iounmap(p->frame_buffer); in control_cleanup()
920 if (p->cmap_regs_phys) in control_cleanup()
921 release_mem_region(p->cmap_regs_phys, 0x1000); in control_cleanup()
922 if (p->control_regs_phys) in control_cleanup()
923 release_mem_region(p->control_regs_phys, p->control_regs_size); in control_cleanup()
924 if (p->fb_orig_base) in control_cleanup()
925 release_mem_region(p->fb_orig_base, p->fb_orig_size); in control_cleanup()
926 kfree(p); in control_cleanup()
934 struct fb_info_control *p; in control_of_init() local
943 of_pci_address_to_resource(dp, 1, &reg_res)) { in control_of_init()
947 p = kzalloc(sizeof(*p), GFP_KERNEL); in control_of_init()
948 if (!p) in control_of_init()
950 control_fb = p; /* save it for cleanups */ in control_of_init()
953 p->fb_orig_base = fb_res.start; in control_of_init()
954 p->fb_orig_size = resource_size(&fb_res); in control_of_init()
956 p->frame_buffer_phys = fb_res.start + 0x800000; in control_of_init()
957 p->control_regs_phys = reg_res.start; in control_of_init()
958 p->control_regs_size = resource_size(&reg_res); in control_of_init()
960 if (!p->fb_orig_base || in control_of_init()
961 !request_mem_region(p->fb_orig_base,p->fb_orig_size,"controlfb")) { in control_of_init()
962 p->fb_orig_base = 0; in control_of_init()
966 p->frame_buffer = ioremap_wt(p->frame_buffer_phys, 0x800000); in control_of_init()
968 if (!p->control_regs_phys || in control_of_init()
969 !request_mem_region(p->control_regs_phys, p->control_regs_size, in control_of_init()
971 p->control_regs_phys = 0; in control_of_init()
974 p->control_regs = ioremap(p->control_regs_phys, p->control_regs_size); in control_of_init()
976 p->cmap_regs_phys = 0xf301b000; /* XXX not in prom? */ in control_of_init()
977 if (!request_mem_region(p->cmap_regs_phys, 0x1000, "controlfb cmap")) { in control_of_init()
978 p->cmap_regs_phys = 0; in control_of_init()
981 p->cmap_regs = ioremap(p->cmap_regs_phys, 0x1000); in control_of_init()
983 if (!p->cmap_regs || !p->control_regs || !p->frame_buffer) in control_of_init()
986 find_vram_size(p); in control_of_init()
987 if (!p->total_vram) in control_of_init()
990 if (init_control(p) < 0) in control_of_init()