diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-03-07 20:45:15 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-03-07 20:45:15 +0000 |
commit | 786e5032a73a886a2304bf0adacc7d6da80954a4 (patch) | |
tree | 3494d27d8f8adf927d562c71f1dadb9f9c493212 /sys/dev/vt | |
parent | ac9d1569a38a2eee2a36d31b4274cd08240140dd (diff) | |
download | FreeBSD-src-786e5032a73a886a2304bf0adacc7d6da80954a4.zip FreeBSD-src-786e5032a73a886a2304bf0adacc7d6da80954a4.tar.gz |
Add support for USB display link adapters to the FB and VT drivers.
The vtophys() function is used to get the physical page address for
the virtually allocated frame buffers when a physically continuous
memory area is not available. This change also allows removing the
masking of the FB_FLAG_NOMMAP flag in the PS3 syscons driver.
The FB and VT drivers were tested using X.org/xf86-video-scfb and
syscons.
Diffstat (limited to 'sys/dev/vt')
-rw-r--r-- | sys/dev/vt/hw/fb/vt_fb.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c index 5d38cc7..40f56fc 100644 --- a/sys/dev/vt/hw/fb/vt_fb.c +++ b/sys/dev/vt/hw/fb/vt_fb.c @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include <dev/vt/hw/fb/vt_fb.h> #include <dev/vt/colors/vt_termcolors.h> +#include <vm/vm.h> +#include <vm/pmap.h> + static struct vt_driver vt_fb_driver = { .vd_name = "fb", .vd_init = vt_fb_init, @@ -136,10 +139,14 @@ vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, return (ENODEV); if (offset >= 0 && offset < info->fb_size) { - *paddr = info->fb_pbase + offset; - #ifdef VM_MEMATTR_WRITE_COMBINING - *memattr = VM_MEMATTR_WRITE_COMBINING; - #endif + if (info->fb_pbase == 0) { + *paddr = vtophys((uint8_t *)info->fb_vbase + offset); + } else { + *paddr = info->fb_pbase + offset; +#ifdef VM_MEMATTR_WRITE_COMBINING + *memattr = VM_MEMATTR_WRITE_COMBINING; +#endif + } return (0); } @@ -425,7 +432,7 @@ vt_fb_init(struct vt_device *vd) if (info->fb_size == 0) return (CN_DEAD); - if (info->fb_pbase == 0) + if (info->fb_pbase == 0 && info->fb_vbase == 0) info->fb_flags |= FB_FLAG_NOMMAP; if (info->fb_cmsize <= 0) { |