MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bcm_fb_init

Function bcm_fb_init

freebsd/arm/broadcom/bcm2835/bcm2835_fbd.c:78–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76static int bcm_fb_attach(device_t);
77
78static int
79bcm_fb_init(struct bcmsc_softc *sc, struct bcm2835_fb_config *fb)
80{
81 int err;
82
83 err = 0;
84
85 memset(fb, 0, sizeof(*fb));
86 if (bcm2835_mbox_fb_get_w_h(fb) != 0)
87 return (ENXIO);
88 if (bcm2835_mbox_fb_get_bpp(fb) != 0)
89 return (ENXIO);
90 if (fb->bpp < FB_DEPTH) {
91 device_printf(sc->dev, "changing fb bpp from %d to %d\n",
92 fb->bpp, FB_DEPTH);
93 fb->bpp = FB_DEPTH;
94 } else
95 device_printf(sc->dev, "keeping existing fb bpp of %d\n",
96 fb->bpp);
97
98 fb->vxres = fb->xres;
99 fb->vyres = fb->yres;
100 fb->xoffset = fb->yoffset = 0;
101
102 if ((err = bcm2835_mbox_fb_init(fb)) != 0) {
103 device_printf(sc->dev, "bcm2835_mbox_fb_init failed, err=%d\n",
104 err);
105 return (ENXIO);
106 }
107
108 return (0);
109}
110
111static int
112bcm_fb_setup_fbd(struct bcmsc_softc *sc)

Callers 2

bcm_fb_setup_fbdFunction · 0.85
bcm_fb_resync_sysctlFunction · 0.85

Calls 5

memsetFunction · 0.85
bcm2835_mbox_fb_get_w_hFunction · 0.85
bcm2835_mbox_fb_get_bppFunction · 0.85
device_printfFunction · 0.85
bcm2835_mbox_fb_initFunction · 0.85

Tested by

no test coverage detected