[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5066e977-52b5-ce18-98e9-44dcfe018127@linaro.org>
Date: Wed, 15 Jun 2022 15:45:32 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Rob Clark <robdclark@...il.com>, dri-devel@...ts.freedesktop.org
Cc: freedreno@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
Chris Healy <cphealy@...il.com>,
Rob Clark <robdclark@...omium.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 1/2] drm: Add DRM_GEM_FOPS
On 09/06/2022 20:42, Rob Clark wrote:
> From: Rob Clark <robdclark@...omium.org>
>
> The DEFINE_DRM_GEM_FOPS() helper is a bit limiting if a driver wants to
> provide additional file ops, like show_fdinfo().
>
> v2: Split out DRM_GEM_FOPS instead of making DEFINE_DRM_GEM_FOPS
> varardic
> v3: nits
>
> Signed-off-by: Rob Clark <robdclark@...omium.org>
> Acked-by: Thomas Zimmermann <tzimmermann@...e.de>
I suspect that with Tomas's ack we can pick this through the drm/msm. Is
this correct? (I'll then pick it for the msm-lumag).
> ---
> include/drm/drm_gem.h | 26 ++++++++++++++++++--------
> 1 file changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> index 9d7c61a122dc..87cffc9efa85 100644
> --- a/include/drm/drm_gem.h
> +++ b/include/drm/drm_gem.h
> @@ -314,6 +314,23 @@ struct drm_gem_object {
> const struct drm_gem_object_funcs *funcs;
> };
>
> +/**
> + * DRM_GEM_FOPS - Default drm GEM file operations
> + *
> + * This macro provides a shorthand for setting the GEM file ops in the
> + * &file_operations structure. If all you need are the default ops, use
> + * DEFINE_DRM_GEM_FOPS instead.
> + */
> +#define DRM_GEM_FOPS \
> + .open = drm_open,\
> + .release = drm_release,\
> + .unlocked_ioctl = drm_ioctl,\
> + .compat_ioctl = drm_compat_ioctl,\
> + .poll = drm_poll,\
> + .read = drm_read,\
> + .llseek = noop_llseek,\
> + .mmap = drm_gem_mmap
> +
> /**
> * DEFINE_DRM_GEM_FOPS() - macro to generate file operations for GEM drivers
> * @name: name for the generated structure
> @@ -330,14 +347,7 @@ struct drm_gem_object {
> #define DEFINE_DRM_GEM_FOPS(name) \
> static const struct file_operations name = {\
> .owner = THIS_MODULE,\
> - .open = drm_open,\
> - .release = drm_release,\
> - .unlocked_ioctl = drm_ioctl,\
> - .compat_ioctl = drm_compat_ioctl,\
> - .poll = drm_poll,\
> - .read = drm_read,\
> - .llseek = noop_llseek,\
> - .mmap = drm_gem_mmap,\
> + DRM_GEM_FOPS,\
> }
>
> void drm_gem_object_release(struct drm_gem_object *obj);
--
With best wishes
Dmitry
Powered by blists - more mailing lists