From: Daniel Vetter <daniel@ffwll.ch>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 8/9] drm/omap: fix preclose to wait for scheduled work
Date: Wed, 3 Sep 2014 16:32:53 +0200 [thread overview]
Message-ID: <20140903143253.GU15520@phenom.ffwll.local> (raw)
In-Reply-To: <1409745310-19092-8-git-send-email-tomi.valkeinen@ti.com>
On Wed, Sep 03, 2014 at 02:55:09PM +0300, Tomi Valkeinen wrote:
> We already wait for all scheduled work to be done on the driver's unload
> function. However, I think we need to wait on preclose() also, so that
> when an application closes the drm file descriptor, we are sure that
> there's no left around.
The justification (likely, didn't check omapdrm code) for this is that we
need to clear out all outstanding drm_events. Currently i915 and some
other drivers (but not all) have that open-coded. We should probably track
drm_events on a per-fd list and move this logic into the core instead of
adding more driver-specific hacks.
-Daniel
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/gpu/drm/omapdrm/omap_drv.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 26fda74c1e48..f59fa6600cf8 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -594,7 +594,20 @@ static void dev_lastclose(struct drm_device *dev)
>
> static void dev_preclose(struct drm_device *dev, struct drm_file *file)
> {
> + struct omap_drm_private *priv = dev->dev_private;
> + int i;
> +
> DBG("preclose: dev=%p", dev);
> +
> + /*
> + * Flush crtcs to finish any pending work.
> + * Note: this may not be correct if there are multiple applications
> + * using the drm device, and could possibly result in a timeout from
> + * omap_crtc_flush() if an other application is actively queuing new
> + * work.
> + */
> + for (i = 0; i < priv->num_crtcs; i++)
> + omap_crtc_flush(priv->crtcs[i]);
> }
>
> static void dev_postclose(struct drm_device *dev, struct drm_file *file)
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-09-03 14:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 11:55 [PATCH 1/9] drm/omap: fix encoder-crtc mapping Tomi Valkeinen
2014-09-03 11:55 ` [PATCH 2/9] drm/omap: page_flip: return -EBUSY if flip pending Tomi Valkeinen
2014-09-03 11:55 ` [PATCH 3/9] drm/omap: fix race issue with vsync irq and apply Tomi Valkeinen
2014-09-03 11:55 ` [PATCH 4/9] drm/omap: make modesetting synchronous Tomi Valkeinen
2014-09-03 14:25 ` Daniel Vetter
2014-09-03 15:05 ` Rob Clark
2014-09-03 15:21 ` Daniel Vetter
2014-09-03 16:00 ` Rob Clark
2014-09-03 19:20 ` Daniel Vetter
2014-09-08 12:53 ` Tomi Valkeinen
2014-09-08 13:24 ` Daniel Vetter
2014-09-08 13:39 ` Rob Clark
2014-09-08 13:50 ` Daniel Vetter
2014-09-08 13:57 ` Rob Clark
2014-09-03 11:55 ` [PATCH 5/9] drm/omap: clear omap_obj->paddr in omap_gem_put_paddr() Tomi Valkeinen
2014-09-03 11:55 ` [PATCH 6/9] drm/omap: add pin refcounting to omap_framebuffer Tomi Valkeinen
2014-09-03 11:55 ` [PATCH 7/9] drm/omap: fix omap_crtc_flush() to handle the workqueue Tomi Valkeinen
2014-09-03 14:27 ` Daniel Vetter
2014-09-08 13:03 ` Tomi Valkeinen
2014-09-08 13:31 ` Daniel Vetter
2014-09-09 7:07 ` Tomi Valkeinen
2014-09-09 10:43 ` Rob Clark
2014-09-09 10:54 ` Tomi Valkeinen
2014-09-03 11:55 ` [PATCH 8/9] drm/omap: fix preclose to wait for scheduled work Tomi Valkeinen
2014-09-03 14:32 ` Daniel Vetter [this message]
2014-09-08 13:09 ` Tomi Valkeinen
2014-09-03 11:55 ` [PATCH 9/9] drm/omap: add a comment why locking is missing Tomi Valkeinen
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=20140903143253.GU15520@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--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.