All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Mark yao <mark.yao@rock-chips.com>
Subject: [PATCH 33/38] drm/rockchip: Nuke pending event handling in preclose
Date: Thu,  2 Jun 2016 00:06:56 +0200	[thread overview]
Message-ID: <1464818821-5736-34-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1464818821-5736-1-git-send-email-daniel.vetter@ffwll.ch>

This is now handled by the core, drivers can totally ignore lifetime
issues of drm events.

Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Mark yao <mark.yao@rock-chips.com>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 22 ----------------------
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h |  1 -
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 20 --------------------
 3 files changed, 43 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 2fac6799ceb2..2251121343e6 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -257,27 +257,6 @@ static int rockchip_drm_unload(struct drm_device *drm_dev)
 	return 0;
 }
 
-static void rockchip_drm_crtc_cancel_pending_vblank(struct drm_crtc *crtc,
-						    struct drm_file *file_priv)
-{
-	struct rockchip_drm_private *priv = crtc->dev->dev_private;
-	int pipe = drm_crtc_index(crtc);
-
-	if (pipe < ROCKCHIP_MAX_CRTC &&
-	    priv->crtc_funcs[pipe] &&
-	    priv->crtc_funcs[pipe]->cancel_pending_vblank)
-		priv->crtc_funcs[pipe]->cancel_pending_vblank(crtc, file_priv);
-}
-
-static void rockchip_drm_preclose(struct drm_device *dev,
-				  struct drm_file *file_priv)
-{
-	struct drm_crtc *crtc;
-
-	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
-		rockchip_drm_crtc_cancel_pending_vblank(crtc, file_priv);
-}
-
 void rockchip_drm_lastclose(struct drm_device *dev)
 {
 	struct rockchip_drm_private *priv = dev->dev_private;
@@ -303,7 +282,6 @@ static struct drm_driver rockchip_drm_driver = {
 				  DRIVER_PRIME | DRIVER_ATOMIC,
 	.load			= rockchip_drm_load,
 	.unload			= rockchip_drm_unload,
-	.preclose		= rockchip_drm_preclose,
 	.lastclose		= rockchip_drm_lastclose,
 	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rockchip_drm_crtc_enable_vblank,
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
index 7684503ff765..005634484441 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
@@ -40,7 +40,6 @@ struct rockchip_crtc_funcs {
 	int (*enable_vblank)(struct drm_crtc *crtc);
 	void (*disable_vblank)(struct drm_crtc *crtc);
 	void (*wait_for_update)(struct drm_crtc *crtc);
-	void (*cancel_pending_vblank)(struct drm_crtc *crtc, struct drm_file *file_priv);
 };
 
 struct rockchip_crtc_state {
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index d2932478ff59..8cd840f602b7 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -894,30 +894,10 @@ static void vop_crtc_wait_for_update(struct drm_crtc *crtc)
 	WARN_ON(!wait_for_completion_timeout(&vop->wait_update_complete, 100));
 }
 
-static void vop_crtc_cancel_pending_vblank(struct drm_crtc *crtc,
-					   struct drm_file *file_priv)
-{
-	struct drm_device *drm = crtc->dev;
-	struct vop *vop = to_vop(crtc);
-	struct drm_pending_vblank_event *e;
-	unsigned long flags;
-
-	spin_lock_irqsave(&drm->event_lock, flags);
-	e = vop->event;
-	if (e && e->base.file_priv == file_priv) {
-		vop->event = NULL;
-
-		kfree(&e->base);
-		file_priv->event_space += sizeof(e->event);
-	}
-	spin_unlock_irqrestore(&drm->event_lock, flags);
-}
-
 static const struct rockchip_crtc_funcs private_crtc_funcs = {
 	.enable_vblank = vop_crtc_enable_vblank,
 	.disable_vblank = vop_crtc_disable_vblank,
 	.wait_for_update = vop_crtc_wait_for_update,
-	.cancel_pending_vblank = vop_crtc_cancel_pending_vblank,
 };
 
 static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-06-01 22:06 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 22:06 [PATCH 00/38] nonblocking atomic commits for everyone! Daniel Vetter
2016-06-01 22:06 ` [PATCH 01/38] drm/atomic-helper: use for_each_*_in_state more Daniel Vetter
2016-06-02 11:26   ` Maarten Lankhorst
2016-06-01 22:06 ` [PATCH 02/38] drm/i915: Use drm_atomic_get_existing_plane_state Daniel Vetter
2016-06-02 11:25   ` Maarten Lankhorst
2016-06-02 13:40     ` Daniel Vetter
2016-06-01 22:06 ` [PATCH 03/38] drm/msm: Use for_each_*_in_state Daniel Vetter
2016-06-02 13:13   ` Maarten Lankhorst
2016-06-01 22:06 ` [PATCH 04/38] drm/rcar-du: " Daniel Vetter
2016-06-02 13:14   ` Maarten Lankhorst
2016-06-02 13:48     ` Daniel Vetter
2016-06-02 21:08   ` Laurent Pinchart
2016-06-01 22:06 ` [PATCH 05/38] drm/vc4: Use for_each_plane_in_state Daniel Vetter
2016-06-02 13:15   ` Maarten Lankhorst
2016-06-01 22:06 ` [PATCH 06/38] drm/omap: " Daniel Vetter
2016-06-02 13:23   ` Maarten Lankhorst
2016-06-02 13:50     ` Daniel Vetter
2016-06-02 21:08   ` Laurent Pinchart
2016-06-01 22:06 ` [PATCH 07/38] drm/exynos: Use for_each_crtc_in_state Daniel Vetter
2016-06-02 13:23   ` Maarten Lankhorst
2016-06-01 22:06 ` [PATCH 08/38] drm/atomic: Add __drm_atomic_get_current_plane_state Daniel Vetter
2016-06-02 13:41   ` Maarten Lankhorst
2016-06-02 14:21   ` [PATCH] " Daniel Vetter
2016-06-02 14:43     ` Maarten Lankhorst
2016-06-02 14:59       ` Daniel Vetter
2016-06-02 14:47     ` Eric Engestrom
2016-06-01 22:06 ` [PATCH 09/38] drm: Consolidate connector arrays in drm_atomic_state Daniel Vetter
2016-06-01 22:06 ` [PATCH 10/38] drm: Consolidate plane " Daniel Vetter
2016-06-01 22:06 ` [PATCH 11/38] drm: Consolidate crtc " Daniel Vetter
2016-06-02 14:42   ` Maarten Lankhorst
2016-06-02 15:20     ` Daniel Vetter
2016-06-01 22:06 ` [PATCH 12/38] drm/fence: add fence to drm_pending_event Daniel Vetter
2016-06-02 18:49   ` Sean Paul
2016-06-02 20:15     ` Daniel Vetter
2016-06-01 22:06 ` [PATCH 13/38] drm/atomic-helper: Massage swap_state signature somewhat Daniel Vetter
2016-06-01 22:06 ` [PATCH 14/38] drm/arc: Nuke event_list Daniel Vetter
2016-06-01 22:06   ` Daniel Vetter
2016-06-01 22:06 ` [PATCH 15/38] drm/arc: Actually bother with handling atomic events Daniel Vetter
2016-06-01 22:06   ` Daniel Vetter
2016-06-01 22:06 ` [PATCH 16/38] drm/hdlcd: Clean up crtc hooks Daniel Vetter
2016-06-02 13:33   ` Daniel Vetter
2016-06-01 22:06 ` [PATCH 17/38] drm/hdlcd: Fix up crtc_state->event handling Daniel Vetter
2016-06-01 22:06 ` [PATCH 18/38] drm/fsl-du: Implement some semblance of vblank event handling Daniel Vetter
2016-06-03 17:43   ` Stefan Agner
2016-06-01 22:06 ` [PATCH 19/38] drm/hisilicon: " Daniel Vetter
2016-06-17  2:09   ` Xinliang Liu
2016-06-17  7:23     ` Daniel Vetter
2016-06-17  8:38       ` Xinliang Liu
2016-06-17 12:24         ` Daniel Vetter
2016-06-21  1:32           ` Xinliang Liu
2016-06-21  7:19             ` Daniel Vetter
2016-06-22  2:50               ` Xinliang Liu
2016-06-01 22:06 ` [PATCH 20/38] drm/sun4i: " Daniel Vetter
2016-06-01 22:06 ` [PATCH 21/38] drm/atomic: kerneldoc for drm_atomic_crtc_needs_modeset Daniel Vetter
2016-06-01 22:06 ` [PATCH 22/38] drm/atomic-helper: nonblocking commit support Daniel Vetter
2016-06-02  9:56   ` [PATCH 1/2] drm/atomic: Add struct drm_crtc_commit to track async updates Daniel Vetter
2016-06-02  9:56     ` [PATCH 2/2] drm/atomic-helper: nonblocking commit support Daniel Vetter
2016-06-01 22:06 ` [PATCH 23/38] drm/hdlcd: Use helper support for nonblocking commits Daniel Vetter
2016-06-01 22:06 ` [PATCH 24/38] drm/arc: Implement nonblocking commit correctly Daniel Vetter
2016-06-01 22:06   ` Daniel Vetter
2016-06-01 22:06 ` [PATCH 25/38] drm/i915: Signal drm events for atomic Daniel Vetter
2016-06-01 22:06 ` [PATCH 26/38] drm/i915: Roll out the helper nonblock tracking Daniel Vetter
2016-06-01 22:06 ` [PATCH 27/38] drm/i915: nonblocking commit Daniel Vetter
2016-06-01 22:06 ` [PATCH 28/38] drm/i915: Use atomic commits for legacy page_flips Daniel Vetter
2016-06-01 22:06 ` [PATCH 29/38] drm/i915: Move fb_bits updating later in atomic_commit Daniel Vetter
2016-06-01 22:06 ` [PATCH 30/38] drm/rockchip: Disarm vop->is_enabled Daniel Vetter
2016-06-01 22:06 ` [PATCH 31/38] drm/rockchip: Fix crtc_state->event signalling Daniel Vetter
2016-06-01 22:06 ` [PATCH 32/38] drm/rockchip: convert to helper nonblocking atomic commit Daniel Vetter
2016-06-01 22:06 ` Daniel Vetter [this message]
2016-06-01 22:06 ` [PATCH 34/38] drm/virtio: Don't reinvent a flipping wheel Daniel Vetter
2016-06-01 22:06 ` [PATCH 35/38] drm: Replace fb_helper->atomic with mode_config->atomic_commit Daniel Vetter
2016-06-01 22:06 ` [PATCH 36/38] drm: Resurrect atomic rmfb code Daniel Vetter
2016-06-01 22:07 ` [PATCH 37/38] drm/sti: Don't call drm_helper_disable_unused_functions Daniel Vetter
2016-06-17 10:04   ` Benjamin Gaignard
2016-06-17 12:27     ` Daniel Vetter
2016-06-01 22:07 ` [PATCH 38/38] drm/crtc-helper: disable_unused_functions really isn't for atomic Daniel Vetter
2016-06-02 13:10 ` ✗ Ro.CI.BAT: failure for nonblocking atomic commits for everyone! 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=1464818821-5736-34-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mark.yao@rock-chips.com \
    --cc=tomeu.vizoso@collabora.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.