Skip to content

Commit

Permalink
Merge pull request #46 from rokuyama/master
Browse files Browse the repository at this point in the history
Add support for 8- and 4-bpp planar fb found on NetBSD/amiga.
  • Loading branch information
arakiken authored Jul 9, 2022
2 parents bdb1cf5 + bd9f94b commit 036bee4
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions uitoolkit/fb/ui_display_wscons.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,17 @@ static int open_display(u_int depth /* used on luna68k alone. */
_display.height = _disp.height = vinfo.height;
_disp.depth = vinfo.depth;

#ifdef WSDISPLAY_TYPE_LUNA
if (wstype == WSDISPLAY_TYPE_LUNA) {
#if defined(WSDISPLAY_TYPE_LUNA) && defined(WSDISPLAY_TYPE_AMIGACC)
#define WSTYPE_PLANAR(wstype) \
((wstype) == WSDISPLAY_TYPE_LUNA || (wstype) == WSDISPLAY_TYPE_AMIGACC)
#elif defined(WSDISPLAY_TYPE_LUNA)
#define WSTYPE_PLANAR(wstype) ((wstype) == WSDISPLAY_TYPE_LUNA)
#elif defined(WSDISPLAY_TYPE_AMIGACC)
#define WSTYPE_PLANAR(wstype) ((wstype) == WSDISPLAY_TYPE_AMIGACC)
#endif

#ifdef WSTYPE_PLANAR
if (WSTYPE_PLANAR(wstype)) {
/* always 8 or less bpp */

if (_disp.depth > 8) {
Expand Down Expand Up @@ -443,6 +452,19 @@ static int open_display(u_int depth /* used on luna68k alone. */
_display.plane_offset[plane] = 0x40000 * plane;
}
} else
#endif
#ifdef WSDISPLAY_TYPE_AMIGACC
if (wstype == WSDISPLAY_TYPE_AMIGACC &&
(_disp.depth == 4 || _disp.depth == 8)) {
u_int len_per_plane, plane;

len_per_plane = _display.line_length * _display.height;
_display.smem_len = fboffset + len_per_plane * _disp.depth;

for (plane = 0; plane < _disp.depth; plane++) {
_display.plane_offset[plane] = len_per_plane * plane;
}
} else
#endif
{
_display.smem_len = fboffset + _display.line_length * _display.height;
Expand Down

0 comments on commit 036bee4

Please sign in to comment.