Commit bfbf3c85 authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie

drm: move drm_mmap to <drm/drm_legacy.h>

Now that we've removed the copypasted users in gem/ttm we can
relegate the legacy buffer mapping support to where it belongs.
Also give it the proper drm_legacy_ prefix.

While at it statify drm_mmap_locked, somehow I've missed that in my
previous header rework.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 197633b9
...@@ -37,7 +37,6 @@ int drm_irq_by_busid(struct drm_device *dev, void *data, ...@@ -37,7 +37,6 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
/* drm_vm.c */ /* drm_vm.c */
int drm_vma_info(struct seq_file *m, void *data); int drm_vma_info(struct seq_file *m, void *data);
int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma); void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma);
/* drm_prime.c */ /* drm_prime.c */
......
...@@ -537,7 +537,7 @@ static resource_size_t drm_core_get_reg_ofs(struct drm_device *dev) ...@@ -537,7 +537,7 @@ static resource_size_t drm_core_get_reg_ofs(struct drm_device *dev)
* according to the mapping type and remaps the pages. Finally sets the file * according to the mapping type and remaps the pages. Finally sets the file
* pointer and calls vm_open(). * pointer and calls vm_open().
*/ */
int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
{ {
struct drm_file *priv = filp->private_data; struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->minor->dev; struct drm_device *dev = priv->minor->dev;
...@@ -651,7 +651,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) ...@@ -651,7 +651,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
return 0; return 0;
} }
int drm_mmap(struct file *filp, struct vm_area_struct *vma) int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma)
{ {
struct drm_file *priv = filp->private_data; struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->minor->dev; struct drm_device *dev = priv->minor->dev;
...@@ -666,7 +666,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -666,7 +666,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
return ret; return ret;
} }
EXPORT_SYMBOL(drm_mmap); EXPORT_SYMBOL(drm_legacy_mmap);
void drm_legacy_vma_flush(struct drm_device *dev) void drm_legacy_vma_flush(struct drm_device *dev)
{ {
......
...@@ -47,7 +47,7 @@ static const struct file_operations i810_driver_fops = { ...@@ -47,7 +47,7 @@ static const struct file_operations i810_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl, .compat_ioctl = drm_compat_ioctl,
......
...@@ -48,7 +48,7 @@ static const struct file_operations mga_driver_fops = { ...@@ -48,7 +48,7 @@ static const struct file_operations mga_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = mga_compat_ioctl, .compat_ioctl = mga_compat_ioctl,
......
...@@ -46,7 +46,7 @@ static const struct file_operations r128_driver_fops = { ...@@ -46,7 +46,7 @@ static const struct file_operations r128_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = r128_compat_ioctl, .compat_ioctl = r128_compat_ioctl,
......
...@@ -308,7 +308,7 @@ static const struct file_operations radeon_driver_old_fops = { ...@@ -308,7 +308,7 @@ static const struct file_operations radeon_driver_old_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
.read = drm_read, .read = drm_read,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
......
...@@ -40,7 +40,7 @@ static const struct file_operations savage_driver_fops = { ...@@ -40,7 +40,7 @@ static const struct file_operations savage_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl, .compat_ioctl = drm_compat_ioctl,
......
...@@ -70,7 +70,7 @@ static const struct file_operations sis_driver_fops = { ...@@ -70,7 +70,7 @@ static const struct file_operations sis_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl, .compat_ioctl = drm_compat_ioctl,
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "tdfx_drv.h" #include "tdfx_drv.h"
#include <drm/drm_pciids.h> #include <drm/drm_pciids.h>
#include <drm/drm_legacy.h>
static struct pci_device_id pciidlist[] = { static struct pci_device_id pciidlist[] = {
tdfx_PCI_IDS tdfx_PCI_IDS
...@@ -46,7 +47,7 @@ static const struct file_operations tdfx_driver_fops = { ...@@ -46,7 +47,7 @@ static const struct file_operations tdfx_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl, .compat_ioctl = drm_compat_ioctl,
......
...@@ -62,7 +62,7 @@ static const struct file_operations via_driver_fops = { ...@@ -62,7 +62,7 @@ static const struct file_operations via_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl, .compat_ioctl = drm_compat_ioctl,
......
...@@ -961,7 +961,6 @@ extern ssize_t drm_read(struct file *filp, char __user *buffer, ...@@ -961,7 +961,6 @@ extern ssize_t drm_read(struct file *filp, char __user *buffer,
extern int drm_release(struct inode *inode, struct file *filp); extern int drm_release(struct inode *inode, struct file *filp);
/* Mapping support (drm_vm.h) */ /* Mapping support (drm_vm.h) */
extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma); extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
......
...@@ -157,6 +157,7 @@ int drm_legacy_addmap(struct drm_device *d, resource_size_t offset, ...@@ -157,6 +157,7 @@ int drm_legacy_addmap(struct drm_device *d, resource_size_t offset,
int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map); int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map);
int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map); int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map);
struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev); struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev);
int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma);
int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req); int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req);
int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req); int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment