From: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
To: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>
Cc: Thierry Reding
<thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>,
David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 5/5] drm/tegra: Implement page-flipping support
Date: Sat, 02 Feb 2013 00:01:22 +0100 [thread overview]
Message-ID: <23857788.jLhG4Zemr2@avalon> (raw)
In-Reply-To: <CAKMK7uFQKwvEN0j-L=g1UwTzVvtYyqyyBaH8apQnqWPa2sq5vQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Wednesday 16 January 2013 13:36:17 Daniel Vetter wrote:
> On Wed, Jan 16, 2013 at 11:01 AM, Thierry Reding wrote:
> > drm_events_release() should be enough to clean up the events, but I
> > suspect the reason why Laurent put that code in was that the drm_crtc
> > private data still has a reference to the event and needs to clear it.
> > Otherwise the next page flip won't be scheduled because .page_flip()
> > would return -EBUSY.
>
> Hm, indeed we seem to have a nice bug in most drivers there :(
That's not the only reason.
drm_events_release() handles vblank events added to the vblank_event_list.
That list only contains vblank events added by drm_queue_vblank_event(), only
called by drm_wait_vblank(). Page flip events never get there, so they need to
be cleaned up manually.
I wrote in the DRM documentation, in the page flipping section,
"FIXME: Could drivers that don't need to wait for rendering to complete just
add the event to dev->vblank_event_list and let the DRM core handle
everything, as for "normal" vertical blanking events?"
We should investigate that.
> > However, it seems like {tegra_dc,shmob_drm_crtc}_cancel_page_flip()
> > could both be simplified a lot and just set their event to NULL. Then
> > again, maybe keeping a separate reference isn't all that useful. Maybe
> > the better thing to do here is iterate over the list of pending VBLANK
> > events in *_finish_page_flip() and process each of them? That would
> > allow more than one user-space process to queue page flips.
>
> I think we need a slightly more generally useful solution, since most
> drivers are currently broken. I've read a bit through the code, but
> short of refcounting drm events and adding event->file_priv checks at
> relevent places I don't see a sane solution ... And even that one is
> rather invasive. Do you have an idea? Imo doing the cleanup in each
> driver will be rather error-prone, and since usually kms clients wait
> for flips to complete, also guaranteed to be little tested.
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2013-02-01 23:01 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 15:55 [PATCH 0/5] drm/tegra: Miscellaneous enhancements Thierry Reding
[not found] ` <1358178932-25505-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2013-01-14 15:55 ` [PATCH 1/5] drm: Allow vblank support without DRIVER_HAVE_IRQ Thierry Reding
2013-01-14 15:55 ` [PATCH 2/5] drm/tegra: Add plane support Thierry Reding
2013-01-14 15:55 ` [PATCH 3/5] drm/tegra: Implement .mode_set_base() Thierry Reding
2013-01-14 15:55 ` [PATCH 4/5] drm/tegra: Implement VBLANK support Thierry Reding
[not found] ` <1358178932-25505-5-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2013-01-22 18:21 ` Jon Mayo
[not found] ` <CADWT_cPtdmSF+_ybe70ZY_z5idzr0KQe94r57ok-Hf-V22wixA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-23 9:06 ` Mark Zhang
2013-01-30 8:34 ` Thierry Reding
[not found] ` <20130130083453.GA21322-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-01-30 12:36 ` Daniel Vetter
[not found] ` <CAKMK7uHo9inMzKXqpnH9+H7Tm+nnChGUXE+mGA51L0fNrwoX0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-31 2:06 ` Mario Kleiner
[not found] ` <5109D1A1.9010207-TdbV1Z3I5XE0NhjG498hmQ@public.gmane.org>
2013-01-31 8:17 ` Daniel Vetter
2013-01-14 15:55 ` [PATCH 5/5] drm/tegra: Implement page-flipping support Thierry Reding
[not found] ` <1358178932-25505-6-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2013-01-15 17:53 ` Daniel Vetter
[not found] ` <CAKMK7uFMa-QwyZJo6QaxAAbpGeNvoNp_T19wF_uA1hr1d2KHog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-15 20:17 ` Thierry Reding
[not found] ` <20130115201705.GA25976-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2013-01-16 9:43 ` Daniel Vetter
[not found] ` <CAKMK7uEV_w5rfoUv3xdTdYra+UOCnirf5GUK+2L2pxifUxFVmw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-16 10:01 ` Thierry Reding
[not found] ` <20130116100149.GA13628-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2013-01-16 12:36 ` Daniel Vetter
[not found] ` <CAKMK7uFQKwvEN0j-L=g1UwTzVvtYyqyyBaH8apQnqWPa2sq5vQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-16 13:31 ` Rob Clark
2013-01-16 18:56 ` Thierry Reding
[not found] ` <20130116185606.GC28660-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2013-02-01 23:05 ` Laurent Pinchart
2013-02-11 18:00 ` Daniel Vetter
2013-01-30 9:32 ` Thierry Reding
[not found] ` <20130130093247.GB21322-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-01-30 9:42 ` Ville Syrjälä
[not found] ` <20130130094240.GT9135-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-01-30 11:14 ` Thierry Reding
[not found] ` <20130130111436.GA11202-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-01-30 11:19 ` Thierry Reding
2013-02-01 23:01 ` Laurent Pinchart [this message]
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=23857788.jLhG4Zemr2@avalon \
--to=laurent.pinchart-rylnwiuwjnjg/c1bvhzhaw@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=daniel-/w4YWyX8dFk@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@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;
as well as URLs for NNTP newsgroup(s).