Lines Matching refs:vinfo

166 static void vmlfb_free_vram(struct vml_info *vinfo)  in vmlfb_free_vram()  argument
170 for (i = 0; i < vinfo->num_areas; ++i) { in vmlfb_free_vram()
171 vmlfb_free_vram_area(&vinfo->vram[i]); in vmlfb_free_vram()
173 vinfo->num_areas = 0; in vmlfb_free_vram()
183 static int vmlfb_alloc_vram(struct vml_info *vinfo, in vmlfb_alloc_vram() argument
194 vinfo->num_areas = 0; in vmlfb_alloc_vram()
196 va = &vinfo->vram[i]; in vmlfb_alloc_vram()
208 vinfo->vram_start = va->phys; in vmlfb_alloc_vram()
209 vinfo->vram_logical = (void __iomem *) va->logical; in vmlfb_alloc_vram()
210 vinfo->vram_contig_size = va->size; in vmlfb_alloc_vram()
211 vinfo->num_areas = 1; in vmlfb_alloc_vram()
216 va2 = &vinfo->vram[j]; in vmlfb_alloc_vram()
225 vinfo->num_areas++; in vmlfb_alloc_vram()
226 if (va->phys < vinfo->vram_start) { in vmlfb_alloc_vram()
227 vinfo->vram_start = va->phys; in vmlfb_alloc_vram()
228 vinfo->vram_logical = in vmlfb_alloc_vram()
231 vinfo->vram_contig_size += va->size; in vmlfb_alloc_vram()
244 if (vinfo->vram_contig_size > min_total && in vmlfb_alloc_vram()
245 vinfo->vram_contig_size > min_contig) { in vmlfb_alloc_vram()
249 (unsigned long)vinfo->vram_contig_size, in vmlfb_alloc_vram()
250 (unsigned long)vinfo->vram_start); in vmlfb_alloc_vram()
258 vmlfb_free_vram(vinfo); in vmlfb_alloc_vram()
289 static int vmlfb_vram_offset(struct vml_info *vinfo, unsigned long offset) in vmlfb_vram_offset() argument
294 for (i = 0; i < vinfo->num_areas; ++i) { in vmlfb_vram_offset()
295 aoffset = offset - (vinfo->vram[i].phys - vinfo->vram_start); in vmlfb_vram_offset()
297 if (aoffset < vinfo->vram[i].size) { in vmlfb_vram_offset()
384 struct vml_info *vinfo; in vml_pci_remove() local
389 vinfo = container_of(info, struct vml_info, info); in vml_pci_remove()
390 par = vinfo->par; in vml_pci_remove()
394 vmlfb_free_vram(vinfo); in vml_pci_remove()
397 kfree(vinfo); in vml_pci_remove()
442 struct vml_info *vinfo; in vml_pci_probe() local
451 vinfo = kzalloc(sizeof(*vinfo), GFP_KERNEL); in vml_pci_probe()
452 if (vinfo == NULL) { in vml_pci_probe()
457 vinfo->par = par; in vml_pci_probe()
465 pci_set_drvdata(dev, &vinfo->info); in vml_pci_probe()
472 info = &vinfo->info; in vml_pci_probe()
479 err = vmlfb_alloc_vram(vinfo, vml_mem_requested, in vml_pci_probe()
487 info->fix.smem_start = vinfo->vram_start; in vml_pci_probe()
488 info->fix.smem_len = vinfo->vram_contig_size; in vml_pci_probe()
495 info->screen_base = vinfo->vram_logical; in vml_pci_probe()
496 info->pseudo_palette = vinfo->pseudo_palette; in vml_pci_probe()
501 INIT_LIST_HEAD(&vinfo->head); in vml_pci_probe()
502 vinfo->pipe_disabled = 1; in vml_pci_probe()
503 vinfo->cur_blank_mode = FB_BLANK_UNBLANK; in vml_pci_probe()
532 vmlfb_free_vram(vinfo); in vml_pci_probe()
538 kfree(vinfo); in vml_pci_probe()
584 struct vml_info *vinfo) in vmlfb_check_var_locked() argument
641 if (mem > vinfo->vram_contig_size) { in vmlfb_check_var_locked()
680 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_check_var() local
684 ret = vmlfb_check_var_locked(var, vinfo); in vmlfb_check_var()
690 static void vml_wait_vblank(struct vml_info *vinfo) in vml_wait_vblank() argument
696 static void vmlfb_disable_pipe(struct vml_info *vinfo) in vmlfb_disable_pipe() argument
698 struct vml_par *par = vinfo->par; in vmlfb_disable_pipe()
709 vml_wait_vblank(vinfo); in vmlfb_disable_pipe()
715 vinfo->pipe_disabled = 1; in vmlfb_disable_pipe()
719 static void vml_dump_regs(struct vml_info *vinfo) in vml_dump_regs() argument
721 struct vml_par *par = vinfo->par; in vml_dump_regs()
762 static int vmlfb_set_par_locked(struct vml_info *vinfo) in vmlfb_set_par_locked() argument
764 struct vml_par *par = vinfo->par; in vmlfb_set_par_locked()
765 struct fb_info *info = &vinfo->info; in vmlfb_set_par_locked()
772 vinfo->bytes_per_pixel = var->bits_per_pixel >> 3; in vmlfb_set_par_locked()
773 vinfo->stride = ALIGN(var->xres_virtual * vinfo->bytes_per_pixel, 0x40); in vmlfb_set_par_locked()
774 info->fix.line_length = vinfo->stride; in vmlfb_set_par_locked()
821 vmlfb_disable_pipe(vinfo); in vmlfb_set_par_locked()
839 VML_WRITE32(par, VML_DSPCSTRIDE, vinfo->stride); in vmlfb_set_par_locked()
854 VML_WRITE32(par, VML_DSPCADDR, (u32) vinfo->vram_start + in vmlfb_set_par_locked()
855 var->yoffset * vinfo->stride + in vmlfb_set_par_locked()
856 var->xoffset * vinfo->bytes_per_pixel); in vmlfb_set_par_locked()
863 vinfo->pipe_disabled = 0; in vmlfb_set_par_locked()
865 vml_dump_regs(vinfo); in vmlfb_set_par_locked()
873 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_set_par() local
877 list_move(&vinfo->head, (subsys) ? &global_has_mode : &global_no_mode); in vmlfb_set_par()
878 ret = vmlfb_set_par_locked(vinfo); in vmlfb_set_par()
884 static int vmlfb_blank_locked(struct vml_info *vinfo) in vmlfb_blank_locked() argument
886 struct vml_par *par = vinfo->par; in vmlfb_blank_locked()
889 switch (vinfo->cur_blank_mode) { in vmlfb_blank_locked()
891 if (vinfo->pipe_disabled) { in vmlfb_blank_locked()
892 vmlfb_set_par_locked(vinfo); in vmlfb_blank_locked()
898 if (vinfo->pipe_disabled) { in vmlfb_blank_locked()
899 vmlfb_set_par_locked(vinfo); in vmlfb_blank_locked()
906 if (!vinfo->pipe_disabled) { in vmlfb_blank_locked()
907 vmlfb_disable_pipe(vinfo); in vmlfb_blank_locked()
911 if (!vinfo->pipe_disabled) { in vmlfb_blank_locked()
912 vmlfb_disable_pipe(vinfo); in vmlfb_blank_locked()
924 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_blank() local
928 vinfo->cur_blank_mode = blank_mode; in vmlfb_blank()
929 ret = vmlfb_blank_locked(vinfo); in vmlfb_blank()
937 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_pan_display() local
938 struct vml_par *par = vinfo->par; in vmlfb_pan_display()
941 VML_WRITE32(par, VML_DSPCADDR, (u32) vinfo->vram_start + in vmlfb_pan_display()
942 var->yoffset * vinfo->stride + in vmlfb_pan_display()
943 var->xoffset * vinfo->bytes_per_pixel); in vmlfb_pan_display()
989 struct vml_info *vinfo = container_of(info, struct vml_info, info); in vmlfb_mmap() local
994 ret = vmlfb_vram_offset(vinfo, offset); in vmlfb_mmap()
1002 return vm_iomap_memory(vma, vinfo->vram_start, in vmlfb_mmap()
1003 vinfo->vram_contig_size); in vmlfb_mmap()