Commit 60f57220 authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm/qxl: switch qxl to &drm_gem_object_funcs.mmap

Wire up the new drm_gem_ttm_mmap() helper function.
Use generic drm_gem_mmap() and remove qxl_mmap().
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20191017132638.9693-3-kraxel@redhat.com
parent 80ed59b2
...@@ -157,7 +157,7 @@ static const struct file_operations qxl_fops = { ...@@ -157,7 +157,7 @@ static const struct file_operations qxl_fops = {
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.poll = drm_poll, .poll = drm_poll,
.read = drm_read, .read = drm_read,
.mmap = qxl_mmap, .mmap = drm_gem_mmap,
}; };
static int qxl_drm_freeze(struct drm_device *dev) static int qxl_drm_freeze(struct drm_device *dev)
......
...@@ -355,7 +355,6 @@ int qxl_mode_dumb_mmap(struct drm_file *filp, ...@@ -355,7 +355,6 @@ int qxl_mode_dumb_mmap(struct drm_file *filp,
/* qxl ttm */ /* qxl ttm */
int qxl_ttm_init(struct qxl_device *qdev); int qxl_ttm_init(struct qxl_device *qdev);
void qxl_ttm_fini(struct qxl_device *qdev); void qxl_ttm_fini(struct qxl_device *qdev);
int qxl_mmap(struct file *filp, struct vm_area_struct *vma);
/* qxl image */ /* qxl image */
......
...@@ -86,6 +86,7 @@ static const struct drm_gem_object_funcs qxl_object_funcs = { ...@@ -86,6 +86,7 @@ static const struct drm_gem_object_funcs qxl_object_funcs = {
.get_sg_table = qxl_gem_prime_get_sg_table, .get_sg_table = qxl_gem_prime_get_sg_table,
.vmap = qxl_gem_prime_vmap, .vmap = qxl_gem_prime_vmap,
.vunmap = qxl_gem_prime_vunmap, .vunmap = qxl_gem_prime_vunmap,
.mmap = drm_gem_ttm_mmap,
.print_info = drm_gem_ttm_print_info, .print_info = drm_gem_ttm_print_info,
}; };
......
...@@ -48,22 +48,6 @@ static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev) ...@@ -48,22 +48,6 @@ static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev)
return qdev; return qdev;
} }
int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct drm_file *file_priv = filp->private_data;
struct qxl_device *qdev = file_priv->minor->dev->dev_private;
if (qdev == NULL) {
DRM_ERROR(
"filp->private_data->minor->dev->dev_private == NULL\n");
return -EINVAL;
}
DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n",
filp->private_data, vma->vm_pgoff);
return ttm_bo_mmap(filp, vma, &qdev->mman.bdev);
}
static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags) static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
{ {
return 0; return 0;
......
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