aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fb
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2015-03-07 20:45:15 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2015-03-07 20:45:15 +0000
commita985ae9b4a05933af71c028be1a9c117aa3bbd25 (patch)
tree3494d27d8f8adf927d562c71f1dadb9f9c493212 /sys/dev/fb
parentc3e2821f5f0b077f07dc70f8e445caf0d82b93ce (diff)
downloadsrc-a985ae9b4a05933af71c028be1a9c117aa3bbd25.tar.gz
src-a985ae9b4a05933af71c028be1a9c117aa3bbd25.zip
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.
Notes
Notes: svn path=/head/; revision=279752
Diffstat (limited to 'sys/dev/fb')
-rw-r--r--sys/dev/fb/fbd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/fb/fbd.c b/sys/dev/fb/fbd.c
index 6b7b7316bf57..b7e45040f65e 100644
--- a/sys/dev/fb/fbd.c
+++ b/sys/dev/fb/fbd.c
@@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$");
#include <dev/vt/vt.h>
#include <dev/vt/hw/fb/vt_fb.h>
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
#include "fb_if.h"
LIST_HEAD(fb_list_head_t, fb_list_entry) fb_list_head =
@@ -167,11 +170,14 @@ fb_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot,
info = dev->si_drv1;
- if ((info->fb_flags & FB_FLAG_NOMMAP) || info->fb_pbase == 0)
+ if (info->fb_flags & FB_FLAG_NOMMAP)
return (ENODEV);
- if (offset < info->fb_size) {
- *paddr = info->fb_pbase + offset;
+ if (offset >= 0 && offset < info->fb_size) {
+ if (info->fb_pbase == 0)
+ *paddr = vtophys((uint8_t *)info->fb_vbase + offset);
+ else
+ *paddr = info->fb_pbase + offset;
return (0);
}
return (EINVAL);
@@ -356,5 +362,6 @@ devclass_t fbd_devclass;
DRIVER_MODULE(fbd, fb, fbd_driver, fbd_devclass, 0, 0);
DRIVER_MODULE(fbd, drmn, fbd_driver, fbd_devclass, 0, 0);
+DRIVER_MODULE(fbd, udl, fbd_driver, fbd_devclass, 0, 0);
MODULE_VERSION(fbd, 1);