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@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 13/21] drm/imx: Unconfuse preclose logic
Date: Fri,  8 Jan 2016 21:36:45 +0100	[thread overview]
Message-ID: <1452285413-28459-14-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1452285413-28459-1-git-send-email-daniel.vetter@ffwll.ch>

So this one is special, since it tries to prevent races when userspace
crashes simply by disabling the vblank machinery. Well except that imx
always has vblanks enabled, and the disable_vblank hook actually just
tries to cancel a pending pageflip. Without any locking whatsoever. Of
course this is wrong, since it'll result in the hw not actually
displaying what drm thinks is the current frontbuffer.

Well since the core takes care of the disappearing DRM fd now. So we
can nuke all this confused code without ill side-effects.

Someone else needs to audit the locking for ->newfb and
->page_flip_event and fix it up. Common approach is to reuse
dev->event_lock for this.

Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/imx/imx-drm-core.c | 13 -------------
 drivers/gpu/drm/imx/ipuv3-crtc.c   |  4 ----
 2 files changed, 17 deletions(-)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 7be7ac808304..ff94ca4a2c1e 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -171,18 +171,6 @@ static void imx_drm_disable_vblank(struct drm_device *drm, unsigned int pipe)
 	imx_drm_crtc->imx_drm_helper_funcs.disable_vblank(imx_drm_crtc->crtc);
 }
 
-static void imx_drm_driver_preclose(struct drm_device *drm,
-		struct drm_file *file)
-{
-	int i;
-
-	if (!file->is_master)
-		return;
-
-	for (i = 0; i < MAX_CRTC; i++)
-		imx_drm_disable_vblank(drm, i);
-}
-
 static const struct file_operations imx_drm_driver_fops = {
 	.owner = THIS_MODULE,
 	.open = drm_open,
@@ -462,7 +450,6 @@ static struct drm_driver imx_drm_driver = {
 	.load			= imx_drm_driver_load,
 	.unload			= imx_drm_driver_unload,
 	.lastclose		= imx_drm_driver_lastclose,
-	.preclose		= imx_drm_driver_preclose,
 	.set_busid		= drm_platform_set_busid,
 	.gem_free_object	= drm_gem_cma_free_object,
 	.gem_vm_ops		= &drm_gem_cma_vm_ops,
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index 30a57185bdb4..846b5f558897 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -285,10 +285,6 @@ static int ipu_enable_vblank(struct drm_crtc *crtc)
 
 static void ipu_disable_vblank(struct drm_crtc *crtc)
 {
-	struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
-
-	ipu_crtc->page_flip_event = NULL;
-	ipu_crtc->newfb = NULL;
 }
 
 static int ipu_set_interface_pix_fmt(struct drm_crtc *crtc,
-- 
2.6.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-01-08 20:37 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 20:36 [PATCH 00/21] drm_event cleanup Daniel Vetter
2016-01-08 20:36 ` [PATCH 01/21] drm: kerneldoc for drm_fops.c Daniel Vetter
2016-01-08 20:36 ` [PATCH 02/21] drm: Add functions to setup/tear down drm_events Daniel Vetter
2016-01-08 21:10   ` Alex Deucher
2016-01-09 13:27   ` [PATCH] " Daniel Vetter
2016-01-08 20:36 ` [PATCH 03/21] drm/exynos: Use the new event init/free functions Daniel Vetter
2016-01-08 20:36 ` [PATCH 04/21] drm/vmwgfx: " Daniel Vetter
2016-01-08 20:36 ` [PATCH 05/21] drm: Create drm_send_event helpers Daniel Vetter
2016-01-09 13:28   ` [PATCH] " Daniel Vetter
2016-01-08 20:36 ` [PATCH 06/21] drm/fsl: Remove preclose hook Daniel Vetter
2016-01-08 20:36 ` [PATCH 07/21] drm/armada: Remove NULL open/pre/postclose hooks Daniel Vetter
2016-01-08 20:36 ` [PATCH 08/21] drm/gma500: Remove empty preclose hook Daniel Vetter
2016-01-08 20:36 ` [PATCH 09/21] drm: Clean up pending events in the core Daniel Vetter
2016-01-09 13:28   ` [PATCH] " Daniel Vetter
2016-01-10 23:48     ` Laurent Pinchart
2016-01-11 14:51       ` [Intel-gfx] " Daniel Stone
2016-01-14 18:49         ` Laurent Pinchart
2016-01-08 20:36 ` [PATCH 10/21] drm/i915: Nuke intel_modeset_preclose Daniel Vetter
2016-01-08 20:36 ` [PATCH 11/21] drm/atmel: Nuke preclose Daniel Vetter
2016-01-08 20:36 ` [PATCH 12/21] drm/exynos: Remove event cancelling from postclose Daniel Vetter
2016-01-08 20:36 ` Daniel Vetter [this message]
2016-01-08 20:36 ` [PATCH 14/21] drm/msm: Nuke preclose hooks Daniel Vetter
2016-01-08 20:36 ` [PATCH 15/21] drm/omap: Nuke close hooks Daniel Vetter
2016-01-11  0:03   ` Laurent Pinchart
2016-01-11  7:10     ` Daniel Vetter
2016-01-08 20:36 ` [PATCH 16/21] drm/rcar: Nuke preclose hook Daniel Vetter
2016-01-11  0:01   ` Laurent Pinchart
2016-01-08 20:36 ` [PATCH 17/21] drm/shmob: " Daniel Vetter
2016-01-10 22:26   ` [PATCH 1/5] " Daniel Vetter
2016-01-10 22:26     ` [PATCH 2/5] drm/tegra: Stop cancelling page flip events Daniel Vetter
2016-01-10 22:26     ` [PATCH 3/5] drm/tilcdc: Nuke preclose hook Daniel Vetter
2016-01-10 22:26     ` [PATCH 4/5] drm/vc4: " Daniel Vetter
2016-01-10 22:26     ` [PATCH 5/5] drm/vmwgfx: " Daniel Vetter
2016-01-11 10:20       ` Thomas Hellstrom
2016-01-11  0:00     ` [PATCH 1/5] drm/shmob: " Laurent Pinchart
2016-01-08 20:36 ` [PATCH 18/21] drm/tegra: Stop cancelling page flip events Daniel Vetter
2016-01-08 20:36 ` [PATCH 19/21] drm/tilcdc: Nuke preclose hook Daniel Vetter
2016-01-08 20:36 ` [PATCH 20/21] drm/vc4: " Daniel Vetter
2016-01-08 20:36 ` [PATCH 21/21] drm/vmwgfx: " Daniel Vetter
2016-01-08 20:53   ` Thomas Hellstrom
2016-01-09 10:43     ` Daniel Vetter
2016-01-10 20:52       ` Thomas Hellstrom
2016-01-10 21:59         ` Daniel Vetter
2016-01-10 22:02   ` [PATCH] " Daniel Vetter
2016-01-10 22:17     ` Thomas Hellstrom
2016-01-10 22:22       ` Daniel Vetter
2016-01-08 21:47 ` [PATCH 00/21] drm_event cleanup Alex Deucher
2016-01-09 13:32 ` Daniel Vetter
2016-01-11 11:20 ` ✗ failure: Fi.CI.BAT Patchwork
2016-01-12 16:24   ` Daniel Vetter

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=1452285413-28459-14-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 \
    /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.