Lines Matching refs:vinfo
167 static void vmlfb_free_vram(struct vml_info *vinfo) in vmlfb_free_vram() argument
171 for (i = 0; i < vinfo->num_areas; ++i) { in vmlfb_free_vram()
172 vmlfb_free_vram_area(&vinfo->vram[i]); in vmlfb_free_vram()
174 vinfo->num_areas = 0; in vmlfb_free_vram()
184 static int vmlfb_alloc_vram(struct vml_info *vinfo, in vmlfb_alloc_vram() argument
195 vinfo->num_areas = 0; in vmlfb_alloc_vram()
197 va = &vinfo->vram[i]; in vmlfb_alloc_vram()
209 vinfo->vram_start = va->phys; in vmlfb_alloc_vram()
210 vinfo->vram_logical = (void __iomem *) va->logical; in vmlfb_alloc_vram()
211 vinfo->vram_contig_size = va->size; in vmlfb_alloc_vram()
212 vinfo->num_areas = 1; in vmlfb_alloc_vram()
217 va2 = &vinfo->vram[j]; in vmlfb_alloc_vram()
226 vinfo->num_areas++; in vmlfb_alloc_vram()
227 if (va->phys < vinfo->vram_start) { in vmlfb_alloc_vram()
228 vinfo->vram_start = va->phys; in vmlfb_alloc_vram()
229 vinfo->vram_logical = in vmlfb_alloc_vram()
232 vinfo->vram_contig_size += va->size; in vmlfb_alloc_vram()
245 if (vinfo->vram_contig_size > min_total && in vmlfb_alloc_vram()
246 vinfo->vram_contig_size > min_contig) { in vmlfb_alloc_vram()
250 (unsigned long)vinfo->vram_contig_size, in vmlfb_alloc_vram()
251 (unsigned long)vinfo->vram_start); in vmlfb_alloc_vram()
259 vmlfb_free_vram(vinfo); in vmlfb_alloc_vram()
292 static int vmlfb_vram_offset(struct vml_info *vinfo, unsigned long offset) in vmlfb_vram_offset() argument
297 for (i = 0; i < vinfo->num_areas; ++i) { in vmlfb_vram_offset()
298 aoffset = offset - (vinfo->vram[i].phys - vinfo->vram_start); in vmlfb_vram_offset()
300 if (aoffset < vinfo->vram[i].size) { in vmlfb_vram_offset()
387 struct vml_info *vinfo; in vml_pci_remove() local
392 vinfo = container_of(info, struct vml_info, info); in vml_pci_remove()
393 par = vinfo->par; in vml_pci_remove()
397 vmlfb_free_vram(vinfo); in vml_pci_remove()
400 kfree(vinfo); in vml_pci_remove()
445 struct vml_info *vinfo; in vml_pci_probe() local
458 vinfo = kzalloc(sizeof(*vinfo), GFP_KERNEL); in vml_pci_probe()
459 if (vinfo == NULL) { in vml_pci_probe()
464 vinfo->par = par; in vml_pci_probe()
472 pci_set_drvdata(dev, &vinfo->info); in vml_pci_probe()
479 info = &vinfo->info; in vml_pci_probe()
486 err = vmlfb_alloc_vram(vinfo, vml_mem_requested, in vml_pci_probe()
494 info->fix.smem_start = vinfo->vram_start; in vml_pci_probe()
495 info->fix.smem_len = vinfo->vram_contig_size; in vml_pci_probe()
502 info->screen_base = vinfo->vram_logical; in vml_pci_probe()
503 info->pseudo_palette = vinfo->pseudo_palette; in vml_pci_probe()
508 INIT_LIST_HEAD(&vinfo->head); in vml_pci_probe()
509 vinfo->pipe_disabled = 1; in vml_pci_probe()
510 vinfo->cur_blank_mode = FB_BLANK_UNBLANK; in vml_pci_probe()
539 vmlfb_free_vram(vinfo); in vml_pci_probe()
545 kfree(vinfo); in vml_pci_probe()
591 struct vml_info *vinfo) in vmlfb_check_var_locked() argument
648 if (mem > vinfo->vram_contig_size) { in vmlfb_check_var_locked()
687 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_check_var() local
691 ret = vmlfb_check_var_locked(var, vinfo); in vmlfb_check_var()
697 static void vml_wait_vblank(struct vml_info *vinfo) in vml_wait_vblank() argument
703 static void vmlfb_disable_pipe(struct vml_info *vinfo) in vmlfb_disable_pipe() argument
705 struct vml_par *par = vinfo->par; in vmlfb_disable_pipe()
716 vml_wait_vblank(vinfo); in vmlfb_disable_pipe()
722 vinfo->pipe_disabled = 1; in vmlfb_disable_pipe()
726 static void vml_dump_regs(struct vml_info *vinfo) in vml_dump_regs() argument
728 struct vml_par *par = vinfo->par; in vml_dump_regs()
769 static int vmlfb_set_par_locked(struct vml_info *vinfo) in vmlfb_set_par_locked() argument
771 struct vml_par *par = vinfo->par; in vmlfb_set_par_locked()
772 struct fb_info *info = &vinfo->info; in vmlfb_set_par_locked()
779 vinfo->bytes_per_pixel = var->bits_per_pixel >> 3; in vmlfb_set_par_locked()
780 vinfo->stride = ALIGN(var->xres_virtual * vinfo->bytes_per_pixel, 0x40); in vmlfb_set_par_locked()
781 info->fix.line_length = vinfo->stride; in vmlfb_set_par_locked()
828 vmlfb_disable_pipe(vinfo); in vmlfb_set_par_locked()
846 VML_WRITE32(par, VML_DSPCSTRIDE, vinfo->stride); in vmlfb_set_par_locked()
861 VML_WRITE32(par, VML_DSPCADDR, (u32) vinfo->vram_start + in vmlfb_set_par_locked()
862 var->yoffset * vinfo->stride + in vmlfb_set_par_locked()
863 var->xoffset * vinfo->bytes_per_pixel); in vmlfb_set_par_locked()
870 vinfo->pipe_disabled = 0; in vmlfb_set_par_locked()
872 vml_dump_regs(vinfo); in vmlfb_set_par_locked()
880 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_set_par() local
884 list_move(&vinfo->head, (subsys) ? &global_has_mode : &global_no_mode); in vmlfb_set_par()
885 ret = vmlfb_set_par_locked(vinfo); in vmlfb_set_par()
891 static int vmlfb_blank_locked(struct vml_info *vinfo) in vmlfb_blank_locked() argument
893 struct vml_par *par = vinfo->par; in vmlfb_blank_locked()
896 switch (vinfo->cur_blank_mode) { in vmlfb_blank_locked()
898 if (vinfo->pipe_disabled) { in vmlfb_blank_locked()
899 vmlfb_set_par_locked(vinfo); in vmlfb_blank_locked()
905 if (vinfo->pipe_disabled) { in vmlfb_blank_locked()
906 vmlfb_set_par_locked(vinfo); in vmlfb_blank_locked()
913 if (!vinfo->pipe_disabled) { in vmlfb_blank_locked()
914 vmlfb_disable_pipe(vinfo); in vmlfb_blank_locked()
918 if (!vinfo->pipe_disabled) { in vmlfb_blank_locked()
919 vmlfb_disable_pipe(vinfo); in vmlfb_blank_locked()
931 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_blank() local
935 vinfo->cur_blank_mode = blank_mode; in vmlfb_blank()
936 ret = vmlfb_blank_locked(vinfo); in vmlfb_blank()
944 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_pan_display() local
945 struct vml_par *par = vinfo->par; in vmlfb_pan_display()
948 VML_WRITE32(par, VML_DSPCADDR, (u32) vinfo->vram_start + in vmlfb_pan_display()
949 var->yoffset * vinfo->stride + in vmlfb_pan_display()
950 var->xoffset * vinfo->bytes_per_pixel); in vmlfb_pan_display()
996 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_mmap() local
1001 ret = vmlfb_vram_offset(vinfo, offset); in vmlfb_mmap()
1009 return vm_iomap_memory(vma, vinfo->vram_start, in vmlfb_mmap()
1010 vinfo->vram_contig_size); in vmlfb_mmap()