From: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>
To: Thomas Zimmermann <tzimmermann-l3A5Bk7waGM@public.gmane.org>
Cc: hamohammed.sa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
airlied-cv59FeDIM0c@public.gmane.org,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org,
matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org,
emil.velikov-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
oleksandr_andrushchenko-uRwfk40T5oI@public.gmane.org,
michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org,
miaoqinglang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
tomi.valkeinen-l0cyMroinI0@public.gmane.org,
bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.org,
marek.olsak-5C7GfCeVMHo@public.gmane.org,
matthew.auld-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
chunkuang.hu-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
andi.shyti-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
tianci.yin-5C7GfCeVMHo@public.gmane.org,
etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
rodrigo.vivi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
evan.quan-5C7GfCeVMHo@public.gmane.org,
sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.orglinux-arm-
Subject: Re: [PATCH v2 04/21] drm/exynos: Introduce GEM object functions
Date: Wed, 16 Sep 2020 13:24:24 +0200 [thread overview]
Message-ID: <20200916112424.GH438822@phenom.ffwll.local> (raw)
In-Reply-To: <fb1f5992-1642-5751-5672-486b89442e1c-l3A5Bk7waGM@public.gmane.org>
On Wed, Sep 16, 2020 at 12:36:28PM +0200, Thomas Zimmermann wrote:
> Hi
>
> Am 16.09.20 um 12:03 schrieb Daniel Vetter:
> > On Tue, Sep 15, 2020 at 04:59:41PM +0200, Thomas Zimmermann wrote:
> >> GEM object functions deprecate several similar callback interfaces in
> >> struct drm_driver. This patch replaces the per-driver callbacks with
> >> per-instance callbacks in exynos. The only exception is gem_prime_mmap,
> >> which is non-trivial to convert.
> >>
> >> Signed-off-by: Thomas Zimmermann <tzimmermann-l3A5Bk7waGM@public.gmane.org>
> >> ---
> >> drivers/gpu/drm/exynos/exynos_drm_drv.c | 10 ----------
> >> drivers/gpu/drm/exynos/exynos_drm_gem.c | 15 +++++++++++++++
> >> 2 files changed, 15 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> >> index dbd80f1e4c78..fe46680ca208 100644
> >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> >> @@ -75,11 +75,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
> >> file->driver_priv = NULL;
> >> }
> >>
> >> -static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
> >> - .open = drm_gem_vm_open,
> >> - .close = drm_gem_vm_close,
> >> -};
> >> -
> >> static const struct drm_ioctl_desc exynos_ioctls[] = {
> >> DRM_IOCTL_DEF_DRV(EXYNOS_GEM_CREATE, exynos_drm_gem_create_ioctl,
> >> DRM_RENDER_ALLOW),
> >> @@ -124,16 +119,11 @@ static struct drm_driver exynos_drm_driver = {
> >> .open = exynos_drm_open,
> >> .lastclose = drm_fb_helper_lastclose,
> >> .postclose = exynos_drm_postclose,
> >> - .gem_free_object_unlocked = exynos_drm_gem_free_object,
> >> - .gem_vm_ops = &exynos_drm_gem_vm_ops,
> >> .dumb_create = exynos_drm_gem_dumb_create,
> >> .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
> >> .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
> >> .gem_prime_import = exynos_drm_gem_prime_import,
> >> - .gem_prime_get_sg_table = exynos_drm_gem_prime_get_sg_table,
> >> .gem_prime_import_sg_table = exynos_drm_gem_prime_import_sg_table,
> >> - .gem_prime_vmap = exynos_drm_gem_prime_vmap,
> >> - .gem_prime_vunmap = exynos_drm_gem_prime_vunmap,
> >> .gem_prime_mmap = exynos_drm_gem_prime_mmap,
> >> .ioctls = exynos_ioctls,
> >> .num_ioctls = ARRAY_SIZE(exynos_ioctls),
> >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> >> index efa476858db5..69a5cf28b4ae 100644
> >> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
> >> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> >> @@ -129,6 +129,19 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem *exynos_gem)
> >> kfree(exynos_gem);
> >> }
> >>
> >> +static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
> >> + .open = drm_gem_vm_open,
> >> + .close = drm_gem_vm_close,
> >> +};
> >
> > Hm moving the drm_gem_cma_vm_ops into drm_gem.h or so and maybe calling
> > them drm_gem_simple_ops or so would remove a pile of these. But perhaps a
> > quick follow up series.
>
> Good idea. Several interfaces use the term 'default' in their name, so
> something like drm_gem_default_vm_ops seems appropriate.
Default sounds like a fine naming choice too.
> BTW is there a reason why we have file operations like
> DEFINE_DRM_GEM_CMA_FOPS() in each module? It seems like this could also
> be provided by the rsp memory-manager library.
It's for the module reference counting of the underlying file. So
file_operations need this.
-Daniel
>
> Best regards
> Thomas
>
> >
> > Reviewed-by: Daniel Vetter <daniel.vetter-/w4YWyX8dFk@public.gmane.org>
> >
> >> +
> >> +static const struct drm_gem_object_funcs exynos_drm_gem_object_funcs = {
> >> + .free = exynos_drm_gem_free_object,
> >> + .get_sg_table = exynos_drm_gem_prime_get_sg_table,
> >> + .vmap = exynos_drm_gem_prime_vmap,
> >> + .vunmap = exynos_drm_gem_prime_vunmap,
> >> + .vm_ops = &exynos_drm_gem_vm_ops,
> >> +};
> >> +
> >> static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev,
> >> unsigned long size)
> >> {
> >> @@ -143,6 +156,8 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev,
> >> exynos_gem->size = size;
> >> obj = &exynos_gem->base;
> >>
> >> + obj->funcs = &exynos_drm_gem_object_funcs;
> >> +
> >> ret = drm_gem_object_init(dev, obj, size);
> >> if (ret < 0) {
> >> DRM_DEV_ERROR(dev->dev, "failed to initialize gem object\n");
> >> --
> >> 2.28.0
> >>
> >
>
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2020-09-16 11:24 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 14:59 [PATCH v2 00/21] Convert all remaining drivers to GEM object functions Thomas Zimmermann
2020-09-15 14:59 ` [PATCH v2 01/21] drm/amdgpu: Introduce " Thomas Zimmermann
[not found] ` <20200915145958.19993-2-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-15 15:05 ` Christian König
[not found] ` <835ba167-3576-1af6-5421-552075588796-5C7GfCeVMHo@public.gmane.org>
2020-09-17 7:40 ` Thomas Zimmermann
2020-09-15 14:59 ` [PATCH v2 02/21] drm/armada: " Thomas Zimmermann
[not found] ` <20200915145958.19993-3-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-15 15:07 ` Russell King - ARM Linux admin
2020-09-15 14:59 ` [PATCH v2 03/21] drm/etnaviv: " Thomas Zimmermann
[not found] ` <20200915145958.19993-4-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-16 11:21 ` Daniel Vetter
2020-09-15 14:59 ` [PATCH v2 05/21] drm/gma500: " Thomas Zimmermann
2020-09-16 11:31 ` Daniel Vetter
2020-09-15 14:59 ` [PATCH v2 07/21] drm/mediatek: " Thomas Zimmermann
[not found] ` <20200915145958.19993-8-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-16 11:35 ` Daniel Vetter
2020-09-15 14:59 ` [PATCH v2 08/21] drm/msm: Introduce GEM object funcs Thomas Zimmermann
[not found] ` <20200915145958.19993-9-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-16 12:01 ` Daniel Vetter
[not found] ` <20200915145958.19993-1-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-15 14:59 ` [PATCH v2 04/21] drm/exynos: Introduce GEM object functions Thomas Zimmermann
[not found] ` <20200915145958.19993-5-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-16 10:03 ` Daniel Vetter
[not found] ` <20200916100318.GF438822-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2020-09-16 10:36 ` Thomas Zimmermann
[not found] ` <fb1f5992-1642-5751-5672-486b89442e1c-l3A5Bk7waGM@public.gmane.org>
2020-09-16 11:24 ` Daniel Vetter [this message]
2020-09-15 14:59 ` [PATCH v2 06/21] drm/i915: " Thomas Zimmermann
[not found] ` <20200915145958.19993-7-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-15 16:14 ` Tvrtko Ursulin
2020-09-15 14:59 ` [PATCH v2 09/21] drm/nouveau: " Thomas Zimmermann
[not found] ` <20200915145958.19993-10-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-16 12:04 ` Daniel Vetter
2020-09-15 14:59 ` [PATCH v2 19/21] drm/xen: " Thomas Zimmermann
2020-09-15 14:59 ` [PATCH v2 21/21] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver Thomas Zimmermann
[not found] ` <20200915145958.19993-22-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-16 12:12 ` Daniel Vetter
2020-09-16 17:55 ` Thomas Zimmermann
2020-09-15 14:59 ` [PATCH v2 10/21] drm/omapdrm: Introduce GEM object functions Thomas Zimmermann
2020-09-15 14:59 ` [PATCH v2 11/21] drm/pl111: " Thomas Zimmermann
2020-09-15 14:59 ` [PATCH v2 12/21] drm/radeon: " Thomas Zimmermann
[not found] ` <20200915145958.19993-13-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-15 15:08 ` Christian König
2020-09-15 14:59 ` [PATCH v2 13/21] drm/rockchip: Convert to drm_gem_object_funcs Thomas Zimmermann
[not found] ` <20200915145958.19993-14-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-16 12:07 ` Daniel Vetter
2020-09-15 14:59 ` [PATCH v2 14/21] drm/tegra: Introduce GEM object functions Thomas Zimmermann
[not found] ` <20200915145958.19993-15-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-17 10:56 ` Thierry Reding
2020-09-15 14:59 ` [PATCH v2 15/21] drm/vc4: " Thomas Zimmermann
2020-09-15 14:59 ` [PATCH v2 16/21] drm/vgem: " Thomas Zimmermann
[not found] ` <20200915145958.19993-17-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-17 14:01 ` Melissa Wen
2020-09-15 14:59 ` [PATCH v2 17/21] drm/virtgpu: Set PRIME export function in struct drm_gem_object_funcs Thomas Zimmermann
[not found] ` <20200915145958.19993-18-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-16 12:09 ` Daniel Vetter
2020-09-15 14:59 ` [PATCH v2 18/21] drm/vkms: Introduce GEM object functions Thomas Zimmermann
[not found] ` <20200915145958.19993-19-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-09-17 11:31 ` Melissa Wen
2020-09-15 14:59 ` [PATCH v2 20/21] drm/xlnx: Initialize DRM driver instance with CMA helper macro Thomas Zimmermann
2020-09-15 15:53 ` Laurent Pinchart
2020-09-15 18:39 ` Hyun Kwon
2020-09-15 15:25 ` [PATCH v2 00/21] Convert all remaining drivers to GEM object functions Christian König
[not found] ` <b527fde4-b456-6683-4a9e-0f7dcf1525be-5C7GfCeVMHo@public.gmane.org>
2020-09-17 7:05 ` Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200916112424.GH438822@phenom.ffwll.local \
--to=daniel-/w4ywyx8dfk@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=andi.shyti-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=chunkuang.hu-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=emil.velikov-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=evan.quan-5C7GfCeVMHo@public.gmane.org \
--cc=hamohammed.sa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marek.olsak-5C7GfCeVMHo@public.gmane.org \
--cc=matthew.auld-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=miaoqinglang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=oleksandr_andrushchenko-uRwfk40T5oI@public.gmane.org \
--cc=rodrigo.vivi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org \
--cc=sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.orglinux-arm- \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tianci.yin-5C7GfCeVMHo@public.gmane.org \
--cc=tomi.valkeinen-l0cyMroinI0@public.gmane.org \
--cc=tzimmermann-l3A5Bk7waGM@public.gmane.org \
--cc=xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox