[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dba5d37c-b1d8-4e25-778e-834eab56ac22@suse.de>
Date: Fri, 13 Sep 2019 15:10:02 +0200
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Gerd Hoffmann <kraxel@...hat.com>, dri-devel@...ts.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 6/8] drm/vram: switch vram helper to
&drm_gem_object_funcs.mmap()
Hi
Am 13.09.19 um 14:29 schrieb Gerd Hoffmann:
> Wire up the new drm_gem_ttm_mmap() helper function,
> use generic drm_gem_mmap for &fops.mmap and
> delete dead drm_vram_mm_file_operations_mmap().
>
> Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@...e.de>
> ---
> include/drm/drm_gem_vram_helper.h | 9 +------
> drivers/gpu/drm/drm_gem_vram_helper.c | 34 +--------------------------
> 2 files changed, 2 insertions(+), 41 deletions(-)
>
> diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h
> index 9aaef4f8c327..9d5526650291 100644
> --- a/include/drm/drm_gem_vram_helper.h
> +++ b/include/drm/drm_gem_vram_helper.h
> @@ -180,13 +180,6 @@ struct drm_vram_mm *drm_vram_helper_alloc_mm(
> struct drm_device *dev, uint64_t vram_base, size_t vram_size);
> void drm_vram_helper_release_mm(struct drm_device *dev);
>
> -/*
> - * Helpers for &struct file_operations
> - */
> -
> -int drm_vram_mm_file_operations_mmap(
> - struct file *filp, struct vm_area_struct *vma);
> -
> /**
> * define DRM_VRAM_MM_FILE_OPERATIONS - default callback functions for \
> &struct file_operations
> @@ -200,7 +193,7 @@ int drm_vram_mm_file_operations_mmap(
> .poll = drm_poll, \
> .unlocked_ioctl = drm_ioctl, \
> .compat_ioctl = drm_compat_ioctl, \
> - .mmap = drm_vram_mm_file_operations_mmap, \
> + .mmap = drm_gem_mmap, \
> .open = drm_open, \
> .release = drm_release \
>
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index 7bee80c6b6e8..e100b97ea6e3 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -681,6 +681,7 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs = {
> .unpin = drm_gem_vram_object_unpin,
> .vmap = drm_gem_vram_object_vmap,
> .vunmap = drm_gem_vram_object_vunmap,
> + .mmap = drm_gem_ttm_mmap,
> .print_info = drm_gem_ttm_print_info,
> };
>
> @@ -915,12 +916,6 @@ static void drm_vram_mm_cleanup(struct drm_vram_mm *vmm)
> ttm_bo_device_release(&vmm->bdev);
> }
>
> -static int drm_vram_mm_mmap(struct file *filp, struct vm_area_struct *vma,
> - struct drm_vram_mm *vmm)
> -{
> - return ttm_bo_mmap(filp, vma, &vmm->bdev);
> -}
> -
> /*
> * Helpers for integration with struct drm_device
> */
> @@ -976,30 +971,3 @@ void drm_vram_helper_release_mm(struct drm_device *dev)
> dev->vram_mm = NULL;
> }
> EXPORT_SYMBOL(drm_vram_helper_release_mm);
> -
> -/*
> - * Helpers for &struct file_operations
> - */
> -
> -/**
> - * drm_vram_mm_file_operations_mmap() - \
> - Implements &struct file_operations.mmap()
> - * @filp: the mapping's file structure
> - * @vma: the mapping's memory area
> - *
> - * Returns:
> - * 0 on success, or
> - * a negative error code otherwise.
> - */
> -int drm_vram_mm_file_operations_mmap(
> - struct file *filp, struct vm_area_struct *vma)
> -{
> - struct drm_file *file_priv = filp->private_data;
> - struct drm_device *dev = file_priv->minor->dev;
> -
> - if (WARN_ONCE(!dev->vram_mm, "VRAM MM not initialized"))
> - return -EINVAL;
> -
> - return drm_vram_mm_mmap(filp, vma, dev->vram_mm);
> -}
> -EXPORT_SYMBOL(drm_vram_mm_file_operations_mmap);
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists