All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	"Sarha, Jyri" <jsarha@ti.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 20/22] drm/tilcdc: Nuke preclose hook
Date: Tue, 12 Jan 2016 16:12:55 +0100	[thread overview]
Message-ID: <20160112151255.GA19130@phenom.ffwll.local> (raw)
In-Reply-To: <56950B7B.1030006@ti.com>

On Tue, Jan 12, 2016 at 04:19:39PM +0200, Tomi Valkeinen wrote:
> 
> On 11/01/16 23:41, Daniel Vetter wrote:
> > Again since the drm core takes care of event unlinking/disarming this
> > is now just needless code.
> > 
> > v2: Fixup misplaced hunks.
> > 
> > Cc: Rob Clark <robdclark@gmail.com>
> > Acked-by: Daniel Stone <daniels@collabora.com>
> > Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 20 --------------------
> >  drivers/gpu/drm/tilcdc/tilcdc_drv.c  |  8 --------
> >  drivers/gpu/drm/tilcdc/tilcdc_drv.h  |  1 -
> >  3 files changed, 29 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> > index 7d07733bdc86..4802da8e6d6f 100644
> > --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> > +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> > @@ -662,26 +662,6 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc)
> >  	return IRQ_HANDLED;
> >  }
> >  
> > -void tilcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file)
> > -{
> > -	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
> > -	struct drm_pending_vblank_event *event;
> > -	struct drm_device *dev = crtc->dev;
> > -	unsigned long flags;
> > -
> > -	/* Destroy the pending vertical blanking event associated with the
> > -	 * pending page flip, if any, and disable vertical blanking interrupts.
> > -	 */
> > -	spin_lock_irqsave(&dev->event_lock, flags);
> > -	event = tilcdc_crtc->event;
> > -	if (event && event->base.file_priv == file) {
> > -		tilcdc_crtc->event = NULL;
> > -		event->base.destroy(&event->base);
> > -		drm_vblank_put(dev, 0);
> > -	}
> > -	spin_unlock_irqrestore(&dev->event_lock, flags);
> > -}
> > -
> 
> Hmm, looks fine, but when I was comparing the omapdrm change and this
> one, I see tilcdc doing drm_vblank_put() in the removed code but omapdrm
> doesn't.
> 
> The other patches that nuke preclose hooks also contain vblank_put. Will
> there be a vblank_put call missing here, or will there be an extra
> vblank_put call happening somewhere on omapdrm?

Different approaches to the same problem:

- omap just unlinks the event from fpriv and still process it normally.
  But then before sending it out it checks whether the fpriv is still
  there or not and either sends it, or deletes the event directly. This
  way the vblank_put is always called from the worker/irq handler as part
  of the event processing.

  This is the same approach I implemented in core with this series.

- tilcdc (and most other drivers) entirely destroy the event in the
  preclose hook, which means they must also release any other resources
  acquired as part of that event. Therefore they have the vblank_put here.
  But the vblank_put is obviously also in the normal event processing
  paths, so with the new approach of only unlinking it we can handle this
  without any special cases in the driver.

I hope this explains what's going on. Since you're about driver maintainer
no. 3 with the same question: Can you pls review the kerneldoc and make
sure it explains this well? I tried to improve it already a bit after
Laurent's/Thomas' questions.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-01-12 15:13 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 21:40 [PATCH 00/22] drm_event cleanup, round 2 Daniel Vetter
2016-01-11 21:40 ` [PATCH 01/22] drm: kerneldoc for drm_fops.c Daniel Vetter
2016-01-11 21:40 ` [PATCH 02/22] drm: Add functions to setup/tear down drm_events Daniel Vetter
2016-01-14 18:46   ` Laurent Pinchart
2016-01-11 21:40 ` [PATCH 03/22] drm/exynos: Use the new event init/free functions Daniel Vetter
2016-01-11 21:40 ` [PATCH 04/22] drm/vmwgfx: " Daniel Vetter
2016-01-11 21:40 ` [PATCH 05/22] drm: Create drm_send_event helpers Daniel Vetter
2016-01-14 18:46   ` Laurent Pinchart
2016-01-11 21:41 ` [PATCH 06/22] drm/fsl: Remove preclose hook Daniel Vetter
2016-01-11 21:41 ` [PATCH 07/22] drm/armada: Remove NULL open/pre/postclose hooks Daniel Vetter
2016-01-12 11:51   ` Russell King - ARM Linux
2016-01-12 12:33     ` Daniel Vetter
2016-01-11 21:41 ` [PATCH 08/22] drm/gma500: Remove empty preclose hook Daniel Vetter
2016-01-12 10:11   ` Patrik Jakobsson
2016-01-11 21:41 ` [PATCH 09/22] drm: Clean up pending events in the core Daniel Vetter
2016-01-14 18:45   ` Laurent Pinchart
2016-01-25 14:45   ` [REGRESSION] " Maarten Lankhorst
2016-01-11 21:41 ` [PATCH 10/22] drm: Nuke vblank event file cleanup code Daniel Vetter
2016-01-25  0:26   ` Laurent Pinchart
2016-01-11 21:41 ` [PATCH 11/22] drm/i915: Nuke intel_modeset_preclose Daniel Vetter
2016-01-11 21:41 ` [PATCH 12/22] drm/atmel: Nuke preclose Daniel Vetter
2016-01-13 14:56   ` Boris Brezillon
2016-01-11 21:41 ` [PATCH 13/22] drm/exynos: Remove event cancelling from postclose Daniel Vetter
2016-01-12  6:13   ` Inki Dae
2016-01-11 21:41 ` [PATCH 14/22] drm/imx: Unconfuse preclose logic Daniel Vetter
2016-01-12  8:57   ` Philipp Zabel
2016-01-11 21:41 ` [PATCH 15/22] drm/msm: Nuke preclose hooks Daniel Vetter
2016-01-11 21:41 ` [PATCH 16/22] drm/omap: Nuke close hooks Daniel Vetter
2016-01-12 14:09   ` Tomi Valkeinen
2016-01-13 11:00   ` Tomi Valkeinen
2016-01-13 11:05   ` [PATCH] " Daniel Vetter
2016-01-13 23:07     ` Laurent Pinchart
2016-01-11 21:41 ` [PATCH 17/22] drm/rcar: Nuke preclose hook Daniel Vetter
2016-01-11 21:41 ` [PATCH 18/22] drm/shmob: " Daniel Vetter
2016-01-11 21:41 ` [PATCH 19/22] drm/tegra: Stop cancelling page flip events Daniel Vetter
2016-01-13 14:03   ` Thierry Reding
2016-01-11 21:41 ` [PATCH 20/22] drm/tilcdc: Nuke preclose hook Daniel Vetter
2016-01-12 14:19   ` Tomi Valkeinen
2016-01-12 15:12     ` Daniel Vetter [this message]
2016-01-13 11:25       ` Tomi Valkeinen
2016-01-11 21:41 ` [PATCH 21/22] drm/vc4: " Daniel Vetter
2016-01-18 17:19   ` Eric Anholt
2016-01-11 21:41 ` [PATCH 22/22] drm/vmwgfx: " Daniel Vetter
2016-01-11 21:41 ` [PATCH] " Daniel Vetter
2016-01-12  8:30 ` ✗ failure: Fi.CI.BAT Patchwork
2016-01-25  7:50 ` [PATCH 00/22] drm_event cleanup, round 2 Daniel Vetter

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=20160112151255.GA19130@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /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.