some trivial fixes:

- rearrange dmesg output so all values are printed properly
- use aprint_*
- support WSDISPLAYIO_GET_FBINFO
This commit is contained in:
macallan 2016-01-13 15:56:05 +00:00
parent f99039090a
commit 9d1a225520
1 changed files with 12 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: voyagerfb.c,v 1.27 2014/03/11 08:19:45 mrg Exp $ */ /* $NetBSD: voyagerfb.c,v 1.28 2016/01/13 15:56:05 macallan Exp $ */
/* /*
* Copyright (c) 2009, 2011 Michael Lorenz * Copyright (c) 2009, 2011 Michael Lorenz
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.27 2014/03/11 08:19:45 mrg Exp $"); __KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.28 2016/01/13 15:56:05 macallan Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -269,19 +269,19 @@ voyagerfb_attach(device_t parent, device_t self, void *aux)
sc->sc_depth = 8; sc->sc_depth = 8;
#endif #endif
printf("%s: %d x %d, %d bit, stride %d\n", device_xname(self),
sc->sc_width, sc->sc_height, sc->sc_depth, sc->sc_stride);
/* /*
* XXX yeah, casting the fb address to uint32_t is formally wrong * XXX yeah, casting the fb address to uint32_t is formally wrong
* but as far as I know there are no SM502 with 64bit BARs * but as far as I know there are no SM502 with 64bit BARs
*/ */
aprint_normal("%s: %d MB video memory at 0x%08x\n", device_xname(self), aprint_normal_dev(self, "%d MB video memory at 0x%08x\n",
(int)(sc->sc_fbsize >> 20), (uint32_t)sc->sc_fb); (int)(sc->sc_fbsize >> 20), (uint32_t)sc->sc_fb);
/* init engine here */ /* init engine here */
voyagerfb_init(sc); voyagerfb_init(sc);
aprint_normal_dev(self, "%d x %d, %d bit, stride %d\n",
sc->sc_width, sc->sc_height, sc->sc_depth, sc->sc_stride);
sc->sc_defaultscreen_descr = (struct wsscreen_descr){ sc->sc_defaultscreen_descr = (struct wsscreen_descr){
"default", "default",
0, 0, 0, 0,
@ -515,6 +515,12 @@ voyagerfb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
cu = (struct wsdisplay_cursor *)data; cu = (struct wsdisplay_cursor *)data;
return voyagerfb_scursor(sc, cu); return voyagerfb_scursor(sc, cu);
} }
case WSDISPLAYIO_GET_FBINFO:
{
struct wsdisplayio_fbinfo *fbi = data;
return wsdisplayio_get_fbinfo(&ms->scr_ri, fbi);
}
} }
return EPASSTHROUGH; return EPASSTHROUGH;
} }