All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 12/24] drm/i915: Merge pre/postclose hooks
Date: Tue, 14 Mar 2017 14:38:12 +0100	[thread overview]
Message-ID: <20170314133812.sudjfpqwewv7klgq@phenom.ffwll.local> (raw)
In-Reply-To: <20170308154513.kmg5i2vv4adpi3xn@phenom.ffwll.local>

On Wed, Mar 08, 2017 at 04:45:13PM +0100, Daniel Vetter wrote:
> On Wed, Mar 08, 2017 at 03:07:48PM +0000, Chris Wilson wrote:
> > On Wed, Mar 08, 2017 at 03:12:45PM +0100, Daniel Vetter wrote:
> > > There's really not a reason afaics that we can't just clean up
> > > everything at the end, in the terminal postclose hook: Since this is
> > > closing a file descriptor we know no one else can have a reference or
> > > a thread doing something with that drm_file except the close code.
> > > Ordering shouldn't matter, as long as we don't kfree before we clean
> > > stuff up.
> > 
> > My gut feeling was that preclose is the one we want to keep, as that is
> > closer to the onion unwind - during open, we do the core drm ops first
> > (e.g. drm_gem_open) before the backend, so during close we should do the
> > driver before the core.
> > 
> > Maybe completely wrong ofc.
> 
> I wasn't sure whether drivers might have some random pointers to fpriv
> that they might chase when we tear down gem objects and stuff like that.
> And if you look at what's before postclose, we still have onion
> unwrapping: All the things before it (fb cleanup, gem cleanup, master
> dropping) is stuff that userspace adds to the file _after_ it's fully
> opened.
> 
> Well it's not entirely clear, because gem destroys the idr before
> postclose, which might or might not trip up someone.
> 
> But afaik all the other destructive cleanup is done after postclose.
> 
> So maybe that's the split we want in drm_close?
> 
> - First release all runtime resources acquired after ->open. Not
>   destructive cleanup, fpriv should keep working like right after ->open
>   has returned. These functions would all have _release in their names.
> - call the driver's ->postclose.
> - All the destructive cleanup. Those functions would all have _destroy in
>   their names.
> 
> Since there's not really a real issue right now I'd prefer if we postpone
> this cleanup though, and first get all the driver patches merged. Just in
> case I missed something ...
> 
> I kinda want to do an s/postclose/close/ using cocci anyway, so this isn't
> the last series on this topic.

And merged with Chris' irc r-b.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-03-14 13:38 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 14:12 [PATCH 00/24] more docs and header splits Daniel Vetter
2017-03-08 14:12 ` [PATCH 01/24] drm/doc: Add todo about connector_list_iter Daniel Vetter
2017-03-08 15:12   ` [Intel-gfx] " Sean Paul
2017-03-08 14:12 ` [PATCH 02/24] drm: Extract drm_prime.h Daniel Vetter
2017-03-08 14:57   ` Gustavo Padovan
2017-03-13 16:42   ` Sean Paul
2017-03-14  9:12     ` [Intel-gfx] " Daniel Vetter
2017-03-14 15:42       ` Sean Paul
2017-03-08 14:12 ` [PATCH 03/24] drm: Move drm_lock_data out of drmP.h Daniel Vetter
2017-03-08 14:58   ` Gustavo Padovan
2017-03-08 14:12 ` [PATCH 04/24] drm: Extract drm_pci.h Daniel Vetter
2017-03-08 14:59   ` [Intel-gfx] " Gustavo Padovan
2017-03-08 14:12 ` [PATCH 05/24] drm: Remove drmP.h include from drm_kms_helper_common.c Daniel Vetter
2017-03-08 15:00   ` [Intel-gfx] " Gustavo Padovan
2017-03-08 14:12 ` [PATCH 06/24] drm/doc: document fallback behaviour for atomic events Daniel Vetter
2017-03-08 14:57   ` Laurent Pinchart
2017-03-08 14:12 ` [PATCH 07/24] drm: rename drm_fops.c to drm_file.c Daniel Vetter
2017-03-08 15:02   ` [Intel-gfx] " Gustavo Padovan
2017-03-08 14:12 ` [PATCH 08/24] drm: Remove DRM_MINOR_CNT Daniel Vetter
2017-03-08 14:14   ` David Herrmann
2017-03-13 16:56   ` Sean Paul
2017-03-08 14:12 ` [PATCH 09/24] drm: Extract drm_file.h Daniel Vetter
2017-03-08 15:05   ` Gustavo Padovan
2017-03-09 10:52     ` Daniel Vetter
2017-03-08 14:12 ` [PATCH 10/24] drm: Remove drm_pending_event->pid Daniel Vetter
2017-03-13 17:05   ` [Intel-gfx] " Sean Paul
2017-03-14 13:20     ` Daniel Vetter
2017-03-08 14:12 ` [PATCH 11/24] drm/doc: Document drm_file.[hc] Daniel Vetter
2017-03-13 17:53   ` Sean Paul
2017-03-14 13:25     ` Daniel Vetter
2017-03-14 13:27     ` Daniel Vetter
2017-03-08 14:12 ` [PATCH 12/24] drm/i915: Merge pre/postclose hooks Daniel Vetter
2017-03-08 15:07   ` Chris Wilson
2017-03-08 15:45     ` Daniel Vetter
2017-03-14 13:38       ` Daniel Vetter [this message]
2017-03-08 14:12 ` [PATCH 13/24] drm/msm: switch to postclose Daniel Vetter
2017-03-13 18:59   ` Sean Paul
2017-03-08 14:12 ` [PATCH 16/24] drm/tegra: " Daniel Vetter
     [not found]   ` <20170308141257.12119-17-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2017-03-13 19:10     ` Sean Paul
2017-03-08 14:12 ` [PATCH 17/24] drm/vgem: " Daniel Vetter
2017-03-13 19:11   ` Sean Paul
2017-03-14 13:27     ` Daniel Vetter
2017-03-08 14:12 ` [PATCH 18/24] drm/etnaviv: " Daniel Vetter
2017-03-08 16:09   ` Lucas Stach
2017-03-08 18:15     ` Daniel Vetter
2017-03-09 10:03       ` Lucas Stach
     [not found] ` <20170308141257.12119-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2017-03-08 14:12   ` [PATCH 14/24] drm/nouveau: Merge pre/postclose hooks Daniel Vetter
     [not found]     ` <20170308141257.12119-15-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2017-03-13 19:07       ` Sean Paul
2017-03-08 14:12   ` [PATCH 15/24] drm/radeon: " Daniel Vetter
     [not found]     ` <20170308141257.12119-16-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2017-03-08 14:25       ` Christian König
     [not found]         ` <79dc5480-6354-2379-8a7a-a2c099209256-5C7GfCeVMHo@public.gmane.org>
2017-03-09  3:58           ` Alex Deucher
2017-03-08 14:12   ` [PATCH 19/24] drm/amdgpu: " Daniel Vetter
2017-03-08 14:12 ` [PATCH 20/24] drm/exynos: " Daniel Vetter
2017-03-13 19:18   ` [Intel-gfx] " Sean Paul
2017-03-14 13:28     ` Daniel Vetter
2017-03-15  0:54       ` Inki Dae
2017-03-15  9:09         ` [Intel-gfx] " Inki Dae
2017-03-15  9:52           ` Daniel Vetter
2017-03-08 14:12 ` [PATCH 21/24] drm/msm: Simplify vblank event delivery Daniel Vetter
2017-03-13 19:26   ` Sean Paul
2017-03-08 14:12 ` [PATCH 22/24] drm: Nerf the preclose callback for modern drivers Daniel Vetter
2017-03-09 10:48   ` Daniel Vetter
2017-03-13 19:29   ` [Intel-gfx] " Sean Paul
2017-03-14 13:50     ` Daniel Vetter
2017-03-08 14:12 ` [PATCH 23/24] drm: Create DEFINE_DRM_GEM_CMA_FOPS and roll it out to drivers Daniel Vetter
2017-03-13 17:11   ` Liviu Dudau
2017-03-13 19:31   ` [Intel-gfx] " Sean Paul
2017-03-13 19:33     ` Sean Paul
2017-03-08 14:12 ` [PATCH 24/24] drm/gem: Add DEFINE_DRM_GEM_FOPS Daniel Vetter
2017-03-13 19:35   ` Sean Paul
2017-03-14 13:31     ` Daniel Vetter
2017-03-08 17:52 ` ✓ Fi.CI.BAT: success for more docs and header splits Patchwork

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=20170314133812.sudjfpqwewv7klgq@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.