Path: blob/main/sys/arm/broadcom/bcm2835/bcm2835_fb.c
39566 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2012 Oleksandr Tymoshenko <[email protected]>4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*27*/2829#include <sys/param.h>30#include <sys/systm.h>31#include <sys/bus.h>32#include <sys/consio.h>33#include <sys/fbio.h>34#include <sys/kdb.h>35#include <sys/kernel.h>36#include <sys/malloc.h>37#include <sys/module.h>3839#include <vm/vm.h>40#include <vm/pmap.h>4142#include <dev/fb/fbreg.h>43#include <dev/ofw/ofw_bus.h>44#include <dev/ofw/ofw_bus_subr.h>45#include <dev/syscons/syscons.h>4647#include <arm/broadcom/bcm2835/bcm2835_mbox_prop.h>4849#include "mbox_if.h"5051struct argb {52uint8_t a;53uint8_t r;54uint8_t g;55uint8_t b;56};5758static struct argb bcmfb_palette[16] = {59{0x00, 0x00, 0x00, 0x00},60{0x00, 0x00, 0x00, 0xaa},61{0x00, 0x00, 0xaa, 0x00},62{0x00, 0x00, 0xaa, 0xaa},63{0x00, 0xaa, 0x00, 0x00},64{0x00, 0xaa, 0x00, 0xaa},65{0x00, 0xaa, 0x55, 0x00},66{0x00, 0xaa, 0xaa, 0xaa},67{0x00, 0x55, 0x55, 0x55},68{0x00, 0x55, 0x55, 0xff},69{0x00, 0x55, 0xff, 0x55},70{0x00, 0x55, 0xff, 0xff},71{0x00, 0xff, 0x55, 0x55},72{0x00, 0xff, 0x55, 0xff},73{0x00, 0xff, 0xff, 0x55},74{0x00, 0xff, 0xff, 0xff}75};7677/* mouse pointer from dev/syscons/scgfbrndr.c */78static u_char mouse_pointer[16] = {790x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68,800x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x0081};8283#define BCMFB_FONT_HEIGHT 1684#define BCMFB_FONT_WIDTH 885#define FB_WIDTH 64086#define FB_HEIGHT 48087#define FB_DEPTH 248889struct bcmsc_softc {90/* Videoadpater part */91video_adapter_t va;9293intptr_t fb_addr;94intptr_t fb_paddr;95unsigned int fb_size;9697unsigned int height;98unsigned int width;99unsigned int depth;100unsigned int stride;101102unsigned int xmargin;103unsigned int ymargin;104105unsigned char *font;106int fbswap;107int initialized;108};109110static struct bcmsc_softc bcmsc;111112static struct ofw_compat_data compat_data[] = {113{"broadcom,bcm2835-fb", 1},114{"brcm,bcm2708-fb", 1},115{NULL, 0}116};117118static int bcm_fb_probe(device_t);119static int bcm_fb_attach(device_t);120static void bcmfb_update_margins(video_adapter_t *adp);121static int bcmfb_configure(int);122123static int124bcm_fb_probe(device_t dev)125{126int error;127128if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)129return (ENXIO);130131device_set_desc(dev, "BCM2835 framebuffer device");132error = sc_probe_unit(device_get_unit(dev),133device_get_flags(dev) | SC_AUTODETECT_KBD);134if (error != 0)135return (error);136137return (BUS_PROBE_DEFAULT);138}139140static int141bcm_fb_attach(device_t dev)142{143struct bcm2835_fb_config fb;144struct bcmsc_softc *sc;145146sc = (struct bcmsc_softc *)vid_get_adapter(vid_find_adapter(147"bcmfb", 0));148if (sc != NULL)149device_set_softc(dev, sc);150else151sc = device_get_softc(dev);152153memset(&fb, 0, sizeof(fb));154if (bcm2835_mbox_fb_get_w_h(&fb) != 0)155return (ENXIO);156fb.bpp = FB_DEPTH;157fb.vxres = fb.xres;158fb.vyres = fb.yres;159fb.xoffset = fb.yoffset = 0;160if (bcm2835_mbox_fb_init(&fb) != 0)161return (ENXIO);162163sc->fb_addr = (intptr_t)pmap_mapdev(fb.base, fb.size);164sc->fb_paddr = fb.base;165sc->fb_size = fb.size;166sc->depth = fb.bpp;167sc->stride = fb.pitch;168sc->width = fb.xres;169sc->height = fb.yres;170bcmfb_update_margins(&sc->va);171172if (sc_attach_unit(device_get_unit(dev),173device_get_flags(dev) | SC_AUTODETECT_KBD) != 0) {174device_printf(dev, "failed to attach syscons\n");175return (ENXIO);176}177178device_printf(dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", fb.xres, fb.yres,179fb.vxres, fb.vyres, fb.xoffset, fb.yoffset, fb.bpp);180device_printf(dev,181"fbswap: %d, pitch %d, base 0x%08x, screen_size %d\n",182sc->fbswap, fb.pitch, fb.base, fb.size);183184return (0);185}186187static device_method_t bcm_fb_methods[] = {188/* Device interface */189DEVMETHOD(device_probe, bcm_fb_probe),190DEVMETHOD(device_attach, bcm_fb_attach),191{ 0, 0 }192};193194static driver_t bcm_fb_driver = {195"fb",196bcm_fb_methods,197sizeof(struct bcmsc_softc),198};199200DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, 0, 0);201DRIVER_MODULE(bcm2835fb, simplebus, bcm_fb_driver, 0, 0);202203/*204* Video driver routines and glue.205*/206static vi_probe_t bcmfb_probe;207static vi_init_t bcmfb_init;208static vi_get_info_t bcmfb_get_info;209static vi_query_mode_t bcmfb_query_mode;210static vi_set_mode_t bcmfb_set_mode;211static vi_save_font_t bcmfb_save_font;212static vi_load_font_t bcmfb_load_font;213static vi_show_font_t bcmfb_show_font;214static vi_save_palette_t bcmfb_save_palette;215static vi_load_palette_t bcmfb_load_palette;216static vi_set_border_t bcmfb_set_border;217static vi_save_state_t bcmfb_save_state;218static vi_load_state_t bcmfb_load_state;219static vi_set_win_org_t bcmfb_set_win_org;220static vi_read_hw_cursor_t bcmfb_read_hw_cursor;221static vi_set_hw_cursor_t bcmfb_set_hw_cursor;222static vi_set_hw_cursor_shape_t bcmfb_set_hw_cursor_shape;223static vi_blank_display_t bcmfb_blank_display;224static vi_mmap_t bcmfb_mmap;225static vi_ioctl_t bcmfb_ioctl;226static vi_clear_t bcmfb_clear;227static vi_fill_rect_t bcmfb_fill_rect;228static vi_bitblt_t bcmfb_bitblt;229static vi_diag_t bcmfb_diag;230static vi_save_cursor_palette_t bcmfb_save_cursor_palette;231static vi_load_cursor_palette_t bcmfb_load_cursor_palette;232static vi_copy_t bcmfb_copy;233static vi_putp_t bcmfb_putp;234static vi_putc_t bcmfb_putc;235static vi_puts_t bcmfb_puts;236static vi_putm_t bcmfb_putm;237238static video_switch_t bcmfbvidsw = {239.probe = bcmfb_probe,240.init = bcmfb_init,241.get_info = bcmfb_get_info,242.query_mode = bcmfb_query_mode,243.set_mode = bcmfb_set_mode,244.save_font = bcmfb_save_font,245.load_font = bcmfb_load_font,246.show_font = bcmfb_show_font,247.save_palette = bcmfb_save_palette,248.load_palette = bcmfb_load_palette,249.set_border = bcmfb_set_border,250.save_state = bcmfb_save_state,251.load_state = bcmfb_load_state,252.set_win_org = bcmfb_set_win_org,253.read_hw_cursor = bcmfb_read_hw_cursor,254.set_hw_cursor = bcmfb_set_hw_cursor,255.set_hw_cursor_shape = bcmfb_set_hw_cursor_shape,256.blank_display = bcmfb_blank_display,257.mmap = bcmfb_mmap,258.ioctl = bcmfb_ioctl,259.clear = bcmfb_clear,260.fill_rect = bcmfb_fill_rect,261.bitblt = bcmfb_bitblt,262.diag = bcmfb_diag,263.save_cursor_palette = bcmfb_save_cursor_palette,264.load_cursor_palette = bcmfb_load_cursor_palette,265.copy = bcmfb_copy,266.putp = bcmfb_putp,267.putc = bcmfb_putc,268.puts = bcmfb_puts,269.putm = bcmfb_putm,270};271272VIDEO_DRIVER(bcmfb, bcmfbvidsw, bcmfb_configure);273274static vr_init_t bcmrend_init;275static vr_clear_t bcmrend_clear;276static vr_draw_border_t bcmrend_draw_border;277static vr_draw_t bcmrend_draw;278static vr_set_cursor_t bcmrend_set_cursor;279static vr_draw_cursor_t bcmrend_draw_cursor;280static vr_blink_cursor_t bcmrend_blink_cursor;281static vr_set_mouse_t bcmrend_set_mouse;282static vr_draw_mouse_t bcmrend_draw_mouse;283284/*285* We use our own renderer; this is because we must emulate a hardware286* cursor.287*/288static sc_rndr_sw_t bcmrend = {289bcmrend_init,290bcmrend_clear,291bcmrend_draw_border,292bcmrend_draw,293bcmrend_set_cursor,294bcmrend_draw_cursor,295bcmrend_blink_cursor,296bcmrend_set_mouse,297bcmrend_draw_mouse298};299300RENDERER(bcmfb, 0, bcmrend, gfb_set);301RENDERER_MODULE(bcmfb, gfb_set);302303static void304bcmrend_init(scr_stat* scp)305{306}307308static void309bcmrend_clear(scr_stat* scp, int c, int attr)310{311}312313static void314bcmrend_draw_border(scr_stat* scp, int color)315{316}317318static void319bcmrend_draw(scr_stat* scp, int from, int count, int flip)320{321video_adapter_t* adp = scp->sc->adp;322int i, c, a;323324if (!flip) {325/* Normal printing */326vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count);327} else {328/* This is for selections and such: invert the color attribute */329for (i = count; i-- > 0; ++from) {330c = sc_vtb_getc(&scp->vtb, from);331a = sc_vtb_geta(&scp->vtb, from) >> 8;332vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4));333}334}335}336337static void338bcmrend_set_cursor(scr_stat* scp, int base, int height, int blink)339{340}341342static void343bcmrend_draw_cursor(scr_stat* scp, int off, int blink, int on, int flip)344{345int bytes, col, i, j, row;346struct bcmsc_softc *sc;347uint8_t *addr;348video_adapter_t *adp;349350adp = scp->sc->adp;351sc = (struct bcmsc_softc *)adp;352353if (scp->curs_attr.height <= 0)354return;355356if (sc->fb_addr == 0)357return;358359if (off >= adp->va_info.vi_width * adp->va_info.vi_height)360return;361362/* calculate the coordinates in the video buffer */363row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight;364col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth;365366addr = (uint8_t *)sc->fb_addr367+ (row + sc->ymargin)*(sc->stride)368+ (sc->depth/8) * (col + sc->xmargin);369370bytes = sc->depth / 8;371/* our cursor consists of simply inverting the char under it */372for (i = 0; i < adp->va_info.vi_cheight; i++) {373for (j = 0; j < adp->va_info.vi_cwidth; j++) {374switch (sc->depth) {375case 32:376case 24:377addr[bytes*j + 2] ^= 0xff;378/* FALLTHROUGH */379case 16:380addr[bytes*j + 1] ^= 0xff;381addr[bytes*j] ^= 0xff;382break;383default:384break;385}386}387388addr += sc->stride;389}390}391392static void393bcmrend_blink_cursor(scr_stat* scp, int at, int flip)394{395}396397static void398bcmrend_set_mouse(scr_stat* scp)399{400}401402static void403bcmrend_draw_mouse(scr_stat* scp, int x, int y, int on)404{405vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8);406}407408static uint16_t bcmfb_static_window[ROW*COL];409extern u_char dflt_font_16[];410411/*412* Update videoadapter settings after changing resolution413*/414static void415bcmfb_update_margins(video_adapter_t *adp)416{417struct bcmsc_softc *sc;418video_info_t *vi;419420sc = (struct bcmsc_softc *)adp;421vi = &adp->va_info;422423sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2;424sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight)) / 2;425}426427static int428bcmfb_configure(int flags)429{430char bootargs[2048], *n, *p, *v;431pcell_t cell;432phandle_t chosen, display, root;433struct bcmsc_softc *sc;434435sc = &bcmsc;436if (sc->initialized)437return (0);438439sc->width = 0;440sc->height = 0;441442/*443* It seems there is no way to let syscons framework know444* that framebuffer resolution has changed. So just try445* to fetch data from FDT bootargs, FDT display data and446* finally go with defaults if everything else has failed.447*/448chosen = OF_finddevice("/chosen");449if (chosen != -1 &&450OF_getprop(chosen, "bootargs", &bootargs, sizeof(bootargs)) > 0) {451p = bootargs;452while ((v = strsep(&p, " ")) != NULL) {453if (*v == '\0')454continue;455n = strsep(&v, "=");456if (strcmp(n, "bcm2708_fb.fbwidth") == 0 && v != NULL)457sc->width = (unsigned int)strtol(v, NULL, 0);458else if (strcmp(n, "bcm2708_fb.fbheight") == 0 &&459v != NULL)460sc->height = (unsigned int)strtol(v, NULL, 0);461else if (strcmp(n, "bcm2708_fb.fbswap") == 0 &&462v != NULL)463if (*v == '1')464sc->fbswap = 1;465}466}467468root = OF_finddevice("/");469if ((root != -1) &&470(display = fdt_find_compatible(root, "broadcom,bcm2835-fb", 1))) {471if (sc->width == 0) {472if ((OF_getencprop(display, "broadcom,width",473&cell, sizeof(cell))) > 0)474sc->width = cell;475}476477if (sc->height == 0) {478if ((OF_getencprop(display, "broadcom,height",479&cell, sizeof(cell))) > 0)480sc->height = cell;481}482}483484if (sc->width == 0)485sc->width = FB_WIDTH;486if (sc->height == 0)487sc->height = FB_HEIGHT;488489bcmfb_init(0, &sc->va, 0);490sc->initialized = 1;491492return (0);493}494495static int496bcmfb_probe(int unit, video_adapter_t **adp, void *arg, int flags)497{498499return (0);500}501502static int503bcmfb_init(int unit, video_adapter_t *adp, int flags)504{505struct bcmsc_softc *sc;506video_info_t *vi;507508sc = (struct bcmsc_softc *)adp;509vi = &adp->va_info;510511vid_init_struct(adp, "bcmfb", -1, unit);512513sc->font = dflt_font_16;514vi->vi_cheight = BCMFB_FONT_HEIGHT;515vi->vi_cwidth = BCMFB_FONT_WIDTH;516vi->vi_width = sc->width / vi->vi_cwidth;517vi->vi_height = sc->height / vi->vi_cheight;518519/*520* Clamp width/height to syscons maximums521*/522if (vi->vi_width > COL)523vi->vi_width = COL;524if (vi->vi_height > ROW)525vi->vi_height = ROW;526527sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2;528sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight)) / 2;529530adp->va_window = (vm_offset_t) bcmfb_static_window;531adp->va_flags |= V_ADP_FONT /* | V_ADP_COLOR | V_ADP_MODECHANGE */;532533vid_register(&sc->va);534535return (0);536}537538static int539bcmfb_get_info(video_adapter_t *adp, int mode, video_info_t *info)540{541bcopy(&adp->va_info, info, sizeof(*info));542return (0);543}544545static int546bcmfb_query_mode(video_adapter_t *adp, video_info_t *info)547{548return (0);549}550551static int552bcmfb_set_mode(video_adapter_t *adp, int mode)553{554return (0);555}556557static int558bcmfb_save_font(video_adapter_t *adp, int page, int size, int width,559u_char *data, int c, int count)560{561return (0);562}563564static int565bcmfb_load_font(video_adapter_t *adp, int page, int size, int width,566u_char *data, int c, int count)567{568struct bcmsc_softc *sc;569570sc = (struct bcmsc_softc *)adp;571sc->font = data;572573return (0);574}575576static int577bcmfb_show_font(video_adapter_t *adp, int page)578{579return (0);580}581582static int583bcmfb_save_palette(video_adapter_t *adp, u_char *palette)584{585return (0);586}587588static int589bcmfb_load_palette(video_adapter_t *adp, u_char *palette)590{591return (0);592}593594static int595bcmfb_set_border(video_adapter_t *adp, int border)596{597return (bcmfb_blank_display(adp, border));598}599600static int601bcmfb_save_state(video_adapter_t *adp, void *p, size_t size)602{603return (0);604}605606static int607bcmfb_load_state(video_adapter_t *adp, void *p)608{609return (0);610}611612static int613bcmfb_set_win_org(video_adapter_t *adp, off_t offset)614{615return (0);616}617618static int619bcmfb_read_hw_cursor(video_adapter_t *adp, int *col, int *row)620{621*col = *row = 0;622623return (0);624}625626static int627bcmfb_set_hw_cursor(video_adapter_t *adp, int col, int row)628{629return (0);630}631632static int633bcmfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,634int celsize, int blink)635{636return (0);637}638639static int640bcmfb_blank_display(video_adapter_t *adp, int mode)641{642643struct bcmsc_softc *sc;644645sc = (struct bcmsc_softc *)adp;646if (sc && sc->fb_addr)647memset((void*)sc->fb_addr, 0, sc->fb_size);648649return (0);650}651652static int653bcmfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,654int prot, vm_memattr_t *memattr)655{656struct bcmsc_softc *sc;657658sc = (struct bcmsc_softc *)adp;659660/*661* This might be a legacy VGA mem request: if so, just point it at the662* framebuffer, since it shouldn't be touched663*/664if (offset < sc->stride*sc->height) {665*paddr = sc->fb_paddr + offset;666return (0);667}668669return (EINVAL);670}671672static int673bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data)674{675struct bcmsc_softc *sc;676struct fbtype *fb;677678sc = (struct bcmsc_softc *)adp;679680switch (cmd) {681case FBIOGTYPE:682fb = (struct fbtype *)data;683fb->fb_type = FBTYPE_PCIMISC;684fb->fb_height = sc->height;685fb->fb_width = sc->width;686fb->fb_depth = sc->depth;687if (sc->depth <= 1 || sc->depth > 8)688fb->fb_cmsize = 0;689else690fb->fb_cmsize = 1 << sc->depth;691fb->fb_size = sc->fb_size;692break;693default:694return (fb_commonioctl(adp, cmd, data));695}696697return (0);698}699700static int701bcmfb_clear(video_adapter_t *adp)702{703704return (bcmfb_blank_display(adp, 0));705}706707static int708bcmfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy)709{710711return (0);712}713714static int715bcmfb_bitblt(video_adapter_t *adp, ...)716{717718return (0);719}720721static int722bcmfb_diag(video_adapter_t *adp, int level)723{724725return (0);726}727728static int729bcmfb_save_cursor_palette(video_adapter_t *adp, u_char *palette)730{731732return (0);733}734735static int736bcmfb_load_cursor_palette(video_adapter_t *adp, u_char *palette)737{738739return (0);740}741742static int743bcmfb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n)744{745746return (0);747}748749static int750bcmfb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a,751int size, int bpp, int bit_ltor, int byte_ltor)752{753754return (0);755}756757static int758bcmfb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a)759{760int bytes, col, i, j, k, row;761struct bcmsc_softc *sc;762u_char *p;763uint8_t *addr, fg, bg, color;764uint16_t rgb;765766sc = (struct bcmsc_softc *)adp;767768if (sc->fb_addr == 0)769return (0);770771row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight;772col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth;773p = sc->font + c*BCMFB_FONT_HEIGHT;774addr = (uint8_t *)sc->fb_addr775+ (row + sc->ymargin)*(sc->stride)776+ (sc->depth/8) * (col + sc->xmargin);777778fg = a & 0xf ;779bg = (a >> 4) & 0xf;780781bytes = sc->depth / 8;782for (i = 0; i < BCMFB_FONT_HEIGHT; i++) {783for (j = 0, k = 7; j < 8; j++, k--) {784if ((p[i] & (1 << k)) == 0)785color = bg;786else787color = fg;788789switch (sc->depth) {790case 32:791case 24:792if (sc->fbswap) {793addr[bytes * j + 0] =794bcmfb_palette[color].b;795addr[bytes * j + 1] =796bcmfb_palette[color].g;797addr[bytes * j + 2] =798bcmfb_palette[color].r;799} else {800addr[bytes * j + 0] =801bcmfb_palette[color].r;802addr[bytes * j + 1] =803bcmfb_palette[color].g;804addr[bytes * j + 2] =805bcmfb_palette[color].b;806}807if (sc->depth == 32)808addr[bytes * j + 3] =809bcmfb_palette[color].a;810break;811case 16:812rgb = (bcmfb_palette[color].r >> 3) << 11;813rgb |= (bcmfb_palette[color].g >> 2) << 5;814rgb |= (bcmfb_palette[color].b >> 3);815addr[bytes * j] = rgb & 0xff;816addr[bytes * j + 1] = (rgb >> 8) & 0xff;817default:818/* Not supported yet */819break;820}821}822823addr += (sc->stride);824}825826return (0);827}828829static int830bcmfb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len)831{832int i;833834for (i = 0; i < len; i++)835bcmfb_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8);836837return (0);838}839840static int841bcmfb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image,842uint32_t pixel_mask, int size, int width)843{844845return (0);846}847848849