diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-06-08 14:18:55 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-06-10 16:55:05 +0200 |
commit | 84d9a4a28801fddb88dc61487089ed0ae2ccef78 (patch) | |
tree | 5b6dd3219f31891cfc2f7131563aa054c6d428e2 /drivers/gpu/drm/arc | |
parent | 5e84c2690b805caeff3b4c6c9564c7b8de54742d (diff) | |
download | linux-84d9a4a28801fddb88dc61487089ed0ae2ccef78.tar.gz linux-84d9a4a28801fddb88dc61487089ed0ae2ccef78.tar.bz2 linux-84d9a4a28801fddb88dc61487089ed0ae2ccef78.zip |
drm/arc: Actually bother with handling atomic events.
The drm core has a nice ready-made helper for exactly the simple case
where it should fire on the next vblank.
Note that arming the vblank event in _begin is probably too early, and
might easily result in the vblank firing too early, before the new set
of planes are actually disabled. But that's kinda a minor issue
compared to just outright hanging userspace.
v2: Be more robust and either arm, when the CRTC is on, or just send
the event out right away.
v3: Just unconditionally send out the event directly, for safety -
arcpgu doesn't even have vblank support ...
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-3-git-send-email-daniel.vetter@ffwll.ch
Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-4-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/arc')
-rw-r--r-- | drivers/gpu/drm/arc/arcpgu_crtc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c index d5ca0c280e68..ee0a61c2861b 100644 --- a/drivers/gpu/drm/arc/arcpgu_crtc.c +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c @@ -145,16 +145,14 @@ static int arc_pgu_crtc_atomic_check(struct drm_crtc *crtc, static void arc_pgu_crtc_atomic_begin(struct drm_crtc *crtc, struct drm_crtc_state *state) { - struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc); - unsigned long flags; - - if (crtc->state->event) { - struct drm_pending_vblank_event *event = crtc->state->event; + struct drm_pending_vblank_event *event = crtc->state->event; + if (event) { crtc->state->event = NULL; - event->pipe = drm_crtc_index(crtc); - WARN_ON(drm_crtc_vblank_get(crtc) != 0); + spin_lock_irq(&crtc->dev->event_lock); + drm_crtc_send_vblank_event(crtc, event); + spin_unlock_irq(&crtc->dev->event_lock); } } |