[PATCH 8/9] drm/omap: fix preclose to wait for scheduled work

Tomi Valkeinen tomi.valkeinen at ti.com
Mon Sep 8 06:09:39 PDT 2014


On 03/09/14 17:32, Daniel Vetter wrote:
> 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.

Hmm, that's supposed to say "there's no work 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.

To be honest, I'm not 100% sure what we need to wait for =). I'm still
learning DRM, and omapdrm's work handling is not the easiest one to
follow. But yes, at least the page-flip event is one that rings alarm
bells in my head, if the fb is allowed to be closed and there's still an
event outstanding.

With this patch we wait until all work is done in the preclose. The
performance is not an issue here, so I went for "better safe than sorry".

 Tomi


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140908/64d19aba/attachment-0001.sig>


More information about the dri-devel mailing list