• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/video/

Lines Matching defs:ofb

608 static void overlay1fb_setup(struct pxafb_layer *ofb)
610 int size = ofb->fb.fix.line_length * ofb->fb.var.yres_virtual;
611 unsigned long start = ofb->video_mem_phys;
612 setup_frame_dma(ofb->fbi, DMA_OV1, PAL_NONE, start, size);
618 static void overlay1fb_enable(struct pxafb_layer *ofb)
620 int enabled = lcd_readl(ofb->fbi, OVL1C1) & OVLxC1_OEN;
621 uint32_t fdadr1 = ofb->fbi->fdadr[DMA_OV1] | (enabled ? 0x1 : 0);
623 lcd_writel(ofb->fbi, enabled ? FBR1 : FDADR1, fdadr1);
624 lcd_writel(ofb->fbi, OVL1C2, ofb->control[1]);
625 lcd_writel(ofb->fbi, OVL1C1, ofb->control[0] | OVLxC1_OEN);
628 static void overlay1fb_disable(struct pxafb_layer *ofb)
630 uint32_t lccr5 = lcd_readl(ofb->fbi, LCCR5);
632 lcd_writel(ofb->fbi, OVL1C1, ofb->control[0] & ~OVLxC1_OEN);
634 lcd_writel(ofb->fbi, LCSR1, LCSR1_BS(1));
635 lcd_writel(ofb->fbi, LCCR5, lccr5 & ~LCSR1_BS(1));
636 lcd_writel(ofb->fbi, FBR1, ofb->fbi->fdadr[DMA_OV1] | 0x3);
638 if (wait_for_completion_timeout(&ofb->branch_done, 1 * HZ) == 0)
641 lcd_writel(ofb->fbi, LCCR5, lccr5);
644 static void overlay2fb_setup(struct pxafb_layer *ofb)
646 int size, div = 1, pfor = NONSTD_TO_PFOR(ofb->fb.var.nonstd);
647 unsigned long start[3] = { ofb->video_mem_phys, 0, 0 };
650 size = ofb->fb.fix.line_length * ofb->fb.var.yres_virtual;
651 setup_frame_dma(ofb->fbi, DMA_OV2_Y, -1, start[0], size);
653 size = ofb->fb.var.xres_virtual * ofb->fb.var.yres_virtual;
661 setup_frame_dma(ofb->fbi, DMA_OV2_Y, -1, start[0], size);
662 setup_frame_dma(ofb->fbi, DMA_OV2_Cb, -1, start[1], size / div);
663 setup_frame_dma(ofb->fbi, DMA_OV2_Cr, -1, start[2], size / div);
667 static void overlay2fb_enable(struct pxafb_layer *ofb)
669 int pfor = NONSTD_TO_PFOR(ofb->fb.var.nonstd);
670 int enabled = lcd_readl(ofb->fbi, OVL2C1) & OVLxC1_OEN;
671 uint32_t fdadr2 = ofb->fbi->fdadr[DMA_OV2_Y] | (enabled ? 0x1 : 0);
672 uint32_t fdadr3 = ofb->fbi->fdadr[DMA_OV2_Cb] | (enabled ? 0x1 : 0);
673 uint32_t fdadr4 = ofb->fbi->fdadr[DMA_OV2_Cr] | (enabled ? 0x1 : 0);
676 lcd_writel(ofb->fbi, enabled ? FBR2 : FDADR2, fdadr2);
678 lcd_writel(ofb->fbi, enabled ? FBR2 : FDADR2, fdadr2);
679 lcd_writel(ofb->fbi, enabled ? FBR3 : FDADR3, fdadr3);
680 lcd_writel(ofb->fbi, enabled ? FBR4 : FDADR4, fdadr4);
682 lcd_writel(ofb->fbi, OVL2C2, ofb->control[1]);
683 lcd_writel(ofb->fbi, OVL2C1, ofb->control[0] | OVLxC1_OEN);
686 static void overlay2fb_disable(struct pxafb_layer *ofb)
688 uint32_t lccr5 = lcd_readl(ofb->fbi, LCCR5);
690 lcd_writel(ofb->fbi, OVL2C1, ofb->control[0] & ~OVLxC1_OEN);
692 lcd_writel(ofb->fbi, LCSR1, LCSR1_BS(2));
693 lcd_writel(ofb->fbi, LCCR5, lccr5 & ~LCSR1_BS(2));
694 lcd_writel(ofb->fbi, FBR2, ofb->fbi->fdadr[DMA_OV2_Y] | 0x3);
695 lcd_writel(ofb->fbi, FBR3, ofb->fbi->fdadr[DMA_OV2_Cb] | 0x3);
696 lcd_writel(ofb->fbi, FBR4, ofb->fbi->fdadr[DMA_OV2_Cr] | 0x3);
698 if (wait_for_completion_timeout(&ofb->branch_done, 1 * HZ) == 0)
717 struct pxafb_layer *ofb = (struct pxafb_layer *)info;
724 if (atomic_inc_and_test(&ofb->usage))
728 fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK);
734 struct pxafb_layer *ofb = (struct pxafb_layer*) info;
736 atomic_dec(&ofb->usage);
737 ofb->ops->disable(ofb);
739 free_pages_exact(ofb->video_mem, ofb->video_mem_size);
740 ofb->video_mem = NULL;
741 ofb->video_mem_size = 0;
748 struct pxafb_layer *ofb = (struct pxafb_layer *)info;
749 struct fb_var_screeninfo *base_var = &ofb->fbi->fb.var;
761 if (ofb->id == OVERLAY1 && pfor != 0)
797 static int overlayfb_map_video_memory(struct pxafb_layer *ofb)
799 struct fb_var_screeninfo *var = &ofb->fb.var;
811 ofb->fb.fix.line_length = var->xres_virtual * bpp / 8;
813 size = PAGE_ALIGN(ofb->fb.fix.line_length * var->yres_virtual);
816 if (ofb->video_mem) {
817 if (ofb->video_mem_size >= size)
820 free_pages_exact(ofb->video_mem, ofb->video_mem_size);
823 ofb->video_mem = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
824 if (ofb->video_mem == NULL)
827 ofb->video_mem_phys = virt_to_phys(ofb->video_mem);
828 ofb->video_mem_size = size;
830 mutex_lock(&ofb->fb.mm_lock);
831 ofb->fb.fix.smem_start = ofb->video_mem_phys;
832 ofb->fb.fix.smem_len = ofb->fb.fix.line_length * var->yres_virtual;
833 mutex_unlock(&ofb->fb.mm_lock);
834 ofb->fb.screen_base = ofb->video_mem;
840 struct pxafb_layer *ofb = (struct pxafb_layer *)info;
844 ret = overlayfb_map_video_memory(ofb);
853 ofb->control[0] = OVLxC1_PPL(var->xres) | OVLxC1_LPO(var->yres) |
855 ofb->control[1] = OVLxC2_XPOS(xpos) | OVLxC2_YPOS(ypos);
857 if (ofb->id == OVERLAY2)
858 ofb->control[1] |= OVL2C2_PFOR(pfor);
860 ofb->ops->setup(ofb);
861 ofb->ops->enable(ofb);
874 struct pxafb_layer *ofb, int id)
876 sprintf(ofb->fb.fix.id, "overlay%d", id + 1);
878 ofb->fb.fix.type = FB_TYPE_PACKED_PIXELS;
879 ofb->fb.fix.xpanstep = 0;
880 ofb->fb.fix.ypanstep = 1;
882 ofb->fb.var.activate = FB_ACTIVATE_NOW;
883 ofb->fb.var.height = -1;
884 ofb->fb.var.width = -1;
885 ofb->fb.var.vmode = FB_VMODE_NONINTERLACED;
887 ofb->fb.fbops = &overlay_fb_ops;
888 ofb->fb.flags = FBINFO_FLAG_DEFAULT;
889 ofb->fb.node = -1;
890 ofb->fb.pseudo_palette = NULL;
892 ofb->id = id;
893 ofb->ops = &ofb_ops[id];
894 atomic_set(&ofb->usage, 0);
895 ofb->fbi = fbi;
896 init_completion(&ofb->branch_done);