aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fb
diff options
context:
space:
mode:
authorMaxime Henrion <mux@FreeBSD.org>2003-02-25 03:21:22 +0000
committerMaxime Henrion <mux@FreeBSD.org>2003-02-25 03:21:22 +0000
commit07159f9c56de91cb7d7bd6b6a795eebfee78133e (patch)
treea4ad6d456fdd984cdf9c6c6abd5e4654a9b7e3e0 /sys/dev/fb
parentedf02ff15d952524ebf102c65a7b23e716259fe5 (diff)
Notes
Diffstat (limited to 'sys/dev/fb')
-rw-r--r--sys/dev/fb/fb.c8
-rw-r--r--sys/dev/fb/fbreg.h5
-rw-r--r--sys/dev/fb/gfb.c16
-rw-r--r--sys/dev/fb/s3_pci.c5
-rw-r--r--sys/dev/fb/vga.c19
-rw-r--r--sys/dev/fb/vgareg.h2
6 files changed, 23 insertions, 32 deletions
diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c
index 0dbb73bac830..6f8bab775f0a 100644
--- a/sys/dev/fb/fb.c
+++ b/sys/dev/fb/fb.c
@@ -501,7 +501,7 @@ fbioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
}
static int
-fbmmap(dev_t dev, vm_offset_t offset, int nprot)
+fbmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
{
int unit;
@@ -509,7 +509,7 @@ fbmmap(dev_t dev, vm_offset_t offset, int nprot)
if (vidcdevsw[unit] == NULL)
return ENXIO;
return (*vidcdevsw[unit]->d_mmap)(makedev(0, adapter[unit]->va_minor),
- offset, nprot);
+ offset, paddr, nprot);
}
#if experimental
@@ -591,9 +591,9 @@ int genfbioctl(genfb_softc_t *sc, video_adapter_t *adp, u_long cmd,
}
int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_offset_t offset,
- int prot)
+ vm_offset_t *paddr, int prot)
{
- return (*vidsw[adp->va_index]->mmap)(adp, offset, prot);
+ return (*vidsw[adp->va_index]->mmap)(adp, offset, paddr, prot);
}
#endif /* FB_INSTALL_CDEV */
diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h
index d55679134e68..ce9869ec639a 100644
--- a/sys/dev/fb/fbreg.h
+++ b/sys/dev/fb/fbreg.h
@@ -81,7 +81,8 @@ typedef int vi_blank_display_t(video_adapter_t *adp, int mode);
#define V_DISPLAY_STAND_BY 2
#define V_DISPLAY_SUSPEND 3
*/
-typedef int vi_mmap_t(video_adapter_t *adp, vm_offset_t offset, int prot);
+typedef int vi_mmap_t(video_adapter_t *adp, vm_offset_t offset,
+ vm_offset_t *paddr, int prot);
typedef int vi_ioctl_t(video_adapter_t *adp, u_long cmd, caddr_t data);
typedef int vi_clear_t(video_adapter_t *adp);
typedef int vi_fill_rect_t(video_adapter_t *adp, int val, int x, int y,
@@ -212,7 +213,7 @@ int genfbwrite(genfb_softc_t *sc, video_adapter_t *adp,
int genfbioctl(genfb_softc_t *sc, video_adapter_t *adp,
u_long cmd, caddr_t arg, int flag, struct thread *td);
int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp,
- vm_offset_t offset, int prot);
+ vm_offset_t offset, vm_offset_t *paddr, int prot);
#endif /* FB_INSTALL_CDEV */
diff --git a/sys/dev/fb/gfb.c b/sys/dev/fb/gfb.c
index fcb8aedb04c9..4e031692ee29 100644
--- a/sys/dev/fb/gfb.c
+++ b/sys/dev/fb/gfb.c
@@ -451,20 +451,14 @@ gfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
}
int
-gfb_mmap(video_adapter_t *adp, vm_offset_t offset, int prot)
+gfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr, int prot)
{
- int error;
+ /* XXX */
if(offset > adp->va_window_size - PAGE_SIZE)
- error = ENXIO;
-#ifdef __i386__
- error = i386_btop(adp->va_info.vi_window + offset);
-#elsif defined(__alpha__)
- error = alpha_btop(adp->va_info.vi_window + offset);
-#else
- error = ENXIO;
-#endif
- return(error);
+ return(ENXIO);
+ *paddr = adp->va_info.vi_window + offset;
+ return(0);
}
int
diff --git a/sys/dev/fb/s3_pci.c b/sys/dev/fb/s3_pci.c
index c7a1be8506af..69549db99adf 100644
--- a/sys/dev/fb/s3_pci.c
+++ b/sys/dev/fb/s3_pci.c
@@ -389,9 +389,10 @@ s3lfb_blank_display(video_adapter_t *adp, int mode)
}
static int
-s3lfb_mmap(video_adapter_t *adp, vm_offset_t offset, int prot)
+s3lfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr,
+ int prot)
{
- return (*prevvidsw->mmap)(adp, offset, prot);
+ return (*prevvidsw->mmap)(adp, offset, paddr, prot);
}
static int
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c
index 56e015ba1399..562f71611e47 100644
--- a/sys/dev/fb/vga.c
+++ b/sys/dev/fb/vga.c
@@ -133,9 +133,10 @@ vga_ioctl(dev_t dev, vga_softc_t *sc, u_long cmd, caddr_t arg, int flag,
}
int
-vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset, int prot)
+vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset, vm_offset_t *paddr,
+ int prot)
{
- return genfbmmap(&sc->gensc, sc->adp, offset, prot);
+ return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot);
}
#endif /* FB_INSTALL_CDEV */
@@ -2449,7 +2450,8 @@ vga_blank_display(video_adapter_t *adp, int mode)
* all adapters
*/
static int
-vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, int prot)
+vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr,
+ int prot)
{
if (adp->va_info.vi_flags & V_INFO_LINEAR)
return -1;
@@ -2463,15 +2465,8 @@ vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, int prot)
if (offset > adp->va_window_size - PAGE_SIZE)
return -1;
-#ifdef __i386__
- return i386_btop(adp->va_info.vi_window + offset);
-#endif
-#ifdef __alpha__
- return alpha_btop(adp->va_info.vi_window + offset);
-#endif
-#ifdef __ia64__
- return ia64_btop(adp->va_info.vi_window + offset);
-#endif
+ *paddr = adp->va_info.vi_window + offset;
+ return 0;
}
#ifndef VGA_NO_MODE_CHANGE
diff --git a/sys/dev/fb/vgareg.h b/sys/dev/fb/vgareg.h
index f59c7ee751a4..f3903182a59f 100644
--- a/sys/dev/fb/vgareg.h
+++ b/sys/dev/fb/vgareg.h
@@ -87,7 +87,7 @@ int vga_write(dev_t dev, vga_softc_t *sc, struct uio *uio, int flag);
int vga_ioctl(dev_t dev, vga_softc_t *sc, u_long cmd, caddr_t arg,
int flag, struct thread *td);
int vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset,
- int prot);
+ vm_offset_t *paddr, int prot);
#endif
extern int (*vga_sub_configure)(int flags);