| 76 | static int bcm_fb_attach(device_t); |
| 77 | |
| 78 | static int |
| 79 | bcm_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 | |
| 111 | static int |
| 112 | bcm_fb_setup_fbd(struct bcmsc_softc *sc) |
no test coverage detected