From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
Daniel Stone <daniels@collabora.com>,
Tomeu Vizoso <tomeu.vizoso@gmail.com>
Subject: Re: [Intel-gfx] [PATCH] drm/atomic-helper: nonblocking commit support
Date: Tue, 31 May 2016 16:22:57 +0200 [thread overview]
Message-ID: <f722514a-d4e9-96d7-ad55-c662ad5a95db@linux.intel.com> (raw)
In-Reply-To: <1464595318-12234-1-git-send-email-daniel.vetter@ffwll.ch>
Op 30-05-16 om 10:01 schreef Daniel Vetter:
> Design ideas:
>
> - split up the actual commit into different phases, and have
> completions for each of them. This will be useful for the future
> when we want to interleave phases much more aggressively, for e.g.
> queue depth > 1. For not it's just a minimal optimization compared
> to current common nonblocking implementation patterns from drivers,
> which all stall for the entire commit to complete, including vblank
> waits and cleanups.
>
> - Extract a separate atomic_commit_hw hook since that's the part most
> drivers will need to overwrite, hopefully allowing even more shared
> code.
>
> - Enforce EBUSY seamntics by attaching one of the completions to the
> flip_done vblank event. Side benefit of forcing atomic drivers using
> these helpers to implement event handlign at least semi-correct. I'm
> evil that way ;-)
>
> - Ridiculously modular, as usual.
>
> - The main tracking unit for a commit stays struct drm_atomic_state,
> and the ownership rules for that are unchanged. Ownership still
> gets transferred to the driver (and subsequently to the worker) on
> successful commits. What is added is a small, per-crtc, refcounted
> structure to track pending commits called struct drm_crtc_commit.
> No actual state is attached to that though, it's purely for ordering
> and waiting.
>
> - Dependencies are implicitly handled by assuming that any CRTC part
> of &drm_atomic_state is a dependency, and that the current commit
> must wait for any commits to complete on those CRTC. This way
> drivers can easily add more depencies using
> drm_atomic_get_crtc_state(), which is very natural since in most
> case a dependency exists iff there's some bit of state that needs to
> be cross checked.
>
> Removing depencies is not possible, drivers simply need to be
> careful to not include every CRTC in a commit if that's not
> necessary. Which is a good idea anyway, since that also avoids
> ww_mutex lock contention.
>
> - Queue depth > 1 sees some prep work in this patch by adding a stall
> paramater to drm_atomic_helper_swap_states(). To be able to push
> commits entirely free-standing and in a deeper queue through the
> back-end the driver must not access any obj->state pointers. This
> means we need to track the old state in drm_atomic_state (much
> easier with the consolidated arrays), and pass them all explicitly
> to driver backends (this will be serious amounts of churn).
>
> Once that's done stall can be set to false in swap_states.
>
> Features: Contains bugs because totally untested.
>
> v2: Dont ask for flip_done signalling when the CRTC is off and stays
> off: Drivers don't handle events in that case. Instead complete right
> away. This way future commits don't need to have special-case logic,
> but can keep blocking for the flip_done completion.
>
> v3: Tons of fixes:
> - Stall for preceeding commit for real, not the current one by
> accident.
> - Add WARN_ON in case drivers don't fire the drm event.
> - Don't double-free drm events.
>
> v4: Make legacy cursor not stall.
>
> v5: Extend the helper hook to cover the entire commit tail. Some
> drivers need special code for cleanup and vblank waiting, this makes
> it a bit more useful. Inspired by the rockchip driver.
>
> v6: Add WARN_ON to catch drivers who forget to send out the
> drm event.
>
> v7: Fixup the stalls in swap_state for real!!
I don't think stalling belongs to swap_state, that should be a separate helper call.
When nonblocking = false the waiting is still performed uninterruptibly. I believe that this is an error,
and all blocking waiting should be completed before calling swap_state to ensure -EINTR can be
propagated correctly as much as possible. Perhaps also return -EBUSY if wait times out.
You specified a timeout of 10 HZ, why is that? If we wait interruptibly then there's no need for a timeout.
I also think the timeout may be too short, if we commit 3 crtc's it leaves 3.3 seconds for each. In case
there's a modeset enable and disable, that leaves 1.6 seconds for each enable/disable. Might be too short..
Patch is also a bit hard to review with so many lines changed, could this be done in pieces instead of all at once?
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-05-31 14:22 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-29 18:34 [PATCH 00/26] RFC: generic nonblocking support in the atomic helpers Daniel Vetter
2016-05-29 18:34 ` [PATCH 01/26] drm/atomic-helper: use for_each_*_in_state more Daniel Vetter
2016-05-30 12:17 ` Maarten Lankhorst
2016-05-30 15:02 ` Daniel Vetter
2016-05-29 18:34 ` [PATCH 02/26] drm/i915: Use drm_atomic_get_existing_plane_state Daniel Vetter
2016-05-30 13:10 ` [Intel-gfx] " Maarten Lankhorst
2016-05-29 18:35 ` [PATCH 03/26] drm/msm: Use for_each_*_in_state Daniel Vetter
2016-05-29 18:35 ` [PATCH 04/26] drm/rcar-du: " Daniel Vetter
2016-05-30 9:18 ` Laurent Pinchart
2016-05-30 9:58 ` Maarten Lankhorst
2016-05-30 14:54 ` [Intel-gfx] " Daniel Vetter
2016-06-02 22:54 ` Laurent Pinchart
2016-06-03 6:55 ` [Intel-gfx] " Daniel Vetter
2016-06-03 9:40 ` Laurent Pinchart
2016-06-03 9:45 ` Daniel Vetter
2016-06-03 9:50 ` Laurent Pinchart
2016-05-29 18:35 ` [PATCH 05/26] drm/vc4: Use for_each_plane_in_state Daniel Vetter
2016-05-29 18:35 ` [PATCH 06/26] drm/atomic: Add __drm_atomic_get_current_plane_state Daniel Vetter
2016-05-30 11:42 ` [Intel-gfx] " Maarten Lankhorst
2016-05-30 15:05 ` Daniel Vetter
2016-05-31 8:35 ` [Intel-gfx] " Maarten Lankhorst
2016-05-29 18:35 ` [PATCH 07/26] drm/exynos: Use for_each_crtc_in_state Daniel Vetter
2016-05-31 12:19 ` Inki Dae
2016-06-13 0:52 ` Inki Dae
2016-05-29 18:35 ` [PATCH 08/26] drm: Consolidate connector arrays in drm_atomic_state Daniel Vetter
2016-05-30 14:59 ` Ville Syrjälä
2016-05-30 15:13 ` Daniel Vetter
2016-05-30 15:25 ` [Intel-gfx] " Ville Syrjälä
2016-05-30 15:33 ` Daniel Vetter
2016-05-30 15:45 ` Ville Syrjälä
2016-05-30 15:48 ` [Intel-gfx] " Daniel Vetter
2016-05-29 18:35 ` [PATCH 09/26] drm: Consolidate plane " Daniel Vetter
2016-05-29 18:35 ` [PATCH 10/26] drm: Consolidate crtc " Daniel Vetter
2016-05-29 18:35 ` [PATCH 11/26] drm/fence: add fence to drm_pending_event Daniel Vetter
2016-05-29 18:35 ` [PATCH 12/26] drm/atomic-helper: Massage swap_state signature somewhat Daniel Vetter
2016-05-30 13:08 ` Maarten Lankhorst
2016-05-30 15:09 ` [Intel-gfx] " Daniel Vetter
2016-05-31 8:43 ` Maarten Lankhorst
2016-05-31 10:46 ` Daniel Vetter
2016-05-31 12:20 ` Maarten Lankhorst
2016-05-29 18:35 ` [PATCH 13/26] drm/arc: Nuke event_list Daniel Vetter
2016-05-29 18:35 ` [PATCH 14/26] drm/arc: Actually bother with handling atomic events Daniel Vetter
2016-05-29 18:35 ` [PATCH 15/26] drm/arc: Implement nonblocking commit correctly Daniel Vetter
2016-05-30 8:15 ` [Intel-gfx] " Maarten Lankhorst
2016-05-30 9:24 ` Daniel Vetter
2016-05-30 9:36 ` Maarten Lankhorst
2016-05-30 15:10 ` [Intel-gfx] " Daniel Vetter
2016-05-29 18:35 ` [PATCH 16/26] drm/hdlcd: Use helper support for nonblocking commits Daniel Vetter
2016-05-31 11:02 ` Liviu Dudau
2016-05-31 11:07 ` Daniel Vetter
2016-05-31 13:13 ` Liviu Dudau
2016-05-29 18:35 ` [PATCH 17/26] drm/fsl-du: Implement some semblance of vblank event handling Daniel Vetter
2016-05-29 18:35 ` [PATCH 18/26] drm/hisilicon: " Daniel Vetter
2016-05-29 18:35 ` [PATCH 19/26] drm/sun4i: " Daniel Vetter
2016-06-01 16:18 ` Maxime Ripard
2016-06-01 22:02 ` Daniel Vetter
2016-05-29 18:35 ` [PATCH 20/26] drm/atomic: kerneldoc for drm_atomic_crtc_needs_modeset Daniel Vetter
2016-05-29 18:35 ` [PATCH 21/26] drm/atomic-helper: nonblocking commit support Daniel Vetter
2016-05-30 8:01 ` [PATCH] " Daniel Vetter
2016-05-31 14:22 ` Maarten Lankhorst [this message]
2016-05-31 14:33 ` [Intel-gfx] " Daniel Vetter
2016-05-29 18:35 ` [PATCH 22/26] drm/i915: Signal drm events for atomic Daniel Vetter
2016-05-29 18:35 ` [PATCH 23/26] drm/i915: Roll out the helper nonblock tracking Daniel Vetter
2016-05-29 18:35 ` [PATCH 24/26] drm/rockchip: convert to helper nonblocking atomic commit Daniel Vetter
2016-05-29 18:35 ` [PATCH 25/26] drm/rockchip: Nuke pending event handling in preclose Daniel Vetter
2016-05-29 18:35 ` [PATCH 26/26] drm/virtio: Don't reinvent a flipping wheel Daniel Vetter
2016-05-31 13:40 ` ✗ Ro.CI.BAT: failure for RFC: generic nonblocking support in the atomic helpers Patchwork
2016-05-31 13:42 ` Patchwork
2016-05-31 14:29 ` 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=f722514a-d4e9-96d7-ad55-c662ad5a95db@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tomeu.vizoso@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox