diff options
author | marcel <marcel@FreeBSD.org> | 2015-08-18 00:47:02 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2015-08-18 00:47:02 +0000 |
commit | c1348ba867375122372c3e873c5cc7d4eea3209d (patch) | |
tree | 9cdfeb58481bacfdf431386495c4e3c420099413 /sys | |
parent | cbb776d46e1d7066efdee506c6096c75fb20f96e (diff) | |
download | FreeBSD-src-c1348ba867375122372c3e873c5cc7d4eea3209d.zip FreeBSD-src-c1348ba867375122372c3e873c5cc7d4eea3209d.tar.gz |
Support frame buffers that are larger than the default screen
size as defined by VT_FB_DEFAULT_WIDTH and VT_FB_DEFAULT_HEIGHT
(at this time 2048x1200). The default is really a max. We cap
the height and width to those defaults and position the screen
in the center of the frame buffer.
Ideally we use a bigger font to utility the entire real estate
that is the frame buffer, but that's seen as an improvement over
making it work first.
PR: 193745
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/vt/hw/fb/vt_fb.c | 10 | ||||
-rw-r--r-- | sys/dev/vt/vt.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c index c8b221f..86a2202 100644 --- a/sys/dev/vt/hw/fb/vt_fb.c +++ b/sys/dev/vt/hw/fb/vt_fb.c @@ -294,6 +294,7 @@ vt_fb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw, if (mask != NULL && (mask[byte] & bit) == 0) continue; o = (y + yi) * info->fb_stride + (x + xi) * bpp; + o += vd->vd_transpose; cc = pattern[byte] & bit ? fgc : bgc; switch(bpp) { @@ -411,11 +412,16 @@ int vt_fb_init(struct vt_device *vd) { struct fb_info *info; + u_int margin; int err; info = vd->vd_softc; - vd->vd_height = info->fb_height; - vd->vd_width = info->fb_width; + vd->vd_height = MIN(VT_FB_DEFAULT_HEIGHT, info->fb_height); + margin = (info->fb_height - vd->vd_height) >> 1; + vd->vd_transpose = margin * info->fb_stride; + vd->vd_width = MIN(VT_FB_DEFAULT_WIDTH, info->fb_width); + margin = (info->fb_width - vd->vd_width) >> 1; + vd->vd_transpose += margin * (info->fb_bpp / NBBY); vd->vd_video_dev = info->fb_video_dev; if (info->fb_size == 0) diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h index 1aa7b10..78d3d7d 100644 --- a/sys/dev/vt/vt.h +++ b/sys/dev/vt/vt.h @@ -140,6 +140,7 @@ struct vt_device { uint32_t vd_mstate; /* (?) Mouse state. */ vt_axis_t vd_width; /* (?) Screen width. */ vt_axis_t vd_height; /* (?) Screen height. */ + size_t vd_transpose; /* (?) Screen offset in FB */ struct mtx vd_lock; /* Per-device lock. */ struct cv vd_winswitch; /* (d) Window switch notify. */ struct callout vd_timer; /* (d) Display timer. */ |