オープンソース開発と、あるフレームバッファコンソールの話~名古屋応用編~
- 17. AlphaのX?
/src/share/mk/bsd.own.mk
#
# Do we default to XFree86 or Xorg for this platform?
#
.if
${MACHINE} == "acorn32" ||
${MACHINE} == "alpha" ||
${MACHINE} == "amiga" ||
${MACHINE} == "mac68k" ||
${MACHINE} == "pmax" ||
${MACHINE} == "sun3"
X11FLAVOUR?= XFree86
.else
X11FLAVOUR?= Xorg
.endif
NetBSD/luna68Kですら、Xorgなのに...
NetBSD/AlphaはXFree86…
- 18. AlphaのX?
# startx
auth: creating new authority file /root/.Xauthority
xauth: (argv):1: bad display name ":0" in "list" command
xauth: creating new authority file /root/.Xauthority
xauth: (stdin):1: bad display name ":0" in "add" command
xauth: creating new authority file /root/.Xauthority
xauth: (argv):1: bad display name ":0" in "list" command
xauth: creating new authority file /root/.Xauthority
xauth: (stdin):1: bad display name ":0" in "add" command
unable to get frame buffer info: Inappropriate ioctl for device
Fatal server error:
no screens found
X connection to :0.0 broken (explicit kill or server shutdown).
xauth: creating new authority file /root/.Xauthority
xauth: (argv):1: bad display name ":0" in "remove" command
xauth: (argv):1: bad display name ":0" in "remove" command
# ls -l X
lrwxr-xr-x 1 root wheel 25 May 16 2015 X -> /usr/X11R6/bin/XdecNetBSD
- 25. Appian Graphics
/*
* Copyright 2000-2001 by Sven Luther <luther (at) dpt-info.u-strasbg.fr>.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Sven Luther not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Sven Luther makes no representations
* about the suitability of this software for any purpose. It is provided
* "as is" without express or implied warranty.
*
* SVEN LUTHER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL SVEN LUTHER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Sven Luther, <luther (at) dpt-info.u-strasbg.fr>
* Alan Hourihane, <alanh (at) fairlite.demon.co.uk>
*
* this work is sponsored by Appian Graphics.
*
* Permedia 3 accelerated options.
*/
/xfree/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c
XのPermedia3ドライバのスポンサー!
- 27. 何故表示が崩れるのか?
/*
* Some Power Mac G4 model could not initialize these registers,
* Power Mac G4 (Mirrored Drive Doors), for example
*/
#if defined(__powerpc__)
bus_space_write_4(sc->sc_memt, sc->sc_regh, PM3_LOCALMEMCAPS,
0x02e311B8);
bus_space_write_4(sc->sc_memt, sc->sc_regh, PM3_LOCALMEMTIMINGS,
0x07424905);
bus_space_write_4(sc->sc_memt, sc->sc_regh, PM3_LOCALMEMCONTROL,
0x0c000003);
#endif
My Power Mac G4 Mirrored Drive Doors could not initialize these registers.
(Display gets corrupted.)
レジスタを規定値で初期化したらうまくいきました!
- 28. 64MBの罠
/*
* Permedia 3 always return 64MB fbsize
* 16 MB should be enough -- more just wastes map entries
*/
if (sc->sc_fbsize != 0)
sc->sc_fbsize = (16 << 20);
Permedia 3 always return 64MB frame buffer size.
The minimum frame buffer size is 16MB in Permedia 3 product lines.
I don't write frame buffer size check routine.
I think that's enough.
グラフィックメモリの容量を聞くと、
実際は16MBだったり、32MBだったりしても、
常に64MBと返してくる…
そこで製品ラインナップ最低の16MBを設定してみる
- 30. static void pm3fb_cfbX_putc(struct vc_data *conp, struct display *p,
int c, int yy, int xx)
PM3_WRITE_REG(PM3AreaStippleMode, (o_x << 7) | (o_y << 12) | /* x_offset, y_offset in pattern */
(1 << 18) | /* BE */
1 | (asx << 1) | (asy << 4) | /* address select x/y */
(1 << 20)); /* OpaqueSpan */
if (fontwidth(p) <= 8) {
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
} else {
cdat =
p->fontdata +
((c & p->charmask) * (fontheight(p) << 1));
}
PM3_WAIT(2 + fontheight(p));
for (i = 0; i < fontheight(p); i++) { /* assume fontheight <= 32 */
if (fontwidth(p) <= 8) {
ldat = *cdat++;
} else { /* assume fontwidth <= 16 ATM */
ldat = ((*cdat++) << 8);
ldat |= *cdat++;
}
PM3_WRITE_REG(AreaStipplePattern_indexed(i), ldat);
}
フォント?
linux/drivers/video/pm3fb.c
Linuxでは
AreaStippleModeで描画
- 31. フォント?
static void
pm3fb_putchar(void *cookie, int row, int col, u_int c, long attr)
bus_space_write_4(sc->sc_memt, sc->sc_regh, PM3_RASTERIZER_MODE, mode);
…
bus_space_write_4(sc->sc_memt, sc->sc_regh,
PM3_SCISSORMINXY, ((y & 0x0fff) << 16) | (x & 0x0fff));
bus_space_write_4(sc->sc_memt, sc->sc_regh,
PM3_SCISSORMAXXY, (((y + he) & 0x0fff) << 16) | ((x + wi) & 0x0fff));
bus_space_write_4(sc->sc_memt, sc->sc_regh,
PM3_RECTANGLEPOSITION, (((y) & 0xffff)<<16) | ((x) & 0xffff));
…
pm3fb_wait(sc, he);
switch (ri->ri_font->stride) {
case 1: {
uint8_t *data8 = data;
uint32_t reg;
for (i = 0; i < he; i++) {
reg = *data8;
bus_space_write_4(sc->sc_memt,
sc->sc_regh,
PM3_BITMASKPATTERN, reg);
data8++;
}
break;
}
NetBSDでは
RASTERIZER_MODEで描画
- 37. The NetBSD source code style guide.
/src/share/misc/style
OpenBSDにもあるそうです!
(青山さん談)
- 38. manの書き方
.Dd January 1, 2015
.Dt PM3FB 4
.Os
.Sh NAME
.Nm pm3fb
.Nd 3Dlabs Permedia 3 / Oxygen VX1 / Proformance 3 framebuffer driver
.Sh SYNOPSIS
.Cd "pm3fb* at pci?"
.Cd "wsdisplay* at pm3fb?"
.Sh DESCRIPTION
The
.Nm
driver provides support for the 3Dlabs Permedia 3 / Oxygen VX1 / Proformance 3 series of
graphics cards and provides an interface for machine independent
.Xr wscons 4
driver.
.Pp
Currently
コピって作っていたが直感的でない…
ちょっと書いてbuild.sh -releaseで確認
効率が悪い
- 40. manの書き方
PM3FB(4) Kernel Interfaces Manual PM3FB(4)
NAME
pm3fb -- 3Dlabs Permedia 3 / Oxygen VX1 / Proformance 3 framebuffer
driver
SYNOPSIS
pm3fb* at pci?
wsdisplay* at pm3fb?
DESCRIPTION
The pm3fb driver provides support for the 3Dlabs Permedia 3 / Oxygen VX1
/ Proformance 3 series of graphics cards and provides an interface for
machine independent wscons(4) driver.
Currently pm3fb does not support Anti-alias font rendering and OpenLDI
video interface. However, it is capable of changing the resolution and
uses DDC2 to pick an appropriate video mode.
A 2D graphics engine is used to accelerate scrolling, rectangle fills and
Bitmap font rendering.
SEE ALSO
pci(4), wscons(4), wsdisplay(4)