* [PATCH] drm/i915: make fbdev initialization asynchronous v2
@ 2014-05-28 21:39 Jesse Barnes
2014-05-28 21:40 ` Daniel Vetter
2014-08-29 18:52 ` Chris Wilson
0 siblings, 2 replies; 5+ messages in thread
From: Jesse Barnes @ 2014-05-28 21:39 UTC (permalink / raw)
To: intel-gfx
This gets us out of our init code and out to userspace quite a bit
faster, but does open us up to some bugs given the state of our init
time locking.
v2: switch to async_schedule (Chris)
check with lockdep, seems happy (Jesse)
move hotplug enable flag set to fbdev_initial_config (Jesse)
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/i915/i915_dma.c | 6 ++----
drivers/gpu/drm/i915/intel_drv.h | 9 +++++++--
drivers/gpu/drm/i915/intel_fbdev.c | 9 +++++++--
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index eedb023..8bbc289 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -28,6 +28,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/async.h>
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_fb_helper.h>
@@ -1367,10 +1368,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
* scanning against hotplug events. Hence do this first and ignore the
* tiny window where we will loose hotplug notifactions.
*/
- intel_fbdev_initial_config(dev);
-
- /* Only enable hotplug handling once the fbdev is fully set up. */
- dev_priv->enable_hotplug_processing = true;
+ async_schedule(intel_fbdev_initial_config, dev_priv);
drm_kms_helper_poll_init(dev);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 328b1a7..a563a83 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -25,6 +25,7 @@
#ifndef __INTEL_DRV_H__
#define __INTEL_DRV_H__
+#include <linux/async.h>
#include <linux/i2c.h>
#include <linux/hdmi.h>
#include <drm/i915_drm.h>
@@ -787,7 +788,7 @@ void intel_dvo_init(struct drm_device *dev);
/* legacy fbdev emulation in intel_fbdev.c */
#ifdef CONFIG_DRM_I915_FBDEV
extern int intel_fbdev_init(struct drm_device *dev);
-extern void intel_fbdev_initial_config(struct drm_device *dev);
+extern void intel_fbdev_initial_config(void *data, async_cookie_t cookie);
extern void intel_fbdev_fini(struct drm_device *dev);
extern void intel_fbdev_set_suspend(struct drm_device *dev, int state);
extern void intel_fbdev_output_poll_changed(struct drm_device *dev);
@@ -798,8 +799,12 @@ static inline int intel_fbdev_init(struct drm_device *dev)
return 0;
}
-static inline void intel_fbdev_initial_config(struct drm_device *dev)
+static inline void intel_fbdev_initial_config(void *data, async_cookie_t cookie)
{
+ struct drm_i915_private *dev_priv = data;
+
+ /* Only enable hotplug handling once the fbdev is fully set up. */
+ dev_priv->enable_hotplug_processing = true;
}
static inline void intel_fbdev_fini(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index f73ba5e..9e7e45b 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -24,6 +24,7 @@
* David Airlie
*/
+#include <linux/async.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -636,13 +637,16 @@ int intel_fbdev_init(struct drm_device *dev)
return 0;
}
-void intel_fbdev_initial_config(struct drm_device *dev)
+void intel_fbdev_initial_config(void *data, async_cookie_t cookie)
{
- struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_i915_private *dev_priv = data;
struct intel_fbdev *ifbdev = dev_priv->fbdev;
/* Due to peculiar init order wrt to hpd handling this is separate. */
drm_fb_helper_initial_config(&ifbdev->helper, ifbdev->preferred_bpp);
+
+ /* Only enable hotplug handling once the fbdev is fully set up. */
+ dev_priv->enable_hotplug_processing = true;
}
void intel_fbdev_fini(struct drm_device *dev)
@@ -651,6 +655,7 @@ void intel_fbdev_fini(struct drm_device *dev)
if (!dev_priv->fbdev)
return;
+ async_synchronize_full();
intel_fbdev_destroy(dev, dev_priv->fbdev);
kfree(dev_priv->fbdev);
dev_priv->fbdev = NULL;
--
1.8.4.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: make fbdev initialization asynchronous v2
2014-05-28 21:39 [PATCH] drm/i915: make fbdev initialization asynchronous v2 Jesse Barnes
@ 2014-05-28 21:40 ` Daniel Vetter
2014-05-28 21:53 ` Jesse Barnes
2014-08-29 18:52 ` Chris Wilson
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2014-05-28 21:40 UTC (permalink / raw)
To: Jesse Barnes; +Cc: intel-gfx
On Wed, May 28, 2014 at 02:39:03PM -0700, Jesse Barnes wrote:
> This gets us out of our init code and out to userspace quite a bit
> faster, but does open us up to some bugs given the state of our init
> time locking.
>
> v2: switch to async_schedule (Chris)
> check with lockdep, seems happy (Jesse)
> move hotplug enable flag set to fbdev_initial_config (Jesse)
>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
FBDEV=n and let userspace deal with probing?
-Daniel
> ---
> drivers/gpu/drm/i915/i915_dma.c | 6 ++----
> drivers/gpu/drm/i915/intel_drv.h | 9 +++++++--
> drivers/gpu/drm/i915/intel_fbdev.c | 9 +++++++--
> 3 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index eedb023..8bbc289 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -28,6 +28,7 @@
>
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> +#include <linux/async.h>
> #include <drm/drmP.h>
> #include <drm/drm_crtc_helper.h>
> #include <drm/drm_fb_helper.h>
> @@ -1367,10 +1368,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
> * scanning against hotplug events. Hence do this first and ignore the
> * tiny window where we will loose hotplug notifactions.
> */
> - intel_fbdev_initial_config(dev);
> -
> - /* Only enable hotplug handling once the fbdev is fully set up. */
> - dev_priv->enable_hotplug_processing = true;
> + async_schedule(intel_fbdev_initial_config, dev_priv);
>
> drm_kms_helper_poll_init(dev);
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 328b1a7..a563a83 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -25,6 +25,7 @@
> #ifndef __INTEL_DRV_H__
> #define __INTEL_DRV_H__
>
> +#include <linux/async.h>
> #include <linux/i2c.h>
> #include <linux/hdmi.h>
> #include <drm/i915_drm.h>
> @@ -787,7 +788,7 @@ void intel_dvo_init(struct drm_device *dev);
> /* legacy fbdev emulation in intel_fbdev.c */
> #ifdef CONFIG_DRM_I915_FBDEV
> extern int intel_fbdev_init(struct drm_device *dev);
> -extern void intel_fbdev_initial_config(struct drm_device *dev);
> +extern void intel_fbdev_initial_config(void *data, async_cookie_t cookie);
> extern void intel_fbdev_fini(struct drm_device *dev);
> extern void intel_fbdev_set_suspend(struct drm_device *dev, int state);
> extern void intel_fbdev_output_poll_changed(struct drm_device *dev);
> @@ -798,8 +799,12 @@ static inline int intel_fbdev_init(struct drm_device *dev)
> return 0;
> }
>
> -static inline void intel_fbdev_initial_config(struct drm_device *dev)
> +static inline void intel_fbdev_initial_config(void *data, async_cookie_t cookie)
> {
> + struct drm_i915_private *dev_priv = data;
> +
> + /* Only enable hotplug handling once the fbdev is fully set up. */
> + dev_priv->enable_hotplug_processing = true;
> }
>
> static inline void intel_fbdev_fini(struct drm_device *dev)
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index f73ba5e..9e7e45b 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -24,6 +24,7 @@
> * David Airlie
> */
>
> +#include <linux/async.h>
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/errno.h>
> @@ -636,13 +637,16 @@ int intel_fbdev_init(struct drm_device *dev)
> return 0;
> }
>
> -void intel_fbdev_initial_config(struct drm_device *dev)
> +void intel_fbdev_initial_config(void *data, async_cookie_t cookie)
> {
> - struct drm_i915_private *dev_priv = dev->dev_private;
> + struct drm_i915_private *dev_priv = data;
> struct intel_fbdev *ifbdev = dev_priv->fbdev;
>
> /* Due to peculiar init order wrt to hpd handling this is separate. */
> drm_fb_helper_initial_config(&ifbdev->helper, ifbdev->preferred_bpp);
> +
> + /* Only enable hotplug handling once the fbdev is fully set up. */
> + dev_priv->enable_hotplug_processing = true;
> }
>
> void intel_fbdev_fini(struct drm_device *dev)
> @@ -651,6 +655,7 @@ void intel_fbdev_fini(struct drm_device *dev)
> if (!dev_priv->fbdev)
> return;
>
> + async_synchronize_full();
> intel_fbdev_destroy(dev, dev_priv->fbdev);
> kfree(dev_priv->fbdev);
> dev_priv->fbdev = NULL;
> --
> 1.8.4.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: make fbdev initialization asynchronous v2
2014-05-28 21:40 ` Daniel Vetter
@ 2014-05-28 21:53 ` Jesse Barnes
0 siblings, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2014-05-28 21:53 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
On Wed, 28 May 2014 23:40:47 +0200
Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, May 28, 2014 at 02:39:03PM -0700, Jesse Barnes wrote:
> > This gets us out of our init code and out to userspace quite a bit
> > faster, but does open us up to some bugs given the state of our init
> > time locking.
> >
> > v2: switch to async_schedule (Chris)
> > check with lockdep, seems happy (Jesse)
> > move hotplug enable flag set to fbdev_initial_config (Jesse)
> >
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
>
> FBDEV=n and let userspace deal with probing?
That's obviously my preferred solution. :)
Or were you suggesting I make a change to this patch too?
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: make fbdev initialization asynchronous v2
2014-05-28 21:39 [PATCH] drm/i915: make fbdev initialization asynchronous v2 Jesse Barnes
2014-05-28 21:40 ` Daniel Vetter
@ 2014-08-29 18:52 ` Chris Wilson
2014-08-29 19:35 ` Daniel Vetter
1 sibling, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2014-08-29 18:52 UTC (permalink / raw)
To: Jesse Barnes; +Cc: intel-gfx
On Wed, May 28, 2014 at 02:39:03PM -0700, Jesse Barnes wrote:
> This gets us out of our init code and out to userspace quite a bit
> faster, but does open us up to some bugs given the state of our init
> time locking.
>
> v2: switch to async_schedule (Chris)
> check with lockdep, seems happy (Jesse)
> move hotplug enable flag set to fbdev_initial_config (Jesse)
>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: make fbdev initialization asynchronous v2
2014-08-29 18:52 ` Chris Wilson
@ 2014-08-29 19:35 ` Daniel Vetter
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2014-08-29 19:35 UTC (permalink / raw)
To: Chris Wilson, Jesse Barnes, intel-gfx
On Fri, Aug 29, 2014 at 07:52:10PM +0100, Chris Wilson wrote:
> On Wed, May 28, 2014 at 02:39:03PM -0700, Jesse Barnes wrote:
> > This gets us out of our init code and out to userspace quite a bit
> > faster, but does open us up to some bugs given the state of our init
> > time locking.
> >
> > v2: switch to async_schedule (Chris)
> > check with lockdep, seems happy (Jesse)
> > move hotplug enable flag set to fbdev_initial_config (Jesse)
> >
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Queued for -next, thanks for the patch. I've fixed up the conflicts due to
the removal of enable_hotplug_processing while applying.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-29 19:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-28 21:39 [PATCH] drm/i915: make fbdev initialization asynchronous v2 Jesse Barnes
2014-05-28 21:40 ` Daniel Vetter
2014-05-28 21:53 ` Jesse Barnes
2014-08-29 18:52 ` Chris Wilson
2014-08-29 19:35 ` Daniel Vetter
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).