Searched refs:sfb (Results 1 - 6 of 6) sorted by relevance

/linux-4.1.27/drivers/staging/sm7xxfb/
H A Dsm7xxfb.c244 struct smtcfb_info *sfb; smtc_setcolreg() local
247 sfb = info->par; smtc_setcolreg()
252 switch (sfb->fb.fix.visual) { smtc_setcolreg()
259 if (sfb->fb.var.bits_per_pixel == 16) { smtc_setcolreg()
260 u32 *pal = sfb->fb.pseudo_palette; smtc_setcolreg()
262 val = chan_to_field(red, &sfb->fb.var.red); smtc_setcolreg()
263 val |= chan_to_field(green, &sfb->fb.var.green); smtc_setcolreg()
264 val |= chan_to_field(blue, &sfb->fb.var.blue); smtc_setcolreg()
275 u32 *pal = sfb->fb.pseudo_palette; smtc_setcolreg()
277 val = chan_to_field(red, &sfb->fb.var.red); smtc_setcolreg()
278 val |= chan_to_field(green, &sfb->fb.var.green); smtc_setcolreg()
279 val |= chan_to_field(blue, &sfb->fb.var.blue); smtc_setcolreg()
469 static void sm7xx_set_timing(struct smtcfb_info *sfb) sm7xx_set_timing() argument
474 dev_dbg(&sfb->pdev->dev, sm7xx_set_timing()
475 "sfb->width=%d sfb->height=%d sfb->fb.var.bits_per_pixel=%d sfb->hz=%d\n", sm7xx_set_timing()
476 sfb->width, sfb->height, sfb->fb.var.bits_per_pixel, sfb->hz); sm7xx_set_timing()
479 if (vgamode[j].mmsizex == sfb->width && sm7xx_set_timing()
480 vgamode[j].mmsizey == sfb->height && sm7xx_set_timing()
481 vgamode[j].bpp == sfb->fb.var.bits_per_pixel && sm7xx_set_timing()
482 vgamode[j].hz == sfb->hz) { sm7xx_set_timing()
483 dev_dbg(&sfb->pdev->dev, sm7xx_set_timing()
488 dev_dbg(&sfb->pdev->dev, "vgamode index=%d\n", j); sm7xx_set_timing()
549 writel(0x0, sfb->vp_regs + 0x0C); sm7xx_set_timing()
550 writel(0x0, sfb->vp_regs + 0x40); sm7xx_set_timing()
554 (sfb->width * sfb->fb.var.bits_per_pixel) / 64; sm7xx_set_timing()
555 switch (sfb->fb.var.bits_per_pixel) { sm7xx_set_timing()
557 writel(0x0, sfb->vp_regs + 0x0); sm7xx_set_timing()
560 writel(0x00020000, sfb->vp_regs + 0x0); sm7xx_set_timing()
563 writel(0x00040000, sfb->vp_regs + 0x0); sm7xx_set_timing()
566 writel(0x00030000, sfb->vp_regs + 0x0); sm7xx_set_timing()
570 sfb->vp_regs + 0x10); sm7xx_set_timing()
573 static void smtc_set_timing(struct smtcfb_info *sfb) smtc_set_timing() argument
575 switch (sfb->chip_id) { smtc_set_timing()
579 sm7xx_set_timing(sfb); smtc_set_timing()
584 static void smtcfb_setmode(struct smtcfb_info *sfb) smtcfb_setmode() argument
586 switch (sfb->fb.var.bits_per_pixel) { smtcfb_setmode()
588 sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR; smtcfb_setmode()
589 sfb->fb.fix.line_length = sfb->fb.var.xres * 4; smtcfb_setmode()
590 sfb->fb.var.red.length = 8; smtcfb_setmode()
591 sfb->fb.var.green.length = 8; smtcfb_setmode()
592 sfb->fb.var.blue.length = 8; smtcfb_setmode()
593 sfb->fb.var.red.offset = 16; smtcfb_setmode()
594 sfb->fb.var.green.offset = 8; smtcfb_setmode()
595 sfb->fb.var.blue.offset = 0; smtcfb_setmode()
598 sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR; smtcfb_setmode()
599 sfb->fb.fix.line_length = sfb->fb.var.xres * 3; smtcfb_setmode()
600 sfb->fb.var.red.length = 8; smtcfb_setmode()
601 sfb->fb.var.green.length = 8; smtcfb_setmode()
602 sfb->fb.var.blue.length = 8; smtcfb_setmode()
603 sfb->fb.var.red.offset = 16; smtcfb_setmode()
604 sfb->fb.var.green.offset = 8; smtcfb_setmode()
605 sfb->fb.var.blue.offset = 0; smtcfb_setmode()
608 sfb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR; smtcfb_setmode()
609 sfb->fb.fix.line_length = sfb->fb.var.xres; smtcfb_setmode()
610 sfb->fb.var.red.length = 3; smtcfb_setmode()
611 sfb->fb.var.green.length = 3; smtcfb_setmode()
612 sfb->fb.var.blue.length = 2; smtcfb_setmode()
613 sfb->fb.var.red.offset = 5; smtcfb_setmode()
614 sfb->fb.var.green.offset = 2; smtcfb_setmode()
615 sfb->fb.var.blue.offset = 0; smtcfb_setmode()
619 sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR; smtcfb_setmode()
620 sfb->fb.fix.line_length = sfb->fb.var.xres * 2; smtcfb_setmode()
621 sfb->fb.var.red.length = 5; smtcfb_setmode()
622 sfb->fb.var.green.length = 6; smtcfb_setmode()
623 sfb->fb.var.blue.length = 5; smtcfb_setmode()
624 sfb->fb.var.red.offset = 11; smtcfb_setmode()
625 sfb->fb.var.green.offset = 5; smtcfb_setmode()
626 sfb->fb.var.blue.offset = 0; smtcfb_setmode()
630 sfb->width = sfb->fb.var.xres; smtcfb_setmode()
631 sfb->height = sfb->fb.var.yres; smtcfb_setmode()
632 sfb->hz = 60; smtcfb_setmode()
633 smtc_set_timing(sfb); smtcfb_setmode()
680 struct smtcfb_info *sfb; smtc_alloc_fb_info() local
682 sfb = kzalloc(sizeof(*sfb), GFP_KERNEL); smtc_alloc_fb_info()
684 if (!sfb) smtc_alloc_fb_info()
687 sfb->pdev = pdev; smtc_alloc_fb_info()
689 sfb->fb.flags = FBINFO_FLAG_DEFAULT; smtc_alloc_fb_info()
690 sfb->fb.fbops = &smtcfb_ops; smtc_alloc_fb_info()
691 sfb->fb.fix = smtcfb_fix; smtc_alloc_fb_info()
692 sfb->fb.var = smtcfb_var; smtc_alloc_fb_info()
693 sfb->fb.pseudo_palette = sfb->colreg; smtc_alloc_fb_info()
694 sfb->fb.par = sfb; smtc_alloc_fb_info()
696 return sfb; smtc_alloc_fb_info()
702 static void smtc_free_fb_info(struct smtcfb_info *sfb) smtc_free_fb_info() argument
704 kfree(sfb); smtc_free_fb_info()
711 static void smtc_unmap_mmio(struct smtcfb_info *sfb) smtc_unmap_mmio() argument
713 if (sfb && smtc_regbaseaddress) smtc_unmap_mmio()
721 static int smtc_map_smem(struct smtcfb_info *sfb, smtc_map_smem() argument
724 sfb->fb.fix.smem_start = pci_resource_start(pdev, 0); smtc_map_smem()
727 if (sfb->fb.var.bits_per_pixel == 32) smtc_map_smem()
728 sfb->fb.fix.smem_start += 0x800000; smtc_map_smem()
731 sfb->fb.fix.smem_len = smem_len; smtc_map_smem()
733 sfb->fb.screen_base = sfb->lfb; smtc_map_smem()
735 if (!sfb->fb.screen_base) { smtc_map_smem()
737 "%s: unable to map screen memory\n", sfb->fb.fix.id); smtc_map_smem()
748 static void smtc_unmap_smem(struct smtcfb_info *sfb) smtc_unmap_smem() argument
750 if (sfb && sfb->fb.screen_base) { smtc_unmap_smem()
751 iounmap(sfb->fb.screen_base); smtc_unmap_smem()
752 sfb->fb.screen_base = NULL; smtc_unmap_smem()
768 struct smtcfb_info *sfb; smtcfb_pci_probe() local
787 sfb = smtc_alloc_fb_info(pdev); smtcfb_pci_probe()
789 if (!sfb) { smtcfb_pci_probe()
794 sfb->chip_id = ent->device; smtcfb_pci_probe()
796 pci_set_drvdata(pdev, sfb); smtcfb_pci_probe()
802 sfb->fb.var.xres = smtc_scr_info.lfb_width; smtcfb_pci_probe()
803 sfb->fb.var.yres = smtc_scr_info.lfb_height; smtcfb_pci_probe()
804 sfb->fb.var.bits_per_pixel = smtc_scr_info.lfb_depth; smtcfb_pci_probe()
807 sfb->fb.var.xres = SCREEN_X_RES; smtcfb_pci_probe()
808 sfb->fb.var.yres = SCREEN_Y_RES; smtcfb_pci_probe()
809 sfb->fb.var.bits_per_pixel = SCREEN_BPP; smtcfb_pci_probe()
813 if (sfb->fb.var.bits_per_pixel == 24) smtcfb_pci_probe()
814 sfb->fb.var.bits_per_pixel = (smtc_scr_info.lfb_depth = 32); smtcfb_pci_probe()
818 pci_read_config_byte(pdev, PCI_REVISION_ID, &sfb->chip_rev_id); smtcfb_pci_probe()
820 switch (sfb->chip_id) { smtcfb_pci_probe()
823 sfb->fb.fix.mmio_start = mmio_base + 0x00400000; smtcfb_pci_probe()
824 sfb->fb.fix.mmio_len = 0x00400000; smtcfb_pci_probe()
827 sfb->lfb = ioremap(mmio_base, 0x00c00000); smtcfb_pci_probe()
829 sfb->lfb = ioremap(mmio_base, 0x00800000); smtcfb_pci_probe()
831 sfb->mmio = (smtc_regbaseaddress = smtcfb_pci_probe()
832 sfb->lfb + 0x00700000); smtcfb_pci_probe()
833 sfb->dp_regs = sfb->lfb + 0x00408000; smtcfb_pci_probe()
834 sfb->vp_regs = sfb->lfb + 0x0040c000; smtcfb_pci_probe()
836 if (sfb->fb.var.bits_per_pixel == 32) { smtcfb_pci_probe()
837 sfb->lfb += 0x800000; smtcfb_pci_probe()
838 dev_info(&pdev->dev, "sfb->lfb=%p", sfb->lfb); smtcfb_pci_probe()
844 sfb->fb.fix.id); smtcfb_pci_probe()
857 if (sfb->fb.var.bits_per_pixel == 32) smtcfb_pci_probe()
862 sfb->fb.fix.mmio_start = mmio_base; smtcfb_pci_probe()
863 sfb->fb.fix.mmio_len = 0x00200000; smtcfb_pci_probe()
865 sfb->dp_regs = ioremap(mmio_base, 0x00a00000); smtcfb_pci_probe()
866 sfb->lfb = sfb->dp_regs + 0x00200000; smtcfb_pci_probe()
867 sfb->mmio = (smtc_regbaseaddress = smtcfb_pci_probe()
868 sfb->dp_regs + 0x000c0000); smtcfb_pci_probe()
869 sfb->vp_regs = sfb->dp_regs + 0x800; smtcfb_pci_probe()
883 if (15 == sfb->fb.var.bits_per_pixel) smtcfb_pci_probe()
884 sfb->fb.var.bits_per_pixel = 16; smtcfb_pci_probe()
886 sfb->fb.var.xres_virtual = sfb->fb.var.xres; smtcfb_pci_probe()
887 sfb->fb.var.yres_virtual = sfb->fb.var.yres; smtcfb_pci_probe()
888 err = smtc_map_smem(sfb, pdev, smem_size); smtcfb_pci_probe()
892 smtcfb_setmode(sfb); smtcfb_pci_probe()
894 err = register_framebuffer(&sfb->fb); smtcfb_pci_probe()
900 sfb->chip_id, sfb->chip_rev_id, sfb->fb.var.xres, smtcfb_pci_probe()
901 sfb->fb.var.yres, sfb->fb.var.bits_per_pixel); smtcfb_pci_probe()
908 smtc_unmap_smem(sfb); smtcfb_pci_probe()
909 smtc_unmap_mmio(sfb); smtcfb_pci_probe()
911 smtc_free_fb_info(sfb); smtcfb_pci_probe()
938 struct smtcfb_info *sfb; smtcfb_pci_remove() local
940 sfb = pci_get_drvdata(pdev); smtcfb_pci_remove()
941 smtc_unmap_smem(sfb); smtcfb_pci_remove()
942 smtc_unmap_mmio(sfb); smtcfb_pci_remove()
943 unregister_framebuffer(&sfb->fb); smtcfb_pci_remove()
944 smtc_free_fb_info(sfb); smtcfb_pci_remove()
953 struct smtcfb_info *sfb; smtcfb_pci_suspend() local
955 sfb = pci_get_drvdata(pdev); smtcfb_pci_suspend()
964 fb_set_suspend(&sfb->fb, 1); smtcfb_pci_suspend()
976 struct smtcfb_info *sfb; smtcfb_pci_resume() local
978 sfb = pci_get_drvdata(pdev); smtcfb_pci_resume()
982 switch (sfb->chip_id) { smtcfb_pci_resume()
992 if (sfb->fb.var.bits_per_pixel == 32) smtcfb_pci_resume()
1006 smtcfb_setmode(sfb); smtcfb_pci_resume()
1009 fb_set_suspend(&sfb->fb, 0); smtcfb_pci_resume()
/linux-4.1.27/drivers/video/fbdev/
H A Ds3c-fb.c246 struct s3c_fb *sfb = win->parent; s3c_fb_check_var() local
248 dev_dbg(sfb->dev, "checking parameters\n"); s3c_fb_check_var()
254 dev_dbg(sfb->dev, "win %d: unsupported bpp %d\n", s3c_fb_check_var()
268 if (sfb->variant.palette[win->index] != 0) { s3c_fb_check_var()
331 dev_err(sfb->dev, "invalid bpp\n"); s3c_fb_check_var()
335 dev_dbg(sfb->dev, "%s: verified parameters\n", __func__); s3c_fb_check_var()
341 * @sfb: The hardware state.
347 static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk) s3c_fb_calc_pixclk() argument
353 if (sfb->variant.has_clksel) s3c_fb_calc_pixclk()
354 clk = clk_get_rate(sfb->bus_clk); s3c_fb_calc_pixclk()
356 clk = clk_get_rate(sfb->lcd_clk); s3c_fb_calc_pixclk()
364 dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", s3c_fb_calc_pixclk()
397 struct s3c_fb *sfb = win->parent; vidosd_set_size() local
401 writel(size, sfb->regs + OSD_BASE(win->index, sfb->variant) vidosd_set_size()
413 struct s3c_fb *sfb = win->parent; vidosd_set_alpha() local
416 writel(alpha, sfb->regs + VIDOSD_C(win->index, sfb->variant)); vidosd_set_alpha()
427 struct s3c_fb *sfb = win->parent; shadow_protect_win() local
431 if (sfb->variant.has_prtcon) { shadow_protect_win()
432 writel(PRTCON_PROTECT, sfb->regs + PRTCON); shadow_protect_win()
433 } else if (sfb->variant.has_shadowcon) { shadow_protect_win()
434 reg = readl(sfb->regs + SHADOWCON); shadow_protect_win()
436 sfb->regs + SHADOWCON); shadow_protect_win()
439 if (sfb->variant.has_prtcon) { shadow_protect_win()
440 writel(0, sfb->regs + PRTCON); shadow_protect_win()
441 } else if (sfb->variant.has_shadowcon) { shadow_protect_win()
442 reg = readl(sfb->regs + SHADOWCON); shadow_protect_win()
444 sfb->regs + SHADOWCON); shadow_protect_win()
451 * @sfb: The main framebuffer state.
454 static void s3c_fb_enable(struct s3c_fb *sfb, int enable) s3c_fb_enable() argument
456 u32 vidcon0 = readl(sfb->regs + VIDCON0); s3c_fb_enable()
458 if (enable && !sfb->output_on) s3c_fb_enable()
459 pm_runtime_get_sync(sfb->dev); s3c_fb_enable()
474 writel(vidcon0, sfb->regs + VIDCON0); s3c_fb_enable()
476 if (!enable && sfb->output_on) s3c_fb_enable()
477 pm_runtime_put_sync(sfb->dev); s3c_fb_enable()
479 sfb->output_on = enable; s3c_fb_enable()
492 struct s3c_fb *sfb = win->parent; s3c_fb_set_par() local
493 void __iomem *regs = sfb->regs; s3c_fb_set_par()
500 dev_dbg(sfb->dev, "setting framebuffer parameters\n"); s3c_fb_set_par()
502 pm_runtime_get_sync(sfb->dev); s3c_fb_set_par()
535 if (!sfb->output_on) s3c_fb_set_par()
536 s3c_fb_enable(sfb, 1); s3c_fb_set_par()
543 writel(info->fix.smem_start, buf + sfb->variant.buf_start); s3c_fb_set_par()
546 writel(data, buf + sfb->variant.buf_end); s3c_fb_set_par()
553 writel(data, regs + sfb->variant.buf_size + (win_no * 4)); s3c_fb_set_par()
559 writel(data, regs + VIDOSD_A(win_no, sfb->variant)); s3c_fb_set_par()
568 writel(data, regs + VIDOSD_B(win_no, sfb->variant)); s3c_fb_set_par()
580 if (sfb->variant.has_shadowcon) { s3c_fb_set_par()
581 data = readl(sfb->regs + SHADOWCON); s3c_fb_set_par()
583 writel(data, sfb->regs + SHADOWCON); s3c_fb_set_par()
587 sfb->enabled |= (1 << win->index); s3c_fb_set_par()
650 void __iomem *keycon = regs + sfb->variant.keycon; s3c_fb_set_par()
664 writel(data, regs + sfb->variant.wincon + (win_no * 4)); s3c_fb_set_par()
665 writel(0x0, regs + sfb->variant.winmap + (win_no * 4)); s3c_fb_set_par()
668 if (sfb->variant.has_blendcon) { s3c_fb_set_par()
669 data = readl(sfb->regs + BLENDCON); s3c_fb_set_par()
675 writel(data, sfb->regs + BLENDCON); s3c_fb_set_par()
680 pm_runtime_put_sync(sfb->dev); s3c_fb_set_par()
687 * @sfb: The hardware information.
699 static void s3c_fb_update_palette(struct s3c_fb *sfb, s3c_fb_update_palette() argument
707 palreg = sfb->regs + sfb->variant.palette[win->index]; s3c_fb_update_palette()
709 dev_dbg(sfb->dev, "%s: win %d, reg %d (%p): %08x\n", s3c_fb_update_palette()
714 palcon = readl(sfb->regs + WPALCON); s3c_fb_update_palette()
715 writel(palcon | WPALCON_PAL_UPDATE, sfb->regs + WPALCON); s3c_fb_update_palette()
722 writel(palcon, sfb->regs + WPALCON); s3c_fb_update_palette()
747 struct s3c_fb *sfb = win->parent; s3c_fb_setcolreg() local
750 dev_dbg(sfb->dev, "%s: win %d: %d => rgb=%d/%d/%d\n", s3c_fb_setcolreg()
753 pm_runtime_get_sync(sfb->dev); s3c_fb_setcolreg()
776 s3c_fb_update_palette(sfb, win, regno, val); s3c_fb_setcolreg()
782 pm_runtime_put_sync(sfb->dev); s3c_fb_setcolreg()
786 pm_runtime_put_sync(sfb->dev); s3c_fb_setcolreg()
800 struct s3c_fb *sfb = win->parent; s3c_fb_blank() local
803 u32 output_on = sfb->output_on; s3c_fb_blank()
805 dev_dbg(sfb->dev, "blank mode %d\n", blank_mode); s3c_fb_blank()
807 pm_runtime_get_sync(sfb->dev); s3c_fb_blank()
809 wincon = readl(sfb->regs + sfb->variant.wincon + (index * 4)); s3c_fb_blank()
814 sfb->enabled &= ~(1 << index); s3c_fb_blank()
821 sfb->regs + sfb->variant.winmap + (index * 4)); s3c_fb_blank()
827 writel(0x0, sfb->regs + sfb->variant.winmap + (index * 4)); s3c_fb_blank()
830 sfb->enabled |= (1 << index); s3c_fb_blank()
836 pm_runtime_put_sync(sfb->dev); s3c_fb_blank()
841 writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4)); s3c_fb_blank()
848 s3c_fb_enable(sfb, sfb->enabled ? 1 : 0); s3c_fb_blank()
851 pm_runtime_put_sync(sfb->dev); s3c_fb_blank()
853 return output_on == sfb->output_on; s3c_fb_blank()
871 struct s3c_fb *sfb = win->parent; s3c_fb_pan_display() local
872 void __iomem *buf = sfb->regs + win->index * 8; s3c_fb_pan_display()
875 pm_runtime_get_sync(sfb->dev); s3c_fb_pan_display()
894 dev_err(sfb->dev, "invalid bpp\n"); s3c_fb_pan_display()
895 pm_runtime_put_sync(sfb->dev); s3c_fb_pan_display()
906 writel(info->fix.smem_start + start_boff, buf + sfb->variant.buf_start); s3c_fb_pan_display()
907 writel(info->fix.smem_start + end_boff, buf + sfb->variant.buf_end); s3c_fb_pan_display()
911 pm_runtime_put_sync(sfb->dev); s3c_fb_pan_display()
917 * @sfb: main hardware state
919 static void s3c_fb_enable_irq(struct s3c_fb *sfb) s3c_fb_enable_irq() argument
921 void __iomem *regs = sfb->regs; s3c_fb_enable_irq()
924 if (!test_and_set_bit(S3C_FB_VSYNC_IRQ_EN, &sfb->irq_flags)) { s3c_fb_enable_irq()
942 * @sfb: main hardware state
944 static void s3c_fb_disable_irq(struct s3c_fb *sfb) s3c_fb_disable_irq() argument
946 void __iomem *regs = sfb->regs; s3c_fb_disable_irq()
949 if (test_and_clear_bit(S3C_FB_VSYNC_IRQ_EN, &sfb->irq_flags)) { s3c_fb_disable_irq()
962 struct s3c_fb *sfb = dev_id; s3c_fb_irq() local
963 void __iomem *regs = sfb->regs; s3c_fb_irq()
966 spin_lock(&sfb->slock); s3c_fb_irq()
975 sfb->vsync_info.count++; s3c_fb_irq()
976 wake_up_interruptible(&sfb->vsync_info.wait); s3c_fb_irq()
982 s3c_fb_disable_irq(sfb); s3c_fb_irq()
984 spin_unlock(&sfb->slock); s3c_fb_irq()
990 * @sfb: main hardware state
993 static int s3c_fb_wait_for_vsync(struct s3c_fb *sfb, u32 crtc) s3c_fb_wait_for_vsync() argument
1001 pm_runtime_get_sync(sfb->dev); s3c_fb_wait_for_vsync()
1003 count = sfb->vsync_info.count; s3c_fb_wait_for_vsync()
1004 s3c_fb_enable_irq(sfb); s3c_fb_wait_for_vsync()
1005 ret = wait_event_interruptible_timeout(sfb->vsync_info.wait, s3c_fb_wait_for_vsync()
1006 count != sfb->vsync_info.count, s3c_fb_wait_for_vsync()
1009 pm_runtime_put_sync(sfb->dev); s3c_fb_wait_for_vsync()
1021 struct s3c_fb *sfb = win->parent; s3c_fb_ioctl() local
1032 ret = s3c_fb_wait_for_vsync(sfb, crtc); s3c_fb_ioctl()
1078 * @sfb: The base resources for the hardware.
1083 static int s3c_fb_alloc_memory(struct s3c_fb *sfb, struct s3c_fb_win *win) s3c_fb_alloc_memory() argument
1090 dev_dbg(sfb->dev, "allocating memory for display\n"); s3c_fb_alloc_memory()
1095 dev_dbg(sfb->dev, "real_size=%u (%u.%u), virt_size=%u (%u.%u)\n", s3c_fb_alloc_memory()
1106 dev_dbg(sfb->dev, "want %u bytes for window\n", size); s3c_fb_alloc_memory()
1108 fbi->screen_base = dma_alloc_writecombine(sfb->dev, size, s3c_fb_alloc_memory()
1113 dev_dbg(sfb->dev, "mapped %x to %p\n", s3c_fb_alloc_memory()
1124 * @sfb: The base resources for the hardware.
1129 static void s3c_fb_free_memory(struct s3c_fb *sfb, struct s3c_fb_win *win) s3c_fb_free_memory() argument
1134 dma_free_writecombine(sfb->dev, PAGE_ALIGN(fbi->fix.smem_len), s3c_fb_free_memory()
1145 static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win) s3c_fb_release_win() argument
1150 if (sfb->variant.has_shadowcon) { s3c_fb_release_win()
1151 data = readl(sfb->regs + SHADOWCON); s3c_fb_release_win()
1154 writel(data, sfb->regs + SHADOWCON); s3c_fb_release_win()
1159 s3c_fb_free_memory(sfb, win); s3c_fb_release_win()
1166 * @sfb: The base resources for the hardware
1173 static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no, s3c_fb_probe_win() argument
1185 dev_dbg(sfb->dev, "probing window %d, variant %p\n", win_no, variant); s3c_fb_probe_win()
1187 init_waitqueue_head(&sfb->vsync_info.wait); s3c_fb_probe_win()
1192 palette_size * sizeof(u32), sfb->dev); s3c_fb_probe_win()
1194 dev_err(sfb->dev, "failed to allocate framebuffer\n"); s3c_fb_probe_win()
1198 windata = sfb->pdata->win[win_no]; s3c_fb_probe_win()
1199 initmode = *sfb->pdata->vtiming; s3c_fb_probe_win()
1210 win->parent = sfb; s3c_fb_probe_win()
1215 ret = s3c_fb_alloc_memory(sfb, win); s3c_fb_probe_win()
1217 dev_err(sfb->dev, "failed to allocate display memory\n"); s3c_fb_probe_win()
1259 dev_err(sfb->dev, "check_var failed on initial video params\n"); s3c_fb_probe_win()
1269 dev_err(sfb->dev, "failed to allocate fb cmap\n"); s3c_fb_probe_win()
1273 dev_dbg(sfb->dev, "about to register framebuffer\n"); s3c_fb_probe_win()
1279 dev_err(sfb->dev, "failed to register framebuffer\n"); s3c_fb_probe_win()
1283 dev_info(sfb->dev, "window %d: fb %s\n", win_no, fbinfo->fix.id); s3c_fb_probe_win()
1290 * @sfb: The base resources for the hardware.
1294 static void s3c_fb_set_rgb_timing(struct s3c_fb *sfb) s3c_fb_set_rgb_timing() argument
1296 struct fb_videomode *vmode = sfb->pdata->vtiming; s3c_fb_set_rgb_timing()
1297 void __iomem *regs = sfb->regs; s3c_fb_set_rgb_timing()
1304 clkdiv = s3c_fb_calc_pixclk(sfb, vmode->pixclock); s3c_fb_set_rgb_timing()
1306 data = sfb->pdata->vidcon0; s3c_fb_set_rgb_timing()
1314 if (sfb->variant.is_2443) s3c_fb_set_rgb_timing()
1321 writel(data, regs + sfb->variant.vidtcon); s3c_fb_set_rgb_timing()
1326 writel(data, regs + sfb->variant.vidtcon + 4); s3c_fb_set_rgb_timing()
1332 writel(data, regs + sfb->variant.vidtcon + 8); s3c_fb_set_rgb_timing()
1337 * @sfb: The base resources for the hardware.
1342 static void s3c_fb_clear_win(struct s3c_fb *sfb, int win) s3c_fb_clear_win() argument
1344 void __iomem *regs = sfb->regs; s3c_fb_clear_win()
1347 writel(0, regs + sfb->variant.wincon + (win * 4)); s3c_fb_clear_win()
1348 writel(0, regs + VIDOSD_A(win, sfb->variant)); s3c_fb_clear_win()
1349 writel(0, regs + VIDOSD_B(win, sfb->variant)); s3c_fb_clear_win()
1350 writel(0, regs + VIDOSD_C(win, sfb->variant)); s3c_fb_clear_win()
1352 if (sfb->variant.has_shadowcon) { s3c_fb_clear_win()
1353 reg = readl(sfb->regs + SHADOWCON); s3c_fb_clear_win()
1357 writel(reg, sfb->regs + SHADOWCON); s3c_fb_clear_win()
1367 struct s3c_fb *sfb; s3c_fb_probe() local
1387 sfb = devm_kzalloc(dev, sizeof(struct s3c_fb), GFP_KERNEL); s3c_fb_probe()
1388 if (!sfb) { s3c_fb_probe()
1393 dev_dbg(dev, "allocate new framebuffer %p\n", sfb); s3c_fb_probe()
1395 sfb->dev = dev; s3c_fb_probe()
1396 sfb->pdata = pd; s3c_fb_probe()
1397 sfb->variant = fbdrv->variant; s3c_fb_probe()
1399 spin_lock_init(&sfb->slock); s3c_fb_probe()
1401 sfb->bus_clk = devm_clk_get(dev, "lcd"); s3c_fb_probe()
1402 if (IS_ERR(sfb->bus_clk)) { s3c_fb_probe()
1404 return PTR_ERR(sfb->bus_clk); s3c_fb_probe()
1407 clk_prepare_enable(sfb->bus_clk); s3c_fb_probe()
1409 if (!sfb->variant.has_clksel) { s3c_fb_probe()
1410 sfb->lcd_clk = devm_clk_get(dev, "sclk_fimd"); s3c_fb_probe()
1411 if (IS_ERR(sfb->lcd_clk)) { s3c_fb_probe()
1413 ret = PTR_ERR(sfb->lcd_clk); s3c_fb_probe()
1417 clk_prepare_enable(sfb->lcd_clk); s3c_fb_probe()
1420 pm_runtime_enable(sfb->dev); s3c_fb_probe()
1423 sfb->regs = devm_ioremap_resource(dev, res); s3c_fb_probe()
1424 if (IS_ERR(sfb->regs)) { s3c_fb_probe()
1425 ret = PTR_ERR(sfb->regs); s3c_fb_probe()
1435 sfb->irq_no = res->start; s3c_fb_probe()
1436 ret = devm_request_irq(dev, sfb->irq_no, s3c_fb_irq, s3c_fb_probe()
1437 0, "s3c_fb", sfb); s3c_fb_probe()
1443 dev_dbg(dev, "got resources (regs %p), probing windows\n", sfb->regs); s3c_fb_probe()
1445 platform_set_drvdata(pdev, sfb); s3c_fb_probe()
1446 pm_runtime_get_sync(sfb->dev); s3c_fb_probe()
1452 writel(pd->vidcon1, sfb->regs + VIDCON1); s3c_fb_probe()
1455 if (sfb->variant.has_fixvclk) { s3c_fb_probe()
1456 reg = readl(sfb->regs + VIDCON1); s3c_fb_probe()
1459 writel(reg, sfb->regs + VIDCON1); s3c_fb_probe()
1465 s3c_fb_clear_win(sfb, win); s3c_fb_probe()
1469 void __iomem *regs = sfb->regs + sfb->variant.keycon; s3c_fb_probe()
1476 s3c_fb_set_rgb_timing(sfb); s3c_fb_probe()
1484 ret = s3c_fb_probe_win(sfb, win, fbdrv->win[win], s3c_fb_probe()
1485 &sfb->windows[win]); s3c_fb_probe()
1489 s3c_fb_release_win(sfb, sfb->windows[win]); s3c_fb_probe()
1494 platform_set_drvdata(pdev, sfb); s3c_fb_probe()
1495 pm_runtime_put_sync(sfb->dev); s3c_fb_probe()
1500 pm_runtime_put_sync(sfb->dev); s3c_fb_probe()
1503 pm_runtime_disable(sfb->dev); s3c_fb_probe()
1505 if (!sfb->variant.has_clksel) s3c_fb_probe()
1506 clk_disable_unprepare(sfb->lcd_clk); s3c_fb_probe()
1509 clk_disable_unprepare(sfb->bus_clk); s3c_fb_probe()
1523 struct s3c_fb *sfb = platform_get_drvdata(pdev); s3c_fb_remove() local
1526 pm_runtime_get_sync(sfb->dev); s3c_fb_remove()
1529 if (sfb->windows[win]) s3c_fb_remove()
1530 s3c_fb_release_win(sfb, sfb->windows[win]); s3c_fb_remove()
1532 if (!sfb->variant.has_clksel) s3c_fb_remove()
1533 clk_disable_unprepare(sfb->lcd_clk); s3c_fb_remove()
1535 clk_disable_unprepare(sfb->bus_clk); s3c_fb_remove()
1537 pm_runtime_put_sync(sfb->dev); s3c_fb_remove()
1538 pm_runtime_disable(sfb->dev); s3c_fb_remove()
1546 struct s3c_fb *sfb = dev_get_drvdata(dev); s3c_fb_suspend() local
1550 pm_runtime_get_sync(sfb->dev); s3c_fb_suspend()
1553 win = sfb->windows[win_no]; s3c_fb_suspend()
1561 if (!sfb->variant.has_clksel) s3c_fb_suspend()
1562 clk_disable_unprepare(sfb->lcd_clk); s3c_fb_suspend()
1564 clk_disable_unprepare(sfb->bus_clk); s3c_fb_suspend()
1566 pm_runtime_put_sync(sfb->dev); s3c_fb_suspend()
1573 struct s3c_fb *sfb = dev_get_drvdata(dev); s3c_fb_resume() local
1574 struct s3c_fb_platdata *pd = sfb->pdata; s3c_fb_resume()
1579 pm_runtime_get_sync(sfb->dev); s3c_fb_resume()
1581 clk_prepare_enable(sfb->bus_clk); s3c_fb_resume()
1583 if (!sfb->variant.has_clksel) s3c_fb_resume()
1584 clk_prepare_enable(sfb->lcd_clk); s3c_fb_resume()
1588 writel(pd->vidcon1, sfb->regs + VIDCON1); s3c_fb_resume()
1591 if (sfb->variant.has_fixvclk) { s3c_fb_resume()
1592 reg = readl(sfb->regs + VIDCON1); s3c_fb_resume()
1595 writel(reg, sfb->regs + VIDCON1); s3c_fb_resume()
1599 for (win_no = 0; win_no < sfb->variant.nr_windows; win_no++) s3c_fb_resume()
1600 s3c_fb_clear_win(sfb, win_no); s3c_fb_resume()
1602 for (win_no = 0; win_no < sfb->variant.nr_windows - 1; win_no++) { s3c_fb_resume()
1603 void __iomem *regs = sfb->regs + sfb->variant.keycon; s3c_fb_resume()
1604 win = sfb->windows[win_no]; s3c_fb_resume()
1615 s3c_fb_set_rgb_timing(sfb); s3c_fb_resume()
1619 win = sfb->windows[win_no]; s3c_fb_resume()
1627 pm_runtime_put_sync(sfb->dev); s3c_fb_resume()
1636 struct s3c_fb *sfb = dev_get_drvdata(dev); s3c_fb_runtime_suspend() local
1638 if (!sfb->variant.has_clksel) s3c_fb_runtime_suspend()
1639 clk_disable_unprepare(sfb->lcd_clk); s3c_fb_runtime_suspend()
1641 clk_disable_unprepare(sfb->bus_clk); s3c_fb_runtime_suspend()
1648 struct s3c_fb *sfb = dev_get_drvdata(dev); s3c_fb_runtime_resume() local
1649 struct s3c_fb_platdata *pd = sfb->pdata; s3c_fb_runtime_resume()
1651 clk_prepare_enable(sfb->bus_clk); s3c_fb_runtime_resume()
1653 if (!sfb->variant.has_clksel) s3c_fb_runtime_resume()
1654 clk_prepare_enable(sfb->lcd_clk); s3c_fb_runtime_resume()
1658 writel(pd->vidcon1, sfb->regs + VIDCON1); s3c_fb_runtime_resume()
H A Dpmagb-b-fb.c39 volatile u32 __iomem *sfb; member in struct:pmagbbfb_par
71 writel(v, par->sfb + reg / 4); sfb_write()
76 return readl(par->sfb + reg / 4); sfb_read()
298 par->sfb = par->mmio + PMAGB_B_SFB; pmagbbfb_probe()
H A Dtgafb.c1204 void __iomem *sfb; copyarea_8bpp() local
1207 sfb = tga_fb + sepos; copyarea_8bpp()
1212 !(((unsigned long)sfb | (unsigned long)dfb) & 63)) { copyarea_8bpp()
1214 __raw_writel(sfb - tga_fb, tga_regs+TGA_COPY64_SRC); copyarea_8bpp()
1218 sfb += 64; copyarea_8bpp()
1225 __raw_writel(0xffffffff, sfb); copyarea_8bpp()
1229 sfb += step; copyarea_8bpp()
1234 sfb += last_step - step; copyarea_8bpp()
1236 __raw_writel(mask_last, sfb); copyarea_8bpp()
/linux-4.1.27/arch/s390/kernel/
H A Dperf_cpum_sf.c85 struct sf_buffer sfb; /* Sampling buffer */ member in struct:cpu_hw_sf
110 return !!cpuhw->sfb.sdbt; sf_buffer_available()
116 static void free_sampling_buffer(struct sf_buffer *sfb) free_sampling_buffer() argument
120 if (!sfb->sdbt) free_sampling_buffer()
123 sdbt = sfb->sdbt; free_sampling_buffer()
138 if (curr == sfb->sdbt) free_sampling_buffer()
152 "free_sampling_buffer: freed sdbt=%p\n", sfb->sdbt); free_sampling_buffer()
153 memset(sfb, 0, sizeof(*sfb)); free_sampling_buffer()
184 static int realloc_sampling_buffer(struct sf_buffer *sfb, realloc_sampling_buffer() argument
190 if (!sfb->sdbt || !sfb->tail) realloc_sampling_buffer()
193 if (!is_link_entry(sfb->tail)) realloc_sampling_buffer()
201 tail = sfb->tail; realloc_sampling_buffer()
206 if (sfb->sdbt != get_next_sdbt(tail)) { realloc_sampling_buffer()
210 (void *) sfb->sdbt, (void *) tail); realloc_sampling_buffer()
224 sfb->num_sdbt++; realloc_sampling_buffer()
238 sfb->num_sdb++; realloc_sampling_buffer()
243 *tail = (unsigned long) sfb->sdbt + 1; realloc_sampling_buffer()
244 sfb->tail = tail; realloc_sampling_buffer()
248 sfb->num_sdbt, sfb->num_sdb); realloc_sampling_buffer()
263 static int alloc_sampling_buffer(struct sf_buffer *sfb, unsigned long num_sdb) alloc_sampling_buffer() argument
267 if (sfb->sdbt) alloc_sampling_buffer()
271 sfb->sdbt = (unsigned long *) get_zeroed_page(GFP_KERNEL); alloc_sampling_buffer()
272 if (!sfb->sdbt) alloc_sampling_buffer()
274 sfb->num_sdb = 0; alloc_sampling_buffer()
275 sfb->num_sdbt = 1; alloc_sampling_buffer()
280 sfb->tail = sfb->sdbt; alloc_sampling_buffer()
281 *sfb->tail = (unsigned long)(void *) sfb->sdbt + 1; alloc_sampling_buffer()
284 rc = realloc_sampling_buffer(sfb, num_sdb, GFP_KERNEL); alloc_sampling_buffer()
286 free_sampling_buffer(sfb); alloc_sampling_buffer()
292 sfb->sdbt, (void *) *sfb->sdbt); alloc_sampling_buffer()
314 static unsigned long sfb_pending_allocs(struct sf_buffer *sfb, sfb_pending_allocs() argument
317 if (!sfb->sdbt) sfb_pending_allocs()
319 if (SFB_ALLOC_REG(hwc) > sfb->num_sdb) sfb_pending_allocs()
320 return SFB_ALLOC_REG(hwc) - sfb->num_sdb; sfb_pending_allocs()
324 static int sfb_has_pending_allocs(struct sf_buffer *sfb, sfb_has_pending_allocs() argument
327 return sfb_pending_allocs(sfb, hwc) > 0; sfb_has_pending_allocs()
362 if (cpuhw->sfb.sdbt) deallocate_buffers()
363 free_sampling_buffer(&cpuhw->sfb); deallocate_buffers()
448 return alloc_sampling_buffer(&cpuhw->sfb, allocate_buffers()
449 sfb_pending_allocs(&cpuhw->sfb, hwc)); allocate_buffers()
496 ratio = DIV_ROUND_UP(100 * OVERFLOW_REG(hwc) * cpuhw->sfb.num_sdb, sfb_account_overflows()
500 num = compute_sfb_extent(ratio, cpuhw->sfb.num_sdb); sfb_account_overflows()
504 debug_sprintf_event(sfdbg, 5, "sfb: overflow: overflow=%llu ratio=%lu" sfb_account_overflows()
510 * @sfb: Sampling buffer structure (for local CPU)
520 static void extend_sampling_buffer(struct sf_buffer *sfb, extend_sampling_buffer() argument
526 num = sfb_pending_allocs(sfb, hwc); extend_sampling_buffer()
529 num_old = sfb->num_sdb; extend_sampling_buffer()
541 rc = realloc_sampling_buffer(sfb, num, GFP_ATOMIC); extend_sampling_buffer()
543 debug_sprintf_event(sfdbg, 5, "sfb: extend: realloc " extend_sampling_buffer()
546 if (sfb_has_pending_allocs(sfb, hwc)) extend_sampling_buffer()
547 debug_sprintf_event(sfdbg, 5, "sfb: extend: " extend_sampling_buffer()
549 num, sfb->num_sdb - num_old, extend_sampling_buffer()
550 sfb_pending_allocs(sfb, hwc)); extend_sampling_buffer()
877 if (sfb_has_pending_allocs(&cpuhw->sfb, hwc)) cpumsf_pmu_enable()
878 extend_sampling_buffer(&cpuhw->sfb, hwc); cpumsf_pmu_enable()
1355 if (!cpuhw->sfb.sdbt) cpumsf_pmu_add()
1370 cpuhw->lsctl.tear = (unsigned long) cpuhw->sfb.sdbt; cpumsf_pmu_add()
1371 cpuhw->lsctl.dear = *(unsigned long *) cpuhw->sfb.sdbt; cpumsf_pmu_add()
1373 hw_reset_registers(&event->hw, cpuhw->sfb.sdbt); cpumsf_pmu_add()
/linux-4.1.27/net/sched/
H A Dsch_sfb.c697 .id = "sfb",

Completed in 327 milliseconds